On Thu, Mar 12, 2015 at 02:53:52PM -0700, Kevin J. McCarthy wrote: > David Champion wrote: > > > If the signature was checked, I think it would be useful to keep this > > > information at the same time the attachment is deleted. > > > > It looks like I forgot to post part of my thinking: when taking > > action that invalidates a signature, we should change the signature > > to application/invalidated-pgp-signature or somesuch (and leave the > > signature content as-is). Then they can delete the sig if they wish. > > Determining the applicable signatures could be... interesting when > more than one is involved (e.g. nested forwarded signed emails with > attachments). I wonder if the effort is worth it? > > On the other hand, simply printing a warning that the signature may be > invalidated when any attachment is deleted (if the SIGN or PARTSIGN bit > is set in the header) seems comparatively easy. The attached patch > seems to work.
Back in 02/28/13 I submitted a modified version of David Haguenaue's original patch that added a allow_signed_attach_delete boolean mutt parameter. I've attached the patch in case that's useful. -- Will Fiveash
# HG changeset patch # User Will Fiveash <[email protected]> # Date 1362093073 21600 # Branch HEAD # Node ID bd8e669e66a0add24813e41f7836fd80c85dbc03 # Parent 8c4b813160a898dc2014eaa85a49a4e0d3e30472 support new option to allow deletion of attachments in signed messages diff --git a/init.h b/init.h --- a/init.h +++ b/init.h @@ -149,6 +149,12 @@ ** and give it the same color as your attachment color (see also ** $$crypt_timestamp). */ + { "allow_signed_attach_delete", DT_BOOL, R_NONE, OPTALLOWSIGNATTCHDEL, 0 }, + /* + ** .pp + ** Controls whether attachments in signed e-mails can be deleted. Note, deleting attachments + ** will cause the signature verification of the affected message to fail. + */ { "arrow_cursor", DT_BOOL, R_BOTH, OPTARROWCURSOR, 0 }, /* ** .pp diff --git a/mutt.h b/mutt.h --- a/mutt.h +++ b/mutt.h @@ -314,6 +314,7 @@ { OPTALLOW8BIT, OPTALLOWANSI, + OPTALLOWSIGNATTCHDEL, OPTARROWCURSOR, OPTASCIICHARS, OPTASKBCC, diff --git a/recvattach.c b/recvattach.c --- a/recvattach.c +++ b/recvattach.c @@ -1119,7 +1119,8 @@ } #endif - if (WithCrypto && hdr->security & ~PGP_TRADITIONAL_CHECKED) + if (!option(OPTALLOWSIGNATTCHDEL) && WithCrypto && + (hdr->security & ~PGP_TRADITIONAL_CHECKED)) { mutt_message _( "Deletion of attachments from encrypted messages is unsupported.");
