|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13342 A ! every 2041 letters
Submitted: 2001-09-17 06:17 UTC Modified: 2001-10-08 09:09 UTC
From: btrinquier at publicis dot fr Assigned:
Status: Closed Package: Mail related
PHP Version: 4.0.4pl1 OS: Linux/Apache
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: btrinquier at publicis dot fr
New email:
PHP Version: OS:


 [2001-09-17 06:17 UTC] btrinquier at publicis dot fr

The script :

$mail_body = "";
for ($i=0; $i <500; $i++) {
$mail_body .= "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";

$subject = "Testing";
mail($adress, $subjet, $mail_body);

When receiving the mail, a character ! is inserted every 2041 chars.

If the message is changed into :
$mail_body .= "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n";
the received mail is good.

It is not very usual to send a mail without carriage return, but we discovered this bug sending an HTML message, with <br> and without \n. Introducing some \n resolve the problem.

Best regards


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-17 06:36 UTC]
most likely sendmail related
as PHP mail() for unix just passes the
message text to the local sendmail binary via popen()

could someone please check the SMTP RFCs
for line length limits ?
 [2001-09-17 06:56 UTC]
I cannot recreate this 4.0.5 or current CVS. As for line
length, RFC 821 says the following:

text line

 The maximum total length of a text line including the
 <CRLF> is 1000 characters (but not counting the leading
 dot duplicated for transparency).

Theorectically, it is the responsibility of the MTA
(sendmail/postfix/Exim/qmail etc) to handle this not PHP.

Can you recreate this with current CVS?
 [2001-10-08 09:09 UTC]
No feedback. Closing.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Aug 03 23:01:23 2021 UTC