From: René Clerc Date: Thu, 10 Oct 2002 09:50:03 +0000 (+0000) Subject: Make sure that crypt_reply replies with the same type, despite a X-Git-Tag: mutt-1-5-2-rel~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8d82e3072f54cfcae1a8cdeab8aed6cb241a6a73;p=mutt Make sure that crypt_reply replies with the same type, despite a possible S/MIME default. --- diff --git a/send.c b/send.c index 85186b56..0f7ed7d6 100644 --- a/send.c +++ b/send.c @@ -1248,28 +1248,41 @@ ci_send_message (int flags, /* send mode */ 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 */ - } /* wait until now to set the real name portion of our return address so that $realname can be set in a send-hook */