瀏覽代碼

removed displaying attachments in case we are dealing with
multipart/alternative or multipart/related messages.

stekkel 23 年之前
父節點
當前提交
41ff8ab18b
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      functions/mime.php

+ 7 - 1
functions/mime.php

@@ -811,7 +811,13 @@ function formatBody($imap_stream, $message, $color, $wrap_at) {
 
         /** Display the ATTACHMENTS: message if there's more than one part **/
         if (isset($message->entities[1])) {
-            $body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
+	    /* Header-type alternative means we choose the best one to display 
+	       so don't show the alternatives as attachment. Header-type related
+	       means that the attachments are already part of the related message.
+	    */   
+	    if ($message->header->type1 !='related' && $message->header->type1 !='alternative') {
+        	$body .= formatAttachments ($message, $ent_num, $message->header->mailbox, $id);
+	    }
         }
     } else {
         $body = formatAttachments ($message, -1, $message->header->mailbox, $id);