From 5d2a7b15bc24cf88afa8a8679927f3a3a1332a1a Mon Sep 17 00:00:00 2001 From: stekkel Date: Sat, 10 May 2003 12:15:19 +0000 Subject: [PATCH] Fix for folding inside msg-id's git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4855 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/deliver/Deliver.class.php | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/class/deliver/Deliver.class.php b/class/deliver/Deliver.class.php index 5b7a965c..a053b025 100644 --- a/class/deliver/Deliver.class.php +++ b/class/deliver/Deliver.class.php @@ -339,12 +339,33 @@ class Deliver { } $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); -- 2.25.1