ID: 11616
Updated by: hholzgra
Old-Status: Open
Status: Assigned
Bug Type: Mail related
Operating system: 
PHP Version: 4.0.5
Assigned To: hholzgra

windwos mail code needs a rewrite

Previous Comments:

[2001-06-22 10:21:44] [EMAIL PROTECTED]
I am running PHP as CGI on IIS 5.0 with service pack 2.  

This report verifies that bug #11349 is a definate problem.
/win32/sendmail.c has the following code (starting at line 253):

/* Send mail to all Cc rcpt's */
if (headers && (pos1 = strstr(headers, "Cc:"))) {
        pos2 = strstr(pos1, "rn");
        tempMailTo = estrndup(pos1, pos2-pos1);

        token = strtok(tempMailTo, ",");
        while(token != NULL)
                sprintf(Buffer, "RCPT TO:<%s>rn", token);
                if ((res = Post(Buffer)) != SUCCESS)
                        return (res);
                if ((res = Ack()) != SUCCESS)
                        return (res);
                token = strtok(NULL, ",");

The above code can only grab an email address that looks like this: 


When I place it in this format I receive a "Warning:  Server Error" message from the 
mail() function.

sendmail.c cannot find a proper RFC 822 mail header like:

Cc: Jack Smith <[EMAIL PROTECTED]>

When I place this in the mail headers nothing happens.

Also, there is no code at all that even looks for a Bcc address in the sendmail.c 
code.  This is a massive problem.

In order for the mail() function to be /usr/sbin/sendmail compliant it must be able to 
find and parse Cc: and Bcc: in each of the above formats. It must also remove the 
Bcc's from the header so that recieving mail clients cannot see them, just as sendmail 



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to