|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2020-10-27 16:16 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: cmb
[2020-11-10 15:31 UTC] cmb@php.net
[2020-11-19 18:27 UTC] cmb@php.net
[2020-11-19 18:27 UTC] cmb@php.net
-Status: Verified
+Status: Closed
[2021-02-03 15:13 UTC] josh at dirxion dot com
[2021-02-03 15:17 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ According to RFC2822 / 2.2.3. Long Header Fields, each header field can use White space folding. E.g.: To: xy@example.com\r\n CC: ab@example.com,\r\n cd@example.com\r\n Subject: subject text In the win32/sendmail.c SendText() function, the cc: and bcc: headers are considered only up to the next \r\n, ignoring any additional folded lines. This occures on Windows when "sendmail_path" is not defined in php.ini. Problematic code: pos1 = headers + (pos1 - headers_lc) + 3; if (NULL == (pos2 = strstr(pos1, "\r\n"))) { tempMailTo = estrndup(pos1, strlen(pos1)); } else { tempMailTo = estrndup(pos1, pos2 - pos1); } IMHO any folding sequence "\r\n\t" or "\r\n " shall be replaced with "\t" or " " in header_lc before scanning. Other solutions might be convenient too. Test script: --------------- <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Cc: cc1@example.com' . "\r\n" . ', ' . '\tcc2@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Expected result: ---------------- cc2@example.com shall receive an email. Actual result: -------------- cc2@example.com does not receive an email. in the SMTP protocol RCPT TO: cc2@example.com is missing.