ID:               22947
 Updated by:       [EMAIL PROTECTED]
 Reported By:      me at mattbeale dot plus dot com
-Status:           Assigned
+Status:           Closed
 Bug Type:         Mail related
 Operating System: Windows 2000 SP4
 PHP Version:      4CVS-2003-04-29 (stable)
 Assigned To:      edink
 New Comment:

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.




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

[2003-08-11 10:23:30] me at mattbeale dot plus dot com

Woohoo, Everything works fine. Excellent work Lee!

I've only compiled a CGI version (not debug), but if anyone else
(Andrew?) wants to test it, it is here:
http://www.mattbeale.plus.com/phpbug22947/phpbug22947.tar.gz

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

[2003-08-11 05:16:10] lwillis at plus dot net

Probably easier to grab the patch from here:

http://www.lwillis.plus.com/php_sendmail_patch.patch

Lee

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

[2003-08-11 05:15:01] lwillis at plus dot net

The patch below (I can't find anywhere to add this as an attachment -
shoot me if I'm being stupid) may fix the problem (Matt - could you try
it?). Not sure whether it will work correctly with multi-line
responses. This is untested - I don't have access to a win32 platform
to build on right now (Or a mail server that sends multi-line responses
to a HELO ...)

Index: win32/sendmail.c
===================================================================
RCS file: /repository/php-src/win32/sendmail.c,v
retrieving revision 1.55
diff -u -r1.55 sendmail.c
--- win32/sendmail.c    23 Jul 2003 16:03:10 -0000      1.55
+++ win32/sendmail.c    11 Aug 2003 10:10:54 -0000
@@ -882,11 +882,10 @@
        /* Check for newline */
        Index += rlen;
                                                                       
                                                    
-       if ((buf[Received - 4] == ' ' && buf[Received - 3] == '-') ||
+       if ((buf[3] == '-') ||
            (buf[Received - 2] != '\r') || (buf[Received - 1] !=
'\n'))
                /* err_msg          fprintf(stderr,"Incomplete server
message. Awaiting CRLF\n"); */
-               goto again;                             /* Incomplete
data. Line must be terminated by CRLF
-                                          And not contain a space
followed by a '-' */
+               goto again;                             /* Incomplete
data OR multi-line response. Line must be terminated by CRLF */
                                                                       
                                                    
        if (buf[0] > '3') {
                /* If we've a valid pointer, return the SMTP server
response so the error message contains more information */

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

[2003-08-11 04:43:16] lwillis at plus dot net

As far as I can see from section 4.1.1.1 of RFC 2821 the response given
to the HELO command is perfectly valid.

http://www.faqs.org/rfcs/rfc2821.html

The check for a space and then dash was introduced into
win32/sendmail.c at version 1.20 with the following log entry:

--------------------------------------
revision 1.20
date: 2000/09/05 00:26:15;  author: sterling;  state: Exp;  lines: +5
-2
This should fix the multiple-line problem.
--------------------------------------

Not sure which "multiple line problem" though - possibly bug 6537

Either way, the response we're sending looks like it should be handled
fine by PHP - and it certainly shouldn't cause a hang (I expect PHP is
waiting for more data trying to get the next line of a multi-line
response - but it should be doing this as the response code (250) is
followed by a space, not a dash ...

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

[2003-08-03 09:05:38] me at mattbeale dot plus dot com

Does this not get acknowledgement unless the Status is set back to
Open?

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

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/22947

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

Reply via email to