ID:               39507
 User updated by:  rherror404 at gmail dot com
 Reported By:      rherror404 at gmail dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         Mail related
 Operating System: Windows
 PHP Version:      5.2.0
 New Comment:

> It sounds like SMTP server flood
> limiter is being triggered 
> here. Not a PHP issue.
Nice try, but it is a PHP issue, at least under Apache on win32.  I
only tried sending only just a few messages at a time.  My earlier
remark about "serious volumes" isn't what this bug report is about,
it's about being able to send MORE THAN JUST ONE at a time without it
stumbling all over itself.  My testing used EXACTLY TWO concurrent
attempts.  Please re-read my remarks about execution under the Apache
WinNT MPM.

Is the mail() function thread-safe?


Previous Comments:
------------------------------------------------------------------------

[2007-01-07 05:01:48] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

It sounds like SMTP server flood limiter is being triggered 
here. Not a PHP issue.

------------------------------------------------------------------------

[2006-11-20 19:42:15] rherror404 at gmail dot com

I have found a work-around (not a fix).

Do not rely upon the current mail() (at least under the Apache WinNT
MPM) to be of any use for the case where more than one mod_php script
is forwarding a message to an SMTP relay host.

Have the mod_php script spawn a child process that takes a bit of
serialized state via its STDIN and let the new process do the mail()
work.  See the proc_open() docs.

If you have serious volumes of mail to send, either do it from a Linux
box or find some other way to do it from your Windows box.  Calling
mail() under Windows/Apache/PHP for anything close to that (as it
stands) is not advisable.

------------------------------------------------------------------------

[2006-11-14 16:14:10] rherror404 at gmail dot com

I suspect this may be the same bug mentioned in #31676.  My best guess
is that this is related to multi-threading.

------------------------------------------------------------------------

[2006-11-14 04:18:49] rherror404 at gmail dot com

<?
/*
Here it is again, edited slightly
to run on a Linux machine so that
it has its local sendmail do the work.
Concurrent requests to the script were
handled quite nicely.  The huge difference
in this case is the Apache prefork MPM.
*/
define('EXTRAHEADERS', "MIME-Version: 1.0\r\nContent-type: text/html;
charset=iso-8859-1\r\nX-Mailer: PHP\r\n");
define('MAILMSG',
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html><head><title>foo</title><style type='text/css'>
body {margin: 0; font-size: 10pt; font-family: sans-serif, arial;
color: #000000; background-color: #ffffff;}
</style></head><body><div style='font-size: 12pt; background-color:
#ffff00;'>" . date("Y-m-d H:i:s") . "</div>
random junk<br />" .
str_repeat("afhlkhsad;lfj;lkjsa;lfjasd;lkjf;lkjsad;lkfjsad;lkfjsad;lkfja
sd;lfkjasd;lkfjsa;ldf<br />\n", 100) .
"</body></html>");
ini_set('html_errors', FALSE);
define('MAILTO', '[EMAIL PROTECTED]'); // something real
$retval = mail(MAILTO, 'foo', MAILMSG, EXTRAHEADERS);
echo ( $retval ? 'TRUE' : 'FALSE' ) . "\n\n\n";
exit();
?>

------------------------------------------------------------------------

[2006-11-14 03:56:24] rherror404 at gmail dot com

Is the mail() function sufficiently thread-safe under the Windows MPM
(for Apache)?  I have to wonder if the two concurrent threads are
stepping on each other in their efforts to talk to the SMTP box.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/39507

-- 
Edit this bug report at http://bugs.php.net/?id=39507&edit=1

Reply via email to