php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5729 mail stops connecting after sending 97 emails
Submitted: 2000-07-21 22:19 UTC Modified: 2000-07-28 14:20 UTC
From: stefan at hendricks-online dot de Assigned: hholzgra (profile)
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: WIN32, Win98
Private report: No CVE-ID: None
 [2000-07-21 22:19 UTC] stefan at hendricks-online dot de
for ($i=1; $i<=100; $i++)
 {
   mail("webmaster@hendricks-online.de", "Text", "Text");
   echo $i\x;
 }


This will run until $i = 97. After that I get a error "Failed to connect...".

This is reproduceable on 2 systems with 2 different remote mailservers or any local mailserver.
It's no difference if the to-adressess are different in every mail.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-21 23:26 UTC] stefan at hendricks-online dot de
Extension:

This has nothing to do with flooding the servers.

A delay of 5 secs between each connect doesn't make any difference.
I tried 2 local mailservers (winroute 4.1 and hamster) and 2 remote servers, it's always exactly the number of 97 mails!
I think that there might be a bug.

If I try the same with another sendmail tool I can send more than any number of mails at a time!!!
Or if I restart the script I can send exactly another 97 mails, no matter how often I start it!

 [2000-07-21 23:52 UTC] hholzgra at cvs dot php dot net
win32/sendmail.c leaks resources as
it connects to SMTP sockets but
never closes theese connections

(i can't fix this as i still have no 
 running win32 dev system)
 [2000-07-25 00:41 UTC] waldschrott@php.net
Hartmut, are you still keeping track on this, you seem to take care of, thus I?ve assigned it to you...
 [2000-07-25 11:44 UTC] hholzgra@php.net
i think adding

  close(sc);

at the end of function TSMClose()
in win32/sendmail.c should fix this
error 

but as i still havn't got a running
win32 system with compiler and things
i'm not able to test this

i'll pass this over to Jouni Ahto <jah@mork.net>
as he fixed my last attempt to modify the smtp
code ...
 [2000-07-28 14:20 UTC] hholzgra@php.net
should be fixed in cvs  (if patch compiles well)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 06:00:01 2026 UTC