From: Marc G. K. <st...@us...> - 2003-05-10 12:15:22
|
Update of /cvsroot/squirrelmail/squirrelmail/class/deliver In directory sc8-pr-cvs1:/tmp/cvs-serv31380 Modified Files: Deliver.class.php Log Message: Fix for folding inside msg-id's Index: Deliver.class.php =================================================================== RCS file: /cvsroot/squirrelmail/squirrelmail/class/deliver/Deliver.class.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -r1.18 -r1.19 --- Deliver.class.php 7 Mar 2003 22:12:06 -0000 1.18 +++ Deliver.class.php 10 May 2003 12:15:19 -0000 1.19 @@ -339,12 +339,33 @@ } $cnt = count($header); $hdr_s = ''; + for ($i = 0 ; $i < $cnt ; $i++) { - $hdr_s .= $this->foldLine($header[$i], 78, str_pad('',4)); + $sKey = substr($header[$i],0,strpos($header[$i],':')); + switch ($sKey) + { + case 'Message-ID': + case 'In-Reply_To': + $hdr_s .= $header[$i]; + break; + case 'References': + $sRefs = substr($header[$i],12); + $aRefs = explode(' ',$sRefs); + $sLine = 'References:'; + foreach ($aRefs as $sReference) { + if (strlen($sLine)+strlen($sReference) >76) { + $hdr_s .= $sLine; + $sLine = $rn . ' ' . $sReference; + } else { + $sLine .= ' '. $sReference; + } + } + $hdr_s .= $sLine; + break; + default: $hdr_s .= $this->foldLine($header[$i], 78, str_pad('',4)); break; + } } -// $debug = "Debug: <123456789012345678901234567890123456789012345678901234567890123456789>\r\n"; -// $this->foldLine($debug, 78, str_pad('',4)); $header = $hdr_s; $header .= $rn; /* One blank line to separate header and body */ $raw_length += strlen($header); |