|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nestor at sakimori-x dot com
New email:
PHP Version: OS:


 [2009-07-27 17:37 UTC] nestor at sakimori-x dot com
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\\r\nzzz");

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

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


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 31 11:01:24 2020 UTC