Re: sendmail delay?
| From: | Teodor Cimpoesu | Date: | Sat, 23 Sep 2000 12:21:30 +0000 |
| Subject: | Re: sendmail delay? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17427@lists.php.net to get a copy of this message | ||
Hi Marc!
On Wed, 20 Sep 2000, Marc Burgauer wrote:
> Hi
>
> I noticed in a script that when it executes the mail() command, it takes
> 20-30 seconds (if the server is busy even longer) before the next
> instruction is executed. I assume that this is PHP waiting for sendmail to
> react to the request to send a mail message.
> I am using PHP4.0.2 on a Sun Solaris (SunOS 5.6). The behavior is the same
> for running the instruction as a shell script through the PHP executable
> (CGI version) or through the combined Apache/PHP binary, so it's not Apache.
>
> Is this the way it is or is it an indication that my compilation process is
> not specific enough regarding sendmail (and how would I be more specific)?
> Can I influence this behaviour in any way?
I think Manuel Lemos(spl?) came with a `command line' solution to
launch a program in the background and return immediately.
[ ain't hard to figure out for yourself a solution if you fiddle with
bash for some minutes ]
Unfortunately mail() does what exec() and system() do, which is popen(),
look:
ext/standard/mail.c:145
sendmail = popen(sendmail_path, "w");
So the best thing one could do is forget about mail() function and
write, on one hand, a custom mail function, and on the other a script
to get the mail `command' and return immediately.
-- teodor