PHP mail() woes

fouldragon at aol.com fouldragon at aol.com
Wed Jun 11 18:19:48 MST 2008


Oh, to add more details:

I tried writing test code which would loop and call mail().

Wether I did 20 or 50 iterations, or even running two of the page that 
did 50 at the same time, to a local address, it still all worked.

I also tried sending 50 to "test at invalid.invalid" (since I didn't want 
it to bother a real host), and it didn't report any errors at the 
mail() function.

So it's obviously not just a "number of messages being sent" thing-- 
the only thing I could see is to somehow monitor all 100+ sites hosted 
on the server to see if something hits a critical point.



-----Original Message-----
From: fouldragon at aol.com
To: plug-discuss at lists.plug.phoenix.az.us
Sent: Wed, 11 Jun 2008 5:44 pm
Subject: PHP mail() woes










Several sites on the VPS I administer send out several "order
confirmation" emails when a specific page is hit.

Because of the way they run their businesses, it's non-negotiable that
between 3 and ~12 messages are sent out on these occurences.

The problem is that occasionally--- probably about one in 20 times such
a page is accessed, the server error logs fill up with:

[Wed Jun 11 13:38:06 2008] [error] [client a.b.c.d] PHP Warning:
mail() [<a href='function.mail'>function.mail</a>]: Could not execute
mail delivery program '/usr/sbin/sendmail -t -i' in
/var/www/vhosts/xxxxxxx/httpdocs/feedback.php on line 54, referer:
http://xxxxxxxx

Since it tries to send a handful of messages at once, they usually come
in clumps of 5 or 6 messages like this.

I tried correlating the times of the errors with resource warnings in
Virtuozzo; no dice.

I keep hearing that the PHP mail() call is not intended for bulk
mailing-- but less than 20 messages at a shot is not bulk as I see it.

The only thing I could see is some sort of resource exhaustion... like
it can only have xxx mail() calls in the air at once, and it exceeds
that limit.

The server runs FC6 with Plesk 8.3 on top, so the mail setup is qmail,
but it uses xinetd.  I saw a few notes about being able to tweak
qmail-smtpd to open more instances, but I'm not even sure that's
relevant to the problem (since mail() calls are coming from local).

What about replacing /usr/sbin/sendmail -t -i with
/var/qmail/bin/qmail-inject - someone suggested this?  Would that have
any possible difference?

And what's a good way to find out if this will repeat, other than
sitting and monitoring the logs for an error?

---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss







More information about the PLUG-discuss mailing list