php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11616 Cc: & Bcc: not being picked up from header
Submitted: 2001-06-22 10:21 UTC Modified: 2002-06-03 18:19 UTC
Votes:12
Avg. Score:4.8 ± 0.4
Reproduced:11 of 11 (100.0%)
Same Version:8 (72.7%)
Same OS:10 (90.9%)
From: bmatzelle at yahoo dot com Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.5 OS: Win 2K Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bmatzelle at yahoo dot com
New email:
PHP Version: OS:

 

 [2001-06-22 10:21 UTC] bmatzelle at yahoo dot com
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 */
efree(tempMailTo);
if (headers && (pos1 = strstr(headers, "Cc:"))) {
	pos2 = strstr(pos1, "\r\n");
	tempMailTo = estrndup(pos1, pos2-pos1);

	token = strtok(tempMailTo, ",");
	while(token != NULL)
	{
		sprintf(Buffer, "RCPT TO:<%s>\r\n", token);
		if ((res = Post(Buffer)) != SUCCESS)
			return (res);
		if ((res = Ack()) != SUCCESS)
			return (res);
		token = strtok(NULL, ",");
	}
	efree(tempMailTo);
}

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

Cc: jack@smith.com

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 <jack@smith.com>

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 does.

Brent

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-22 18:26 UTC] hholzgra@php.net
windwos mail code needs a rewrite
 [2001-06-23 00:47 UTC] bmatzelle at yahoo dot com
I have one more behavior to add.  The mail() function only can gather To: addresses if they are in this format:

mail("email@domain.com, email2@domain.com", etc)

It should be able to read this RFC format as well:

mail("Gary <email@org.com>, Beth <email2@org.com", etc)

There are a lot of changes to be made. If I find the time I will try some fixes myself.
 [2002-05-17 12:28 UTC] mfischer@php.net
Bcc support has been added. RFC style mail addresses are still not done.
 [2002-06-02 11:18 UTC] mfischer@php.net
Closing this one, rfc822 style address bugs are tracked in bugs.php.net/10182
 [2002-06-02 11:18 UTC] mfischer@php.net
Closing this one, rfc822 style address bugs are tracked in http://bugs.php.net/10182 (highlight for you lazy guys :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 09:01:29 2024 UTC