|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-05-02 10:33 UTC] ab@php.net
[2017-05-02 10:33 UTC] ab@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 12:00:02 2025 UTC |
Description: ------------ In win32/sendmail.c:SendText the code that examines headers looks for CC and BCC for special treatment. CC is anchored to the beginning of a line but BCC is not. If there is an X-*bcc header then it will be recognized as a BCC line and 1. PHP will attempt to RCPT TO the header's value 2. The "X-*" will be merged with the next line (if any) when the header is stripped away. Fix is to tack on a copy of CC's && ((pos1 == headers_lc) || (*(pos1-1) == '\n')) to that one pos1 condition. Test script: --------------- $headers = implode("\r\n", [ "Cc: test+cc@example.com", "X-Test-Cc: line 2", "X-Test-Aabbcc: line 3", "X-Line-4: line 4" ]); mail("test@example.com", "Subject", "Body", $headers); Expected result: ---------------- Recipients: test@example.com, test+cc@example.com Cc: test+cc@example.com X-Test-Cc: line 2 X-Test-Aabbcc: line 3 X-Line-4: line 4 Actual result: -------------- Recipients: test@example.com, test+cc@example.com, line 3 Cc: test+cc@example.com X-Test-Cc: line 2 X-Test-AabX-Line-4: line 4