php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80706 mail(): Headers after Bcc headers may be ignored
Submitted: 2021-02-03 20:09 UTC Modified: 2021-02-04 14:35 UTC
From: josh at dirxion dot com Assigned: cmb (profile)
Status: Closed Package: Mail related
PHP Version: 7.4.14 OS: Windows
Private report: No CVE-ID: None
 [2021-02-03 20:09 UTC] josh at dirxion dot com
Description:
------------
I suspect bug ID 72964 may be related to this issue. 

With the release of PHP 7.4.14 we are experiencing an issue with our web email forms being processed. It seems to mangle the HTML formatting when there is only one email address. I have verified the problem does not exists in version 7.4.13 and that if I provide multiple addresses the mangled HTML email content problem goes away. 


7.4.14 email example
https://blogs.dirxion.com/tmp/examplebad.eml

7.4.13 email example
https://blogs.dirxion.com/tmp/examplegood.eml

Test script:
---------------
'Bcc: '. $VariableEmailGroup . "\r\n" .

If we add on a 2nd email address to the same syntax, the HTML formatting of the email is preserved properly. The problem is we don't want to list out multiple email addresses. 

'Bcc: ' . $VariableEmailGroup . ", \r\n\tuseremail@thisworksok.com\r\n" .


I will update with more details of what the variable value is once I receive an internal response. 


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-03 20:12 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2021-02-03 20:12 UTC] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2021-02-03 22:05 UTC] cmb@php.net
-Status: Feedback +Status: Open -Assigned To: +Assigned To: cmb
 [2021-02-03 22:05 UTC] cmb@php.net
Thanks for filing as new ticket!  I'll have a closer look
tomorrow.  A reproduce script may not be necessary.
 [2021-02-04 14:35 UTC] cmb@php.net
-Summary: HTML Emails Mangled with only one recipient +Summary: mail(): Headers after Bcc headers may be ignored -Status: Assigned +Status: Verified -Operating System: Windows 2016 Std +Operating System: Windows
 [2021-02-04 14:35 UTC] cmb@php.net
The problem is that headers after Bcc headers may be ignored.

Indeed, that regression has been introduced with the fix for bug
#72964.
 [2021-02-04 16:47 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #80706: mail(): Headers after Bcc headers may be ignored
On GitHub:  https://github.com/php/php-src/pull/6666
Patch:      https://github.com/php/php-src/pull/6666.patch
 [2021-02-08 17:45 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca7547c9e2f9120768d8290001ec6e1509b3597f
Log: Fix #80706: mail(): Headers after Bcc headers may be ignored
 [2021-02-08 17:45 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 17 16:03:38 2021 UTC