php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49076 "\n." is incorrectly replaced with "\n.."
Submitted: 2009-07-27 17:37 UTC Modified: 2009-07-28 15:47 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: nestor at sakimori-x dot com Assigned:
Status: Open Package: Mail related
PHP Version: 5.2.10 OS: win32 only - WinXP SP3
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-07-27 17:37 UTC] nestor at sakimori-x dot com
Description:
------------
The SMTP spec states (sec. 4.5.2) that all instances of "<CRLF>." (not including the SMTP message-ending "<CRLF>.<CRLF>" sequence) should be replaced with "<CRLF>..". It seems PHP is replacing all instances of "<LF>." with "<LF>..", regardless of the presence of a "<CR>" character.
 
This was originally reported as bug #623 way back in 1998 and is still an issue.

Reproduce code:
---------------
mail($test_address, "test subject", "abc\n.jkl\r\n.xyz\r\nzzz");

Expected result:
----------------
An SMTP message containing "abc\n.jkl\r\n..xyz\r\nzzz" should be sent.

Actual result:
--------------
An SMTP message containing "abc\n..jkl\r\n..xyz\r\nzzz" is sent. This was confirmed with a packet sniffer (no server logs/reports or mail clients to muddy the waters).

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Aug 20 23:01:34 2019 UTC