From 60b61ba2257e2531af59a3ac8765e888b10bc148 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Sat, 14 Mar 2020 12:40:37 +0100 Subject: [PATCH] Fixed the gui mime parser Signed-off-by: Janos SUTO --- webui/system/helper/mime.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webui/system/helper/mime.php b/webui/system/helper/mime.php index fd0021ed..b4f835ef 100644 --- a/webui/system/helper/mime.php +++ b/webui/system/helper/mime.php @@ -123,6 +123,17 @@ class Piler_Mime_Decode { self::splitMessageRaw($msg, $headers, $j, $body); } } + + // If the message has a single binary attachment, then drop the body part + if(isset($headers_array['content-type']['type'])) { + foreach(['application/', 'image/'] as $type) { + if(strstr($headers_array['content-type']['type'], $type)) { + $body = ''; + break; + } + } + } + } else { $headers = $message;