Bug #73485 [NEW]: mail() adds a lone CR or LF
From: sherwoodsports at gmail dot com
Operating system:
PHP version: 7.0Git-2016-11-10 (snap)
Package: Mail related
Bug Type: Bug
Bug description:mail() adds a lone CR or LF
Description:
------------
Mail sent with the mail() function in PHP 7.0.9 or 7.0.11 results in a
550 error from mail servers that does not manifest in mails sent with
the mail() function in PHP 5.3.24.
The situation results in the receiving mail server to throw the
following error during the DATA transmission of the mail message:
550+5.6.0+Lone+CR+or+LF+in+headers+(see+RFC2822+section+2.2)
SMTP servers vary as it is a configuration issue to block incoming mail
that exhibits this issue. The fix is likely to compare output of mail()
for 5.3.24 vs. mail for 7.0.9 or 7.0.11 and resolve the "extra" CR or LF
character addition.
Expected result:
----------------
Sending from 5.3.24 (to server which identifies issue):
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - -
220+mx1.emailsrvr.com+ESMTP+-+VA+Code+Section+18.2-152.3:1+forbids+sending+spam+through+this+system
0 0 99 0 16 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 EHLO - xxxx 0 0 4 0 16 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - -
250-smtp5.gate.iad3a.rsapps.net+says+EHLO+to+xxx.xxx.xxx.xxx:60802 0 0
65 0 47 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 MAIL - FROM:<name@domain.com>+SIZE=740 0 0 4 0 47 SMTP - - -
-
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 250+2.1.0+Ok 0 0 12 0 172 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 RCPT - TO:<sendtoname@sendtodomain.com> 0 0 4 0 172 SMTP - - -
-
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 250+2.1.5+Ok 0 0 12 0 219 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 DATA - - 0 0 4 0 219 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 354+3.0.0+continue.++finished+with+"\r\n.\r\n" 0 0 46 0
250 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 250+2.0.0+Ok:+queued+as+D4/38-19322-24BB3285 0 0 44 0 468
SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 QUIT - - 0 0 4 0 468 SMTP - - - -
2016-11-10 00:11:35 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 221+2.3.0+smtp5.gate.iad3a.rsapps.net+closing+connection 0
0 56 0 484 SMTP - - - -
Actual result:
--------------
Sending from 7.0.11 (to server which identifies issue):
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - -
220+mx1.emailsrvr.com+ESMTP+-+VA+Code+Section+18.2-152.3:1+forbids+sending+spam+through+this+system
0 0 99 0 16 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 EHLO - xxxx 0 0 4 0 16 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - -
250-smtp52.gate.iad3a.rsapps.net+says+EHLO+to+xxx.xxx.xxx.xxx:60785 0 0
66 0 47 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 MAIL - FROM:<name@domain.com>+SIZE=743 0 0 4 0 47 SMTP - - -
-
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 250+2.1.0+Ok 0 0 12 0 78 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 RCPT - TO:<sendtoname@sendtodomain.com> 0 0 4 0 78 SMTP - - -
-
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 250+2.1.5+Ok 0 0 12 0 140 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 DATA - - 0 0 4 0 140 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 354+3.0.0+continue.++finished+with+"\r\n.\r\n" 0 0 46 0
156 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - -
550+5.6.0+Lone+CR+or+LF+in+headers+(see+RFC2822+section+2.2) 0 0 60 0
172 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionCommand SMTPSVC1
xxxx - 25 QUIT - - 0 0 4 0 187 SMTP - - - -
2016-11-10 00:00:00 173.203.187.1 OutboundConnectionResponse SMTPSVC1
xxxx - 25 - - 221+2.3.0+smtp52.gate.iad3a.rsapps.net+closing+connection
0 0 57 0 203 SMTP - - - -
--
Edit bug report at https://bugs.php.net/bug.php?id=73485&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73485&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73485&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73485&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73485&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73485&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73485&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73485&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73485&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73485&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73485&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73485&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73485&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73485&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73485&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73485&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73485&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73485&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73485&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73485&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73485&r=mysqlcfg
Thread (21 messages)
- sherwoodsports at gmail dot com
- sherwoodsports at gmail dot comBug #73485 [Opn]: mail() adds a lone CR or LF
- mattcoz at yahoo dot comBug #73485 [Com]: mail() adds a lone CR or LF
- rasmus@php.netBug #73485 [Opn->Ana]: mail() adds a lone CR or LF
- mattcoz at yahoo dot comBug #73485 [Com]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Ana->Nab]: mail() adds a lone CR or LF
- sherwoodsports at gmail dot comBug #73485 [Nab]: mail() adds a lone CR or LF
- mattcoz at yahoo dot comBug #73485 [Com]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Nab]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Nab]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Nab]: mail() adds a lone CR or LF
- sherwoodsports at gmail dot comBug #73485 [Nab]: mail() adds a lone CR or LF
- Sherwoodsports at gmail dot comBug #73485 [Com]: mail() adds a lone CR or LF
- Sherwoodsports at gmail dot comBug #73485 [Com]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Nab->Fbk]: mail() adds a lone CR or LF
- sherwoodsports at gmail dot comBug #73485 [Fbk->Asn]: mail() adds a lone CR or LF
- yohgaki@php.netBug #73485 [Asn->Fbk]: mail() adds a lone CR or LF
- sherwoodsports at gmail dot comBug #73485 [Com]: mail() adds a lone CR or LF
- php-bugs at lists dot php dot netBug #73485 [Fbk->NoF]: mail() adds a lone CR or LF
- requinix@php.netBug #73485 [NoF->Fbk]: mail() adds a lone CR or LF
- php-bugs at lists dot php dot netBug #73485 [Fbk->NoF]: mail() adds a lone CR or LF