[wp-trac] [WordPress Trac] #2603: Illegal CR-LF sequence sent to @mail on Unix

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 27 08:40:05 GMT 2006


#2603: Illegal CR-LF sequence sent to @mail on Unix
-----------------------+----------------------------------------------------
       Id:  2603       |      Status:  new                     
Component:  General    |    Modified:  Mon Mar 27 08:40:05 2006
 Severity:  normal     |   Milestone:                          
 Priority:  normal     |     Version:  2.0.2                   
    Owner:  anonymous  |    Reporter:  juliano                 
-----------------------+----------------------------------------------------
 The pluggable function wp_mail uses PHP's mail function.

 According to
 [http://php.mirrors.ilisys.com.au/manual/en/ref.mail.php#59773 Ben Cooke],
 the mail function requires different input when it is running on different
 operating systems: On Windows systems, you need to use the CR-LF, the
 Windows convention and as defined in the SMTP email standard. On Unix
 systems, you need to use the traditional Unix LF only - it will convert to
 use the CR-LF style that is required to send down the wire.

 The Unix system will replace all of the LF characters into CR-LF, even if
 there is already a CR preceding it. That means a CR-LF sequence will be
 broken (Ben Cooke describes it as “hypercorrected”) into a CR-CR-LF
 sequence.

 Many email clients accept the CR-CR-LF sequence without blinking.

 However, Microsoft Outlook gets confused by this sequence. It doesn't
 accept headers that use this sequence (they get moved into the body) and
 it doesn't recognize end-of-paragraph markers.

 The result is that emails from WordPress format poorly in Outlook.

 I see three possible solutions:

 1) Blame Microsoft Outlook. This is a popular option, but seems unfair
 given WordPress is failing to conform to the expected input of mail.

 2) Put an OS-dependent check, and replace all the CR-LF with LF on a Unix
 system.

 3) Use one of the available replacements for PHP's mail function which
 allegedly deal with these platform issues more gracefully.
 [http://phpmailer.sourceforge.net/ PHPMailer]?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2603>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list