From 1970fc4d8c944b384f3e72666b07dfa37eea1eb4 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Sat, 20 Nov 2021 17:01:49 +0100 Subject: [PATCH] Fixed removeJournal() function Signed-off-by: Janos SUTO --- webui/system/helper/mime.php | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/webui/system/helper/mime.php b/webui/system/helper/mime.php index b6301ad6..04383b13 100644 --- a/webui/system/helper/mime.php +++ b/webui/system/helper/mime.php @@ -144,24 +144,13 @@ class Piler_Mime_Decode { public static function removeJournal(&$message, $EOL = "\n") { $has_journal = 0; - $s = self::remove_LF($message); - if(strpos($s, $EOL . $EOL)) { - list($headers, $body) = explode($EOL . $EOL, $s, 2); - if(!strstr($headers, "\nX-MS-Journal-Report:")) { - return $has_journal; - } + self::splitMessageRaw($message, $headers, $journal, $body); + + if($journal) { + $has_journal = 1; } - $p = strstr($message, "\nX-MS-Journal-Report:"); - if($p) { - $q = stristr($p, "message/rfc822"); - if($q) { - $has_journal = 1; - $i = strlen("message/rfc822"); - while(ctype_space($q[$i])) { $i++; } - if($i > 0) { $message = substr($q, $i); } - } - } + $message = $headers . $EOL . $EOL . $body; return $has_journal; }