Index: program/js/app.js
===================================================================
--- program/js/app.js	(revision e9470683bf6f8a4995097512247c4a7f941315eb)
+++ program/js/app.js	(revision 6b4929278b757f41e0572e2d42982772542e4882)
@@ -1566,4 +1566,5 @@
       selected: this.select_all_mode || this.message_list.in_selection(uid),
       ml: flags.ml?1:0,
+      ctype: flags.ctype,
       // flags from plugins
       flags: flags.extra_flags
@@ -1659,5 +1660,8 @@
       }
       else if (c == 'attachment') {
-        html = flags.attachment ? '<span class="attachment">&nbsp;</span>' : '&nbsp;';
+        if (/application\/|multipart\/m/.test(flags.ctype))
+          html = '<span class="attachment">&nbsp;</span>';
+        else
+          html = '&nbsp;';
       }
       else if (c == 'threads')
Index: program/steps/mail/func.inc
===================================================================
--- program/steps/mail/func.inc	(revision 1716d5ef5a2d276582d4121d2f03b1149991e316)
+++ program/steps/mail/func.inc	(revision 6b4929278b757f41e0572e2d42982772542e4882)
@@ -319,6 +319,6 @@
     if ($header->others['list-post'])
       $a_msg_flags['ml'] = 1;
-    if (preg_match("/(application\/|multipart\/m)/i", $header->ctype))
-      $a_msg_flags['attachment'] = 1;
+
+    $a_msg_flags['ctype'] = Q($header->ctype);
     $a_msg_flags['mbox'] = $mbox;
 
