Bug #73485 [NoF->Fbk]: mail() adds a lone CR or LF

From: Date: Sun, 25 Dec 2016 14:25:04 +0000
Subject: Bug #73485 [NoF->Fbk]: mail() adds a lone CR or LF
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206199@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73485&edit=1 ID: 73485 Updated by: requinix@php.net Reported by: sherwoodsports at gmail dot com Summary: mail() adds a lone CR or LF -Status: No Feedback +Status: Feedback Type: Bug Package: Mail related Operating System: All PHP Version: 7.0.X Assigned To: yohgaki Block user comment: N Private report: N New Comment: You can configure SMTP to dump to a pickup directory: https://technet.microsoft.com/en-us/library/cc772058(v=ws.10).aspx Alter the path to $outFile in the test script appropriately, comment out the SKIPIF code, and you should be able to run the test code. Previous Comments: ------------------------------------------------------------------------ [2016-12-25 04:22:19] php-bugs at lists dot php dot net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. ------------------------------------------------------------------------ [2016-12-12 14:27:44] sherwoodsports at gmail dot com Unfortunately, I'm in a Windows Server 2008 R2 environment. After reading it, that script indicates right away that it won't run on Windows. I use the IIS web server to swap PHP versions that IIS is using for any given web site. The SMTP server is Microsoft CDO (basically Microsoft Exchange Libraries) and it has never changed (this library is no longer updated via Microsoft) between various server web languages (ASP, PHP 5.3.24) and has only experienced issues with PHP 7 and above. All that said, it would be difficult to say a library that has never changed is suddenly sensitive to PHP 7 (I still have PHP 5 installed and it still doesn't fail). Do you have a script that will run on Windows? Is there a command that fails on Windows that I can modify in that script such that it will run successfully? ------------------------------------------------------------------------ [2016-12-12 07:13:04] yohgaki@php.net Are you sure that you are using the same MTA (mail server) and UMA (sendmail binary) for old and new PHPs? If not, MTA/UMA behavior change is the cause most likely. If you are using the same MTA/UMA, please modify following test script and reproduce issue. https://github.com/php/php-src/blob/master/ext/standard/tests/mail/mail_basic.phpt ------------------------------------------------------------------------ [2016-11-25 15:21:43] sherwoodsports at gmail dot com Thank you for re-opening. A manipulated MTA/UMA likely would not explain why the older version of PHP works, but the newer version does not. Also, all CRLF's used in the code are using PHP_EOL and are not using manual ('\n\r') characters to end lines. No single \r or \n characters are used, therefore are not subject to the non-conversion issue you suggest. This also supports the fact that the older PHP versions prior to 7 works without issues, but 7 does have issues. ------------------------------------------------------------------------ [2016-11-25 07:05:22] yohgaki@php.net I reopened this bug for the time being. It seems this problem is due to MTA/UMA newline conversion which is not a bug of PHP. Recent MTA/UMA do _not_ convert LF to CR/LF and this could results in errors like you have. It seems you are experiencing this issue and if this is the case, you should fix your code. i.e. Use CR/LF for new lines as defined in RFC. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=73485 -- Edit this bug report at https://bugs.php.net/bug.php?id=73485&edit=1

« previous php.bugs (#206199) next »