Bug #74510 [Opn->Csd]: win32/sendmail.c anchors CC header but not BCC

From: Date: Tue, 02 May 2017 10:33:36 +0000
Subject: Bug #74510 [Opn->Csd]: win32/sendmail.c anchors CC header but not BCC
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208899@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74510&edit=1 ID: 74510 Updated by: ab@php.net Reported by: requinix@php.net Summary: win32/sendmail.c anchors CC header but not BCC -Status: Open +Status: Closed Type: Bug Package: Mail related Operating System: Windows PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: Automatic comment on behalf of ab Revision: http://git.php.net/?p=php-src.git;a=commit;h=20a608d9dae4c758bf608e10fd2cdb9cc1559625 Log: Fixed bug #74510 win32/sendmail.c anchors CC header but not BCC Previous Comments: ------------------------------------------------------------------------ [2017-04-28 17:13:26] requinix@php.net Related To: Bug #71726 ------------------------------------------------------------------------ [2017-04-28 16:38:30] requinix@php.net 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74510&edit=1

« previous php.bugs (#208899) next »