* Ren� Clerc <[EMAIL PROTECTED]> [04-10-2002 17:02]:

> when somebody sends me PGP/MIME signed and encrypted mail, and 
> $crypt_replysignencrypted is set to yes, the reply is also signed and encrypted,
> but (in my case) _not_ with PGP/MIME, but with S/MIME, since I have
> $smime_is_default set.
> 
> I would like the behavior that the type of signing and/or encrypting
> is maintained when using one of the $crypt_reply* options.
> 
> Any comments? Patches ;)

This patch solves the above issue.

-- 
Ren� Clerc                      - ([EMAIL PROTECTED])

If you want to be worshipped, go to India and moo.
-The Quiz Show
--- mutt-1.5.1/send.c   Mon Feb 18 15:55:09 2002
+++ mutt-devel/send.c   Tue Oct  8 09:51:04 2002
@@ -1235,26 +1235,39 @@
        msg->security |= SIGN;
       if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur && cur->security & ENCRYPT)
        msg->security |= SIGN;
-      
-#ifdef HAVE_PGP
-      if (msg->security)
-       msg->security |= APPLICATION_PGP;   /* default is PGP */
-#endif
+    }      
 
+    if (msg->security && cur)
+    {
 #ifdef HAVE_SMIME
-      if (msg->security && ((cur && cur->security & APPLICATION_SMIME) ||
-         option (OPTSMIMEISDEFAULT)))
-      {
+      if (cur->security & APPLICATION_SMIME || option (OPTSMIMEISDEFAULT))
+        msg->security |= APPLICATION_SMIME;
+#endif
 #ifdef HAVE_PGP
-    /* if not both.. */
-       msg->security ^= APPLICATION_PGP;
+      if (cur->security & APPLICATION_PGP)
+      {
+#ifdef HAVE_SMIME
+        if (option (OPTSMIMEISDEFAULT))
+          msg->security ^= APPLICATION_SMIME;
 #endif
-       msg->security |= APPLICATION_SMIME;
+        msg->security |= APPLICATION_PGP;
       }
-#endif /* HAVE_SMIME */
+#endif /* HAVE_PGP */
+    }
+    else if (msg->security)
+    {
+#ifdef HAVE_PGP
+      msg->security |= APPLICATION_PGP;
+#ifdef HAVE_SMIME
+      if (option (OPTSMIMEISDEFAULT))
+      {
+        msg->security |= APPLICATION_SMIME;
+        msg->security ^= APPLICATION_PGP;
+      }
+#endif
+#endif /* HAVE_PGP */
     }
 #endif /* HAVE_PGP || HAVE_SMIME */
-
 
 
   }

Attachment: msg31642/pgp00000.pgp
Description: PGP signature

Reply via email to