RE: PHP4 and mail() suddenly not working
| From: | Ron Bickers | Date: | Tue, 27 Jun 2000 17:59:22 +0000 |
| Subject: | RE: PHP4 and mail() suddenly not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3382@lists.php.net to get a copy of this message | ||
After spending way too much time trying to figure out what was wrong, it
turned out not to be a PHP problem. I don't, however, know why PHP didn't
complain.
The problem was as follows:
I'm running the var-qmail RPMs which provide an /etc/profile.d/qmail.sh that
includes the line QMAILMFTFILE=$HOME/.lists
This is not in the enviornment when the machine is started, but it is set to
/root/.lists when I log in as root. If I then kill httpd and restart it
manually, it is in Apache's environment for every instance of qmail-inject
to use. The problem is that user qmail-inject running as 'nobody' doesn't
have permission to access /root/.lists, so it returns a read error and
doesn't put the message in the queue. However, PHP continues on its happy
way thinking all is well.
Commenting this line out in qmail.sh fixes the problem, but why does PHP not
return an error, or FALSE return code from mail(), when the mailer returns a
failure?
_______________________
Ron Bickers
Logic Etc, Inc.
rbickers@logicetc.com
> -----Original Message-----
> From: Ron Bickers [mailto:rbickers@logicetc.com]
> Sent: Monday, June 26, 2000 11:47 PM
> To: php-general@lists.php.net
> Subject: PHP4 and mail() suddenly not working
>
>
> I'm running Apache 1.3.12 on RH Linux 6.2 w/ PHP 4.0.0 as a DSO module and
> qmail.
>
> On two separate occasions in the last few weeks, mail() has
> stopped sending
> mail apparently out of the blue for all of the several dozen
> virtual domains
> using mail in PHP. No errors, no complaints, but there is no
> record in the
> maillog of any mail going out. Restarting httpd doesn't seem to
> fix it, but
> rebooting did the trick. Then, after an undetermined amount of time, it
> stops working again. Qmail has been running flawlessly for years
> (and still
> is). PHP3 was sending mail through these same scripts for many
> months, and
> PHP4 worked for weeks without any apparent problems. I have
> '/usr/sbin/sendmail -t' configured and verified via phpinfo()
> that it takes,
> and it does work for awhile.
>
> This is one of the worst kind of problems because there is no indication
> that anything is wrong since the program doesn't complain, the info that
> should be mailed is lost forever, and nobody knows it until days
> later when
> we get a call saying the client hasn't gotten any orders.
>
> Any thoughts on what might be happening?
>
> Thanks!
> _______________________
>
> Ron Bickers
> Logic Etc, Inc.
> rbickers@logicetc.com
>
>