View Full Version : Can't Get BFormMail.pl To Run On New Server
justicentyme
01-26-2008, 04:18 AM
I recently moved a client from one server (ValueWeb.com) to another (godaddy.com). I have a fairly long form that was being processed via BFromMail. It will not run on the new server. I get an 'internal execution error'.
If I comment out the auto reply (!) and send it to FormMail.pl it will execute properly. Even the 'commented out' version will not run with BFormMail.pl.
I have contacted godaddy support but as it is not one of their supplied scripts they will make no effort to help me.
Is there a difference in the two scripts that would require a different version of Perl?
I have recently moved another account to godaddy that has several forms but as I don't need the auto reply feature so I have always used FormMail.pl and they all execute properly.
PHPBB.com has a perl_test.pl script that I ran on ValueWeb before setting up a forum on it. However that script will not execute on godaddy. Is there a script that I can get and run that will check out what version of Perl that godaddy has? (That is what perl_test.pl does but I can;t get it torun).
Any assistance would be greatly appreciated.
Thanks
Noah
FishMonger
01-26-2008, 05:21 AM
It's highly unlikely that the problem is due to the version of Perl. It's more likely it a combination of wrong path to perl in the shebang line and 1 or more modules that your script uses/requires isn't installed on the godaddy server.
I'm not familiar with the BFromMail script, but if you post it (or at least the first 20-30 lines), I'll see if there is any obvious issue.
You can start by adding this line near the beginning and see if you get a better error message.
use CGI::Carp qw(fatalsToBrowser);
justicentyme
01-26-2008, 05:01 PM
FishMonger;
Thank you so very much for your gracious offer of assistance.
I added the line you suggested (both as you posted and also with a leading $) but it made no difference in the error message.
It is apparent that there is something not included on godaddy servers that BFormMail.pl needs that is not required by FormMail.pl but I haven't a clue what it is or how to determine what it is.
Again, I certainly appreciate your offer of assistance.
Noah
KevinADC
01-26-2008, 08:19 PM
This is wrong:
$use CGI::Carp qw(fatalsToBrowser);
there should be no $ at the beginning of the line.
But if you used the correct line and the script still displays a "500 internal server error" the problems are pretty limited:
1. shebang line is wrong (the path to perl, eg: #!/usr/bin/perl)
2. script is upload in wrong format (binary instead of ASCII)
3. permissions are wrong
justicentyme
01-26-2008, 11:15 PM
KevinADC;
Thanks for your response and input.
I am confident that the script (BFormMail.pl) was uploaded in ASCII. (Just like it was on the other server where it functioned and like the FormMail.pl script was also uploaded on both servers. It (FormMail.pl) functions on the godaddy server while the BFormMail.pl script does not execute).
I have also checked permissions and they are indeed set to 755 on the BFormMail.pl script. (Just like they were on the other server where it functioned and like the FormMail.pl script is on both servers. It (FormMail.pl) functions on the godaddy server while the BFormMail.pl script does not execute).
The shebang line in both scripts is:
#!/usr/bin/perl
I am at a loss for direction.
Thanks again for the suggestions.
Noah
oesxyl
01-26-2008, 11:39 PM
ignore this, I miss some parts of your post:
- replace your script with somthing very simple to see if you can run perl
#!/usr/bin/perl -wT
use strict;
print "Content-type: text/html\n\n";
print "it work";
- your script use sendmail, see this line:
$mailprog = '/usr/sbin/sendmail -i -t';
check if:
- if you have sendmail on server
- you can run sendmail from your script
best regards
KevinADC
01-27-2008, 01:02 AM
Well, I am at a loss too. If you want to PM me the information needed to access the account via FTP or a user contrl panel I will take a look and see if I can spot anything. Besides that there is no way to really help you further that I can think of. Maybe Fish or oesxyl can think of something.
KevinADC
01-27-2008, 01:10 AM
Which hosting plan is this site using on godaddy? Linux? Economy, Deluxe, Premium?
Linux Economy does not seem to support perl while the other plans do. None of the Windows hosted accounts seem to support perl.
FishMonger
01-27-2008, 01:45 AM
What is the exact error message after adding the line I suggested?
Can you post a link to your form page so that we can submit it and see the results?
Is it possible the script isn't really setup as you think? I mean, is it possible that you think you uploaded it in ascii mode but really uploaded it in binary or that there's a typo in the shebang line or that the shebang line isn't on line 1 of the script?
Is the BFormMail.pl script in the same directory as the FormMail.pl script?
Personally, I wouldn't use either of those scripts. BFormMail.pl is slightly better due to some of the modifications that they made (it's just a modification of Matt's formmail script), but it's still not good enough. I'd recommend using either the FormMail or TFMail srcipt the the NMS project.
If you want to continue using the BFormMail.pl, we'll help, but based on the info so far, there's little more we can suggest.
justicentyme
01-27-2008, 04:30 AM
First let me heartily thank all of your for your readiness to assist me in resolving this problem. It is greatly appreciated.
The hosting plan is the Deluxe Linux plan.
This is the shebang from BFormMail.pl (which crashes) #!/usr/bin/perl
This is the shebang from FormMail.pl (which executes): #!/usr/bin/perl
I have checked the:
@referers
and the:
@recipients
and they are identical on both the FormMail.pl (which executes) and the BFormMail.pl (which crashes).
I have used PFE (Programmer's File Editor) for 10+ years to edit ASCII files and have never had any problems with it corrupting files.
I have used WS-ftp for about 10 years and Smart FTP for about a year and have transferred hundreds of pages with them so far without any file corruption.
I have checked and re transferred BFormMail.pl with both ftp programs more than a dozen times and the results are the same.
I have four forms on this site http://www.pbcofdecaturalabama.org
which is also on godaddy and they are processed via FormMail.pl and all work fine.
I have WS-ftp set up to 'view' a file on the server with PFE and have checked the BFormMail.pl script and it is just as it was prior to transfer.
I have e-mailed BFormMail.pl coder Brian Sietz to see if he can give me any hints as to why FormMail.pl will execute and BFormMail.pl crashes but I have not heard back from him yet.
What is so confusing to me is that the BFormMail.pl ran flawelessly on the other server. There was no change necessary to get any forms to run on the PBC site when transferred from ValueWeb to godaddy. BUT they call FormMail.pl
Again I GREATLY appreciate all our willingness to help me out.
A big Thanks
Noah
KevinADC
01-27-2008, 06:10 AM
It sounds like you certainly know what you are doing. But I think the only way for anyone to help further is to see the script and/or get access to the website. I understand if you don't want to give anyone access to the site but I really see no way to help without it. Maybe Fish can think of something.
Dang, valueweb sure has an old version of perl installed.
FishMonger
01-27-2008, 06:52 AM
Do you have a shell account? If so, take a look at the error_log, it should give you clues to the cause of the problem. Your server's path may differ, but a common location would be:
/etc/httpd/logs/error_log
KevinADC
01-27-2008, 07:15 AM
I'm pretty sure that godaddy accounts have a control panel so they can view the error log there. I don't think they give users telnet access though.
netroact
01-27-2008, 06:34 PM
Some hosts no longer allow FormMail scipts. I don't know, but maybe this would apply to BFormMail and new accounts only.
justicentyme
01-28-2008, 12:09 AM
A very BIG thanks to all of those who offered assistance.
I did turn on error checking on the 'Control Panel' and after about an hour it started recording . Either the 'Control Panel' or BFormMail.pl also put two files in the cgi directory:
BFormMail.activity_log and BFormMail.debug_log.
I also removed the use CGI::Carp qw(fatalsToBrowser); line.
Then I started getting real error messages.
( invalid recipient in form or undefined in @recipients).
Of course the @recipients variable was exactly like the FormMail.pl (that was working) and the BFprmMail.pl (which did not execute) and the recipient was exacatly the same in the form which processed when sent to FromMail.pl
I looked at both the recipient field in the form and also the @recipients variable until I was blurry eyed. I could tell no difference. But I deleted the @recipients variable and retyped it (several times).
Finally it started working properly.
Then I renamed that BFormMail.pl on the server and uploaded the one that had been on ValueWeb that had worked there and had previously failed on godaddy. Again no execute and again no real error message.
I deleted that BFormMail.pl on the server and renamed the previous version on the server back to BFormMail.pl.
Again, it processes the form properly.
Truthfully, I have no idea what was the problem for when I view the files in the @recipients variable area they look exactly the same.
However one has never worked and one does now work.
I will give it a few days before I put the BFormMail.pl version online.
Again, thanks for all of the gracious assistance.
Noah
Repoman
02-08-2008, 06:21 PM
Ok, I'm just another noob who's having a very similar problem with the nms-formmail.pl script on a GoDaddy hosted site. It's a Deluxe Linux account.
The error log reports this:
Fri Feb 8 11:05:36 2008] [error] malformed header from script. Bad header=Recipient names must be specif: /var/chroot/home/content/f/i/l/filmmentor/html/cgi/FormMail.pl
This is what I'm working with:
BEGIN
{
$DEBUGGING = 1;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 2;
$mailprog = '/usr/lib/sendmail';
$postmaster = qw(owner@domain.com);
@referers = qw(www.filmmentor.com 72.167.135.233);
@allow_mail_to = qw(mac.com);
@recipients = qw(my_email_addy@mac.com);
%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 = '';
$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: owner@domain.com
Subject: form submission
Thank you for your form submission.
END_OF_CONFIRMATION
I've been playing with this for a couple of days and can't seem to resolve the problem.
I've tried just a domain name and or a complete email address for the @allow_mail_to
variable.
Permissions are set to 755, which I'm told should work fine.
Again, I know very little about these scripts. Can anyone spot anything that's obviously wrong? Thanks in advance!
Greg
FishMonger
02-08-2008, 06:46 PM
Try changing:
$mailprog = '/usr/lib/sendmail';
To:
$mailprog = '/usr/lib/sendmail -oi -t';
Also:
@allow_mail_to = qw(mac.com);
probably should hold a valid email address, not just the domain name.
nkrgupta
02-09-2008, 06:06 PM
Please correct me if I'm wrong, but isn't /usr/lib/ directory an unusual place for the sendmail program to reside in, rather than /usr/bin/ or /usr/sbin/ ?
@Repoman: you can verify the above by issuing the command whereis sendmail on the shell prompt.
Also:
@allow_mail_to = qw(mac.com);
probably should hold a valid email address, not just the domain name.It can be a domain name, and in such case all email addresses on that domain will be allowed. (Source - http://www.gsp.com/support/virtual/web/cgi/lib/formmail/docs/readme.html )
Repoman
02-10-2008, 08:55 AM
Fish, you solved my problem! Works like a charm. I just want to say thanks to you and nkgrupta for your assistance. It's much appreciated.
Greg
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.