PDA

View Full Version : Formmail


Aussies-Online
03-10-2003, 10:05/10:05AM
Anyone familiar with formmail?

I have been using it for a number of years and there were nothing wrong with it until my host's server went down.

Cannot get him to fix anything unless I find the problem myself.

The server does not seem to execute the script. Instead it simply link to it, which then open a 500 error page.
My guess would be that the cgi-bin on the server does not work.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@aussies-online.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.27 Server at www.aussies-online.com Port 80


Can anyone give me a clue? I wrote to Matt 2 days ago but he did not reply either.

ihelpyou
03-10-2003, 10:11/10:11AM
They changed up the script about one year ago. If your host is using the old script, it will not work now. It's your host's problem, not yours! :)

Aussies-Online
03-10-2003, 10:19/10:19AM
No, that is not the problem. We are both up to speed about the latest script. He actually asked everyone to update it for security reasons after I told him there were a new one.

Webmaster T
03-10-2003, 10:44/10:44AM
#!/usr/bin/perl -w


use CGI;
use strict;
my $q = new CGI();


print $q->header;
print $q->start_html(-title=>'Hello World ',- bgcolor=>'#ffffff');

print qq(<h1>Hello World</h1>);


print $q->end_html, "\n";

__END__

This script will tell you if the problem is server configuration or script related it should write "Hello World" to the page if the server is configured properly and the path (line 1 if UNIX) is correct.

Blue
03-10-2003, 10:55/10:55AM
Originally posted by Aussies-Online
... I wrote to Matt 2 days ago but he did not reply either. If this is a reference to the frommail script from MSA (Matt Wright's script), I would suggest that you use instead the formmail script from NMS (http://nms-cgi.sourceforge.net/scripts.shtml) as it's known that there are security vulnerabilities in Matt's version. The NMS version has addressed these issues, and has Matts approval.

Further, I suggest you rename this script to something other than formmail.pl (use anything not containing the words "form" or "mail"), as many hackers search the net for "formmail.pl", "formmail", "form" , and "mail".

Aussies-Online
03-10-2003, 11:27/11:27AM
Originally posted by Webmaster T
[B
This script will tell you if the problem is server configuration or script related it should write "Hello World" to the page if the server is configured properly and the path (line 1 if UNIX) is correct. [/B]

OK. Thanks for that.

Your script does work.

So does that mean that my script does not?

I have made no changes to it. How is it possible that it work one day and not the next?

Aussies-Online
03-10-2003, 11:34/11:34AM
Originally posted by Blue
If this is a reference to the frommail script from MSA (Matt Wright's script),


Good Day Blue

Yes it is the Matt Wright formmail.
Early this year my host was having some security problems with it. I told him that I was updating to the latest version and renaming it so that they could not find it.
Two minutes later he was sending a memo asking everyone to do the same. I am still waiting for my check. lol

I will go and check NMS. Thanks for that.

Webmaster T
03-10-2003, 11:39/11:39AM
Originally posted by Aussies-Online
[B]OK. Thanks for that.

Your script does work.

So does that mean that my script does not?

I have made no changes to it. How is it possible that it work one day and not the next?Good now you have isolated the problem to it being the formail script. Did you check the path to the mail program? Did you check to see if the formail script was hacked even after the changes that is still a very vulnerable script.

Aussies-Online
03-10-2003, 11:51/11:51AM
Originally posted by Webmaster T
Good now you have isolated the problem to it being the formail script. Did you check the path to the mail program? Did you check to see if the formail script was hacked even after the changes that is still a very vulnerable script.

Yes I have done all that. I have not touched that script since I configured it the first time.
And just to make sure that it had not been hacked, I did upload the original version from my PC to the host as well as the submit page.

Yes it was uploaded in ASCII and yes it has the attribute 755.

Webmaster T
03-10-2003, 12:04/12:04PM
Originally posted by Aussies-Online
[B]Good Day Blue

Yes it is the Matt Wright formmail.
Early this year my host was having some security problems with it. I told him that I was updating to the latest version and renaming it so that they could not find it. Yes the only problem with that is the script has stuff that is easily identified particularly the hidden fields for recipients, sort, receipts etc.

Aussies-Online
03-10-2003, 13:38/01:38PM
I have install NMS and I still get exactly the same error than before.

My host has not reply to my emails for the last 3 days. Last night I did send him an email asking him to fix it or close my account.

Today he has re-bill me for another month.

What do I do?

Blue
03-10-2003, 19:54/07:54PM
Originally posted by Aussies-Online
I have install NMS and I still get exactly the same error than before.

My host has not reply to my emails for the last 3 days. Last night I did send him an email asking him to fix it or close my account.

Today he has re-bill me for another month.

What do I do? It truly sounds like you need a host that has much better tech support. Are you sure you can't switch to a Linux system (because HTTPme IS really great!!!).

If you followed his TOS in asking to close the account and he still billed you for another month, you have legal recourse.

Document the steps you are taking (and already have taken) and do a charge-back on your CC. Find another host quick.

As to the script, it should work out of the box if you made all the correct settings. Plus, the old one shouldn't stop working on it's own, unless there have been server changes.

Can you pm the script to me (I can test it on a Linux system if it'll help)?

Aussies-Online
03-10-2003, 22:13/10:13PM
Originally posted by Blue

As to the script, it should work out of the box if you made all the correct settings. Plus, the old one shouldn't stop working on it's own, unless there have been server changes.



I just got a reply from him. But it is the usual "I have not done anything to it. Check your form and your script."

Fact is, everything was working until the system went down for 9 hours. His reply was:

The system was under a major denial of service attack - we've got back up running right now and are working with our router company to apply a fix to avoid this in the future...

When I told him formmail was not working:

We upgraded the php - could that have been it?

Also, the backup was not complete and was at least a month old, so you may need to re-upload the applications.

If that doesn't help, please send very detailed info about what is "not working"! :)

I think I forgot to mention that when you click on the form's submit button, instead of executing the script, it link to it like a normal link and open a html page. The link looks like:
http://www.aussies-online.com/formmail.cgi

Aussies-Online
03-10-2003, 22:42/10:42PM
More information about this error may be available in the server error log.

How can I make an error log for the server?

Aussies-Online
03-10-2003, 23:57/11:57PM
Originally posted by Blue
It truly sounds like you need a host that has much better tech support. Are you sure you can't switch to a Linux system (because HTTPme IS really great!!!).

Would Dreamweaver UltraDev 4 work with Linux?
Does any of my window programs would work with Linux?

Blue
04-10-2003, 00:49/12:49AM
Dreamweaver works fine with Linux. At least I do design and programming work in it (DW) and then upload the files to my remote server (Linux) which then run fine.

Are there specific functions in UltraDev that you're applying only to IIS?

I suppose if you're doing IIS related stuff there may be some changes you'll need to make.

Please be more specific about which Windows programs you are referring to:

Are these programs that run on your remote server or on Windows on your PC?

And which programs are they?

Ask your host if you have access to your sites "raw log files", and specifically any "error log files". If you can download them, you can look for any error messages related to the script.

Aussies-Online
05-10-2003, 04:00/04:00AM
Originally posted by Blue
It truly sounds like you need a host that has much better tech support. Are you sure you can't switch to a Linux system (because HTTPme IS really great!!!).



I don't actually understand what HTTPme is talking about not allowing Windows.

My host http://www.xcite.net
has a linux apache system and has no problems with me working with windows.

Anyway, you are right about one thing. The tech support *****. I never did get any. It is non existant.
I have just ask him about a debug page and he answer that I already have one. I have been there for 5 years and I did not know I had one.

Anyway I have played with that form and got nowhere, so I have gone back to the original script.

On the debug page I get the error
[Sun Oct 5 03:22:55 2003] [error] [client 203.61.130.37] malformed header from script.
Bad header=patrick@aussies-online.com... :

I cannot figure out what this mean because I am an idiot
:D All I know is that it is the email entered in the form under recipient.

I made a simple form for testing at:
http://www.aussies-online.com/2003/form.htm

Blue
05-10-2003, 12:22/12:22PM
I think your current host and HTTPme are quite compatible (meaning you could more than likely switch over easy as pie!!!). I'm not sure what you mean by your "I don't actually understand what HTTPme is talking about not allowing Windows." statement. Could you explain?

If I were you, I'd jump over to HTTPme's forums and start asking questions in the pre-sales thread, though a few of us here (myself, Denny) could probably answer all your questions.

I think you'd be getting a much much much better deal at HTTPme - You'd get more space, bandwidth, and most definately better tech support. I think it's $10/mo more than what you're currently paying but it'd be worth it.

Also, I've sent you a PM.

Webmaster T
05-10-2003, 12:34/12:34PM
Originally posted by Aussies-Online
On the debug page I get the error
[Sun Oct 5 03:22:55 2003] [error] [client 203.61.130.37] malformed header from script.
Bad header=patrick@aussies-online.com... :

I cannot figure out what this mean because I am an idiot
:D All I know is that it is the email entered in the form under recipient.Standard error message, the headers it returns are malformed because the script cacked. Below that message should be a pointer to a line in the script where it cacked. If you are calling a template from formmail and its name is pat@aussies-online.com then I would think the @ sign has to be escaped thusly- pat\@aussies............... the @ sign in perl is the token symbol for an array.

WebSavvy
05-10-2003, 12:48/12:48PM
Blue, I think I understand what he meant. :)

Aussies-Online, what they mean by "Windows" is not the computer you're working on. Please let me explain.

There are UNIX/LINUX servers, and there are Windows/NT servers. The type of servers that are used at HTTPme and your current host, are exactly the same. They both use UNIX/LINUX.

When at HTTPme the reference is made to "Windows/NT" it's made in reference to the server type, and not your personal computer. Does that help to clear things up for you?

As far as your current host, when his server went down, and your scripts began to give a 500 error, what probably happened was Perl became corrupt on the server. He can't just reboot, and then restart Apache and hope it fixes it. He needs to recompile Perl on the server with Apache, and then it should work.

Aussies-Online
06-10-2003, 01:07/01:07AM
Thank you Blue for your help

I'll get working on that script that you did PM me.

Thank you Webmaster T
In this case this was the only error given on the debug's page.

SAVVY 1

You the man!

Yes I now understand what you mean about Windows.

I also think that you are spot on about my host's server having corrupted Perl. That is the only thing which makes sense, considering I had not done anything to the script and the form.

I shall email him that info and see what happen. If you are right, I reckon he own me six months of free hosting.:D

Webmaster T
06-10-2003, 10:29/10:29AM
Hmmm, if Perl was corrupted that script I provided shouldn't have run either. Did you check the path to the mail server with your hosting company?

Aussies-Online
06-10-2003, 11:35/11:35AM
Originally posted by Webmaster T
Hmmm, if Perl was corrupted that script I provided shouldn't have run either. Did you check the path to the mail server with your hosting company?

Yep! Did not think of that.

This is his reply:
That might be true, but I'd look at my script a little closer.

The fact of the matter is that I must have been running formmail for almost 3 years and never had any problems.
I updated it to the latest version some months ago and I have not touched it since.

If it requires any changes, it is because something on the server has been change. In which case I should be told about it. But I am told that this is not the case.
It has not been hacked either because I uploaded the original copy from my PC half a dozen times as I was trying various setups. And they are not that many settings to play with in that script. It is all straight forward.

WebSavvy
06-10-2003, 11:40/11:40AM
Originally posted by Aussies-Online
SAVVY 1

You the man!
... erm ... NO ... I am not the man!

I am the WOman! :D

Savvy1=Deb= FEMALE :slywink:

Aussies-Online
06-10-2003, 12:01/12:01PM
Originally posted by Blue

Also, I've sent you a PM.

I have just copied your script without changing anything. I get the same 500 error.
And the debug page says:
[Mon Oct 6 11:54:52 2003] [error] [client 203.61.132.194] malformed header from script. Bad header=patrick@aussies-online.com... :
/New.cgi: close sendmail pipe failed, mailprog=[/usr/lib/sendmail -oi -t] at (eval 8) line 108.

I get this Bad header=patrick@aussies-online.com... : with the other script as well.

Aussies-Online
06-10-2003, 12:07/12:07PM
Originally posted by savvy1
... erm ... NO ... I am not the man!

I am the WOman! :D

Savvy1=Deb= FEMALE :slywink:

Ok... But you might not even be the woman now after Webmaster T's remark.:)

WebSavvy
06-10-2003, 12:22/12:22PM
heh heh LOL! :)

We had another server before that went down. Several PERL modules became corrupt. Some CGI would run w/o errors while others would just 500 and die.

If CGI@Push and CGI@pm are corrupt, some PERL will run (even debug such as WebmasterT gave you) however, a full CGI program (like formmail.pl) would 500 and die.

In order to correct it, there needs to be a fresh full install of PERL on the server again, recompiled with apache, and then reboot the server. :D

<I am still the WOman!> ;)

Aussies-Online
06-10-2003, 12:39/12:39PM
Originally posted by savvy1
heh heh LOL! :)


If CGI@Push and CGI@pm are corrupt, some PERL will run (even debug such as WebmasterT gave you) however, a full CGI program (like formmail.pl) would 500 and die.

<I am still the WOman!> ;)

Ok then! If you are right about this, I am back in business (well not quite:( ) and you are still the woman!:cool:

I have just found a backup of my system on CD from last May. I will be able to compare that form and script to see if they have change.

Aussies-Online
06-10-2003, 13:21/01:21PM
Just uploaded the copy of the form and script from that backup CD.

No difference. So I was right and he is wrong. But I knew that from the beginning. I just don't know how many weeks it will take to convince him, that is all :cool:

Blue
06-10-2003, 17:39/05:39PM
You've probably already tried this, but check to see that the permissions are set right for the script.

Aussies-Online
07-10-2003, 09:09/09:09AM
OK, he finally has done something, but he still don't explain it in terms that I can understand.

When I dump out to screen instead of MAIL, this is what I get:
What does he mean by that?

To: Patrick@aussies-online.com
From: test@xcite.net (test)
Subject: Aussies-Online_submission

Below is the result of your feedback form. It was submitted by
test (test@xcite.net) on Tuesday, October 7, 2003 at 05:33:59
---------------------------------------------------------------------------

Title: test

URL: http://www.test.com/

Description: test

Locality: test

Postcode: test

Submit: Submit

---------------------------------------------------------------------------

REMOTE_ADDR: 68.39.97.39
HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt; AT&T
WNS5.0)
Location: http://www.aussies-online.com/Thank_You.htm

Location: http://www.aussies-online.com/Thank_You.htm

Blue
07-10-2003, 10:05/10:05AM
Originally posted by Aussies-Online
OK, he finally has done something, but he still don't explain it in terms that I can understand.

When I dump out to screen instead of MAIL, this is what I get:
What does he mean by that?

Most likely, he means that he is running the script through a debugger that prints out to his computer monitor. It would show any error codes (plus explanations). It looks like it's working now?

Aussies-Online
07-10-2003, 12:13/12:13PM
I wrote him a long letter tonight and he finally did fix it half an hour ago.

This is what he is saying:

It was unrelated - the problem was in the sendmail config file and an upgrade that was done that overrode the usual values which normally get preserved during an upgrade.

I have read it ten times and I cannot find the apology in it. Can you help me find it please? :D

WebSavvy
08-10-2003, 06:34/06:34AM
If he's running CPanel 6,7+ on the server and just upgraded to the new release (a patch to fix some code bugs in the last release) then it's quite possible it overwrote the permissions in the sendmail config file. It's also been known to mess with the ability to run FTP without server hangups.

We just went to CPanel 8 running edge & stable.

So if he didn't know about the CPanel bug issues, then it's quite possible he didn't really know there was any issues with his server. At least he has it sorted out now. :)

Aussies-Online
08-10-2003, 08:46/08:46AM
It is actually better than that.

Not only he did not know, but he still did not believe that was the problem. He was so persuaded that it was me!

When I told him it was working, he nearly fell off his chair and went immediately re-test my form to make sure I was not having him on.

This is the problem I am having with most people. People simply don't listen what you tell them. They live in their own little world thinking they know it all.
I knew I had not done anything to that script, but when he told me to check it, I did, just to make sure. He just sat there for 10 days thinking "I am God and I can do no wrong".

I knew I would have to push him into doing something by keeping the pressure on. Or else, get a new service provider. And I am still reluctant to do that because his prices have been very good. He brought his price down to $25.00 a month 3 years ago. Not many can compete with this, even today. And his server is up 100% of the time. Except when it crashes. Every two or three months something happen. Often some new security problems surfacing and you are down for a number of hours.
The only thing missing is the technical support. Maybe that is why he is cheap.

Anyway, I want to thank you all for your help. It is really great to be able to come here and seek help when I need it.

When I get a minute, I will setup that NMS formmail and see if I can get it to work. Right now I am busy installing a new navigation bar on every pages of my website.