Re: Fwd: PEAR Mail

From: Date: Mon, 16 Jun 2003 05:23:06 +0000
Subject: Re: Fwd: PEAR Mail
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17501@lists.php.net to get a copy of this message
On Fri, Jun 13, 2003 at 10:51:55AM +0200, Nicolas Hoizey wrote: > > mail headers were "incorrecly" tied together: you use a single "\n" > > character where as you should insert "\r\n" between header fields > > A while ago, I posted a report on such a problem I had with > Mail_Mime: > > > http://marc.theaimsgroup.com/?l=pear-dev&m=104555325920726&w=2 > > > I tested all of the concrete Mail implementations (sendmail, smtp > > and mail) with the change, and they all work correctly. I don't > > have a qmail installation, but Postfix's sendmail wrapper worked > > fine. > > About qmail, look what is said in a bug report: > > "Use of CRLF is known to break qmail systems where no conversion of > line breaks occurs on the input data. In this case using CRLF causes > all but the first extra header to appear in the message body (CRLF is > interpreted as two line breaks)." > > cf http://bugs.php.net/bug.php?id=15841 Please review the attached patch. I believe it addresses all of the know problems. It also gives the caller the ability to change a Mail object's line separator after by altering $mail->sep. Comments / testing from everyone are appreciated. -- Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)

Index: Mail.php =================================================================== RCS file: /repository/pear/Mail/Mail.php,v retrieving revision 1.4 diff -u -r1.4 Mail.php --- Mail.php 13 Jun 2003 23:06:12 -0000 1.4 +++ Mail.php 13 Jun 2003 23:07:42 -0000 @@ -32,6 +32,12 @@ class Mail { /** + * Line separator + * @var string + */ + var $sep = "\r\n"; + + /** * Provides an interface for generating Mail:: objects of various * types * @@ -145,7 +151,7 @@ } } - return array($from, join("\r\n", $lines)); + return array($from, join($this->sep, $lines)); } /**
« previous php.pear.dev (#17501) next »