changeset: 6440:bd21cff208c4
user: Kevin McCarthy <[email protected]>
date: Thu Mar 12 14:48:48 2015 -0700
link: http://dev.mutt.org/hg/mutt/rev/bd21cff208c4
Allow attachments from unencrypted emails to be deleted.
Print a warning if the message is signed or partly signed.
Thanks to David Haguenauer for the original patch!
diffs (97 lines):
diff -r ca5aff2a4b6e -r bd21cff208c4 recvattach.c
--- a/recvattach.c Mon Apr 06 18:39:09 2015 -0700
+++ b/recvattach.c Thu Mar 12 14:48:48 2015 -0700
@@ -1119,50 +1119,53 @@
}
#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;
+ 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.");
- }
- }
- }
- }
+ 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: