From:             shelby at coolpage dot com
Operating system: FreeBSD
PHP version:      Irrelevant
PHP Bug Type:     Mail related
Bug description:  mail() inserts change CRLF ("\r\n") to CRCRLF ("\r\r\n") for some 
extra headers

Description:
------------
See the post for detailed description of problem, as well as fact that
others are experiencing the problem:

http://www.zend.com/zend/comments/show_comment.php?article=sendmimeemailpart1&id=5733&pid=2921&days=10000&f_id=sendmimeemailpart1&mode=&kind=sl

I think the reason no one isolated this yet, is because it only manifests
itself for certain extra headers and only causes a noticeable corruption
in Outlook Express, even though the header corruption is occuring always.

I remembered seeing this before and remember it had something to do with
extra "\r" character after a header line.

I then did a raw telnet session saved to a raw log and confirmed that the
extra CR ("\r") is being inserted by mail().

I am guessing that the mail() code extracts known header lines and their
"\r\n", then does str_replace( "\n", "\r\n" ) on remaining lines of extra
headers?

I use pair.com as host:
php -v
PHP 4.3.4 (cli) (built: Nov  4 2003 16:10:03)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

We do use Qmail.

See other relevant bug posts:

http://bugs.php.net/bug.php?id=15841&edit=2

http://bugs.php.net/bug.php?id=22262&edit=2

There seems to be no one answer of solution?





Reproduce code:
---------------
If the following headers input to mail():

"From: [EMAIL PROTECTED]" .
"Reply-To: [EMAIL PROTECTED]" .
"Date: Wed, 11 Aug 2004 08:15:15 -0400\r\n" .
"Mime-Version: 1.0\r\n" .
"Content-Type: text/plainn\r\n" .
"Content-Transfer-Encoding: 7BIT\r\n"


Expected result:
----------------
(1) In Outlook Express, you get:

From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Wed, 11 Aug 2004 08:15:15 -0400

Mime-Version: 1.0

Content-Type: text/plain

Content-Transfer-Encoding: 7BIT


(2) In Eudora 4, you see:


From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Wed, 11 Aug 2004 08:15:15 -0400
Mime-Version: 1.0
Content-Type: text/plainn
Content-Transfer-Encoding: 7BITT


(3) In raw text you see:

From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
Date: Wed, 11 Aug 2004 08:15:15 -0400\r\r\n
Mime-Version: 1.0\r\r\n
Content-Type: text/plainn\r\r\n
Content-Transfer-Encoding: 7BIT\r\r\n



-- 
Edit bug report at http://bugs.php.net/?id=29646&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29646&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29646&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29646&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29646&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29646&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29646&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29646&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29646&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29646&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29646&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29646&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29646&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29646&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29646&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29646&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29646&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29646&r=float

Reply via email to