]> granicus.if.org Git - neomutt/commitdiff
Allow attachments from unencrypted emails to be deleted.
authorKevin McCarthy <kevin@8t8.us>
Thu, 12 Mar 2015 21:48:48 +0000 (14:48 -0700)
committerKevin McCarthy <kevin@8t8.us>
Thu, 12 Mar 2015 21:48:48 +0000 (14:48 -0700)
Print a warning if the message is signed or partly signed.

Thanks to David Haguenauer for the original patch!

recvattach.c

index 31dfcadd5c99ff2fcca4c5ba5daa349cf4c639a0..245204974b26f6a7a9d9876d4b04593050ee1605 100644 (file)
@@ -1119,50 +1119,53 @@ void mutt_view_attachments (HEADER *hdr)
        }
 #endif
 
-        if (WithCrypto && hdr->security & ~PGP_TRADITIONAL_CHECKED)
+        if (WithCrypto && (hdr->security & ENCRYPT))
         {
-         mutt_message _(
-           "Deletion of attachments from encrypted messages is unsupported.");
-       }
+          mutt_message _(
+            "Deletion of attachments from encrypted messages is unsupported.");
+          break;
+        }
+        if (WithCrypto && (hdr->security & (SIGN | PARTSIGN)))
+        {
+          mutt_message _(
+            "Deletion of attachments from signed messages may invalidate the signature.");
+        }
+        if (!menu->tagprefix)
+        {
+          if (idx[menu->current]->parent_type == TYPEMULTIPART)
+          {
+            idx[menu->current]->content->deleted = 1;
+            if (option (OPTRESOLVE) && menu->current < menu->max - 1)
+            {
+              menu->current++;
+              menu->redraw = REDRAW_MOTION_RESYNCH;
+            }
+            else
+              menu->redraw = REDRAW_CURRENT;
+          }
+          else
+            mutt_message _(
+              "Only deletion of multipart attachments is supported.");
+        }
         else
         {
-         if (!menu->tagprefix)
-         {
-           if (idx[menu->current]->parent_type == TYPEMULTIPART)
-           {
-             idx[menu->current]->content->deleted = 1;
-             if (option (OPTRESOLVE) && menu->current < menu->max - 1)
-             {
-               menu->current++;
-               menu->redraw = REDRAW_MOTION_RESYNCH;
-             }
-             else
-               menu->redraw = REDRAW_CURRENT;
-           }
-           else
-             mutt_message _(
-               "Only deletion of multipart attachments is supported.");
-         }
-         else
-         {
-           int x;
-
-           for (x = 0; x < menu->max; x++)
-           {
-             if (idx[x]->content->tagged)
-             {
-               if (idx[x]->parent_type == TYPEMULTIPART)
-               {
-                 idx[x]->content->deleted = 1;
-                 menu->redraw = REDRAW_INDEX;
-               }
-               else
-                 mutt_message _(
-                   "Only deletion of multipart attachments is supported.");
-             }
-           }
-         }
-       }
+          int x;
+
+          for (x = 0; x < menu->max; x++)
+          {
+            if (idx[x]->content->tagged)
+            {
+              if (idx[x]->parent_type == TYPEMULTIPART)
+              {
+                idx[x]->content->deleted = 1;
+                menu->redraw = REDRAW_INDEX;
+              }
+              else
+                mutt_message _(
+                  "Only deletion of multipart attachments is supported.");
+            }
+          }
+        }
         break;
 
       case OP_UNDELETE: