Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2000071

[PHP] Mail problems From: Jeff Wolkove (php <email protected>)
Date: 07/15/00

I have an annoying problem with the mail() function intermittently
taking a long time to execute.

I checked the list archive and it was suggested to put the -q
switch on the command line, which, according to the article,
means that sendmail will queue the mail rather than sending it
immediately. I did that so the sendmail command line was
   /usr/sbin/sendmail -tq

(The -t was there by default, so I left it there.)
This did not work at all, in fact the mail function executed
quickly but no mail was sent. I have not checked for a return
error code.

However this conflicts with the sendmail documentation. According
to the book, the -q switch tells sendmail to process its queue
and exit, and says nothing about just queueing the mail.

Reading further through the book, I find this option:
   -ODeliveryMode=background
so the sendmail command line in php3.ini is now
   /usr/sbin/sendmail -t -ODeliveryMode=background
which tells sendmail to fork a new process to deliver the mail
and exit immediately. This worked fine, it was fast, the mail
was delivered and I was happy -- for about an hour, then it
became slow again. It takes up to 2 minutes to send an e-mail,
and I have users registering 4 or 5 times because they think
the 'puter didn't hear them the first time they submitted the
form.

When I check the sendmail queue, it's empty. WHen I run a top
during this long waiting period, sendmail doesn't even appear in
the list of active processes. However I have checkpointed the
script extensively and know with 100% certainty that it's hung
up at the mail function.

Any clues would be appreciated.
Jeff Wolkove

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>