Lunarpages Web Hosting Forum

Author Topic: FormMail.pl - Bad Gateway????  (Read 30294 times)

Offline S13D

  • Trekkie
  • **
  • Posts: 11
FormMail.pl - Bad Gateway????
« on: July 13, 2006, 03:44:33 PM »
I've been having problems with the formmail.pl script. Will someone please help me??? Thanks in advance!!!

LINK TO FORM: http://www.mytourvision.com/contact_us.htm

SEE CONFIG BELOW:

BEGIN
{
  $DEBUGGING         = 1;
  $emulate_matts_code= 0;
  $secure            = 1;
  $allow_empty_ref   = 1;
  $max_recipients    = 1;
  $mailprog          = '/usr/sbin/sendmail -oi -t';
  $postmaster        = '';
  @referers          = qw(mytourvision.com localhost);
  @allow_mail_to     = qw(feedback@mytourvision.com localhost);
  @recipients        = ();
  %recipient_alias   = ();
  @valid_ENV         = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
  $locale            = '';
  $charset           = 'iso-8859-1';
  $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
  $style             = 'http://www.mytourvision.com/css/tourvision.css';
  $no_content        = 0;
  $double_spacing    = 1;
  $wrap_text         = 0;
  $wrap_style        = 1;
  $address_style     = 0;
  $send_confirmation_mail = 0;
  $confirmation_text = <<'END_OF_CONFIRMATION';
From: feedback@mytourvision.com
Subject: Customer Feedback

Thank you for your form submission. TOUR VISION will review it and respond shorly...

END_OF_CONFIRMATION

# You may need to uncomment the line below and adjust the path.
# use lib './lib';


Lupine1647

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #1 on: July 13, 2006, 03:59:20 PM »
Hello:
Please see http://www.lunarforums.com/forum/index.php?topic=18221.0
The FormMail.pl file name is not allowed.

I hope this helps.

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #2 on: July 13, 2006, 04:01:01 PM »
sorry about that... it's actually called feedback.pl on the server. just used that to reference the file in the forum. any thoughts?

i've been reviewing the link you sent me all day. not sure what the problem is... at one point i was able to get the script to send mail to the account but then got error messages... now i'm getting Bad Gateway message for some reason? i'm reviewing the link now. thanks for the the link though. the forum is excellent.

this is my second post!!!
« Last Edit: July 13, 2006, 04:13:07 PM by S13D »

Lupine1647

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #3 on: July 13, 2006, 04:13:19 PM »
Hello:
I'm not sure what might be causing it, but you should use a file name that is less obvious to prevent bot attacks on the script.

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #4 on: July 13, 2006, 04:14:33 PM »
will change it to something less obvious. thanks for the TIP...

leighsww

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #5 on: July 13, 2006, 04:18:02 PM »
Remove the following tag completely from your html form:

Code: [Select]
<input type="hidden" name="recipient">
I've never seen that particular error message before, but the above "recipient" tag shouldn't even be in your html unless you are going to use it with a "value" (as shown in the examples for multiple email addys).

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #6 on: July 13, 2006, 04:22:35 PM »
i'm taking it out now. nothing happened. still getting Bad Gateway...

leighsww

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #7 on: July 13, 2006, 04:26:13 PM »
Are you on a Windows server?

I'm currently looking up that error message via Google to see if there's any info on what that means. You might do the same in case you find it faster.

Lupine1647

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #8 on: July 13, 2006, 04:28:00 PM »
Hello:
mytourvision.com is on a Windows server.

I hope this helps.

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #9 on: July 13, 2006, 04:34:53 PM »
FOUND THIS...

10.5.3 502 Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

AND THIS...

502 - Bad Gateway. Web server received an invalid response while acting as a gateway or proxy. You receive this error message when you try to run a CGI script that does not return a valid set of HTTP headers.

here: http://kb.globalscape.com/article.aspx?id=10141

I remember about reading something about HEADERS messing up email servers? any thoughts???
« Last Edit: July 13, 2006, 05:02:15 PM by S13D »

leighsww

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #10 on: July 13, 2006, 04:42:58 PM »
Did you delete/erase any portion of the script?

If you did (or even if you didn't), reconfigure a fresh copy as your existing one might be corrupted.

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #11 on: July 13, 2006, 04:47:55 PM »
i've tried that 4 different times. i didn't delete anything. i've renamed it. flip-flopped email addresses, compared my script to others on the forum. nothing seems to be working... not sure why... got any other suggestions?

leighsww

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #12 on: July 13, 2006, 04:49:33 PM »
mytourvision.com is on a Windows server.

Ahh, I missed Ryan's post earlier, but this may be the problem.

The shebang line and path to sendmail or SMTP is probably going to be different  for using the perl script on a Windows server.

I'm not familiar with what those configs are. You will need to do a search for how to configure the settings for a Windows server, or if you can't find any info and nobody else posts here who knows the answer, then see if tech support may give you help with that.
« Last Edit: July 13, 2006, 04:52:51 PM by leighsww »

leighsww

  • Guest
Re: FormMail.pl - Bad Gateway????
« Reply #13 on: July 13, 2006, 04:54:35 PM »
P.S. If you do find out what the configs are, please post the answer here so I can revise my tutorial in case other people on a Windows server needs the info. Thanks!

Offline S13D

  • Trekkie
  • **
  • Posts: 11
Re: FormMail.pl - Bad Gateway????
« Reply #14 on: July 13, 2006, 04:55:26 PM »
cheers!  :thumb: