Bug #80751 [PATCH]: Comma in recipient name breaks email delivery
| From: | cmb@php.net | Date: | Fri, 26 Feb 2021 15:18:40 +0000 |
| Subject: | Bug #80751 [PATCH]: Comma in recipient name breaks email delivery | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232398@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80751&edit=1
ID: 80751
Patch added by: cmb@php.net
Reported by: camaro396 at yandex dot ru
Summary: Comma in recipient name breaks email delivery
Status: Verified
Type: Bug
Package: Mail related
Operating System: Windows Server 2012 R2
PHP Version: 7.4.15
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #80751: Comma in recipient name breaks email delivery
On GitHub: https://github.com/php/php-src/pull/6735
Patch: https://github.com/php/php-src/pull/6735.patch
Previous Comments:
------------------------------------------------------------------------
[2021-02-15 09:34:39] cmb@php.net
The problem is on our side. SendText() splits the recipients on
comma[1], regardless of whether the comma is inside a quoted
string, or not.
[1] <https://github.com/php/php-src/blob/php-7.4.15/win32/sendmail.c#L412-L413>
------------------------------------------------------------------------
[2021-02-14 21:19:59] requinix@php.net
What is the remote mail server software? The transcript suggests that it isn't parsing
"Lastname, firstname" correctly as a quoted string.
------------------------------------------------------------------------
[2021-02-14 15:10:01] camaro396 at yandex dot ru
Description:
------------
Comma in recipient name leads to a malformed SMTP FROM command.
Test script:
---------------
mail('"Lastname, firstname" <lastname_firstname@example.com>',
'TEST', 'TEST', 'From: "Test" <test@example.com>');
Expected result:
----------------
Message sent successfully
Actual result:
--------------
Message not sent.
SMTP transcript looks like this
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "SENT: 220 mx.example.com"
"SMTPD" 56232 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "RECEIVED: HELO HOSTNAME"
"SMTPD" 56232 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "SENT: 250 Hello."
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "RECEIVED: MAIL
FROM:<sender@example.com>"
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "SENT: 250 OK"
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "RECEIVED: RCPT TO:<"Lastname>"
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "SENT: 550 A valid address is required."
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "RECEIVED: QUIT"
"SMTPD" 55224 293364 "2021-02-04
05:34:12.678" "xx.xx.xx.xx" "SENT: 221 goodbye"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80751&edit=1