Page 1 of 1

mail() just stopped working!

Posted: Sat Mar 18, 2006 9:31 am
by gnu2tux
Hi,

I am running Debian 3.1 on my servers with PHP4, and a couple of weeks ago all my scripts (and other sites that use the mail() function just stopped working).

For example - phpbb gives a mailer.php error, which I thought may just be PHPbb specific, but then I started noticing today that all the scripts I have tidied away for only my access which are very basic, suddenly don't work.

There is no error coming back from php when the mail function is called in the browser, and I can't see any annoucements on php.net for feature change, the only changes that could have been made to my servers would have been debian security updates.

Today I broke it down to it's most simplest:

<?
mail ('myaddress@mydomain.net','Hi','blah','sendersaddress@somedomain.net');
?>

I saved it as mailer.php and executed it from my browser. No errors, no nothing. I checked the mail logs, nothing came from the webserver mailwise, so it's not like anti-spam/virus is messing it up.

This all worked perfectly a few weeks ago or less. Any ideas why all of a sudden it's broken? I rely on the mail() function for many websites.

:(

Al.

Posted: Sat Mar 18, 2006 9:38 am
by feyd
Did your host change some settings? Have you tried using a SMTP server as the sending route?

Posted: Sat Mar 18, 2006 9:43 am
by gnu2tux
thanks for getting back in touch.

I installed php4-cli to test the mailer.php script and it came back with a postfix error.

Turns out that the security hardening I did a couple of weeks ago is to blame!

My bad.

Thanks for helping out -- btw do you think that using SMTP instead is a better idea? If so why?

Posted: Sat Mar 18, 2006 9:47 am
by feyd
SMTP, in my experience, gives less problems trying to get working than through other means. I find it is faster to send the mails too.