On Thu, Feb 28, 2013 at 03:35:44PM -0500, David Haguenauer wrote:
> * Stefan Wimmer <swim...@xs4all.nl>, 2013-02-28 12:55:39 Thu:
> > I recently started to sign all my mails and it took me little time
> > to find out that you can't delete attachments in signed/encrypted
> > mails ... ;-)
> 
> I patched my copy of mutt so that it will let me delete attachments
> from encrypted messages (breaking the signature along the way). I can
> try to find said patch if there is some interest (it's a one-liner).

Thanks for the idea.  I've attached a patch that provides a
allow_signed_attach_delete boolean option which if set will allow one to
delete attachments from a signed message.  See the patch for the
details.

-- 
Will Fiveash
# HG changeset patch
# User Will Fiveash <will.five...@oracle.com>
# Date 1362092439 21600
# Branch HEAD
# Node ID 1dd89609c1b16c9f3656ff7117fcb5719f5b6dec
# 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.  It is 
false
+  ** by default.
+  */
   { "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.");

Attachment: pgpT6lfdVMXa_.pgp
Description: PGP signature

Reply via email to