From bb4283a2a2f7cbed0bcbd8988b52369bb3688924 Mon Sep 17 00:00:00 2001 From: SJ Date: Sun, 11 Dec 2016 14:39:06 +0100 Subject: [PATCH] Fix issue #737: web gui not showing body for some emails Change-Id: Ic9fb3d8306adb89da1a95f8dc39019bf85636f12 Signed-off-by: SJ --- webui/model/search/message.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/webui/model/search/message.php b/webui/model/search/message.php index fa615662..b690ff91 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -273,8 +273,16 @@ class ModelSearchMessage extends Model { 'encoding' => '' ); - if(isset($mime_parts[$i]['header']['content-type'])) + if(isset($mime_parts[$i]['header']['content-type'])) { $mime['content-type'] = Zend_Mime_Decode::splitContentType($mime_parts[$i]['header']['content-type']); + } + /* + Fix the mime type for some emails having a single textual body part + without the Content-type header. + */ + else if (count($mime_parts) == 1) { + $mime['content-type']['type'] = 'text/plain'; + } if(in_array($mime['content-type']['type'], array('multipart/mixed', 'multipart/related', 'multipart/alternative'))) $this->extract_textuals_from_mime_parts($mime_parts[$i]['header'], $mime_parts[$i]['body'], $mime['content-type']['boundary']);