Bug #74005 [Com]: mail function duplicates FROM header
| From: | cafbca62 at opayq dot com | Date: | Mon, 30 Jan 2017 08:30:19 +0000 |
| Subject: | Bug #74005 [Com]: mail function duplicates FROM header | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-207037@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74005&edit=1
ID: 74005
Comment by: cafbca62 at opayq dot com
Reported by: andy_schmidt at HM-Software dot com
Summary: mail function duplicates FROM header
Status: Open
Type: Bug
Package: Mail related
Operating System: Windows
PHP Version: 7.0.15
Block user comment: N
Private report: N
New Comment:
I confirm the problem. My Wordpress on IIS after update to PHP 7 has started creating this trouble.
Previous Comments:
------------------------------------------------------------------------
[2017-01-26 23:11:08] andy_schmidt at HM-Software dot com
Description:
------------
Since version 7 the Windows implementation of mail() duplicates the "From:" header, e.g.:
Date: Thu, 26 Jan 2017 17:48:13 -0500
Subject: test subject
To: recipient@test.com
X-PHP-Originating-Script: 0:andytest.php
From: duplicated@test.com
From: duplicated@test.com
Under version 5 (e.g., 5.3.28) and prior there is only ONE "From:" header.
Gmail has now started to outright BLOCKING PHP generated emails due to "ambiguous"
"from" information, therefore escalating this matter to one of highest priority. Here the
SMTP status code from gmail when delivery is attempted by PHP 7 (works with PHP 5):
550-5.7.1 [74.201.226.50 11] Our system has detected that this message is
550-5.7.1 not RFC 5322 compliant:
550-5.7.1 Multiple 'From' headers found.
550-5.7.1 To reduce the amount of spam sent to Gmail, this message has been
550-5.7.1 blocked. Please visit
550-5.7.1 https://support.google.com/mail/?p=RfcMessageNonCompliant
550 5.7.1 and review RFC 5322 specifications for more information. d4si1478127qtf.33 - gsmtp
Test script:
---------------
<?php
$result = mail( "recipient@test.com", "test subject", "test content",
"From: duplicated@test.com\r\n" );
?>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74005&edit=1