-int mutt_protect (HEADER *msg, char *keylist)
+int mutt_protect (HEADER *msg, HEADER *cur, char *keylist)
{
BODY *pbody = NULL, *tmp_pbody = NULL;
BODY *tmp_smime_pbody = NULL;
if ((msg->content->type == TYPETEXT) &&
!ascii_strcasecmp (msg->content->subtype, "plain"))
{
- if ((i = query_quadoption (OPT_PGPTRADITIONAL, _("Create an inline PGP message?"))) == -1)
- return -1;
- else if (i == M_YES)
- traditional = 1;
+ if (cur && cur->security && option (OPTPGPAUTOTRAD)
+ && (option (OPTCRYPTREPLYENCRYPT)
+ || option (OPTCRYPTREPLYSIGN)
+ || option (OPTCRYPTREPLYSIGNENCRYPTED)))
+ {
+ if(mutt_is_application_pgp(cur->content))
+ traditional = 1;
+ }
+ else
+ {
+ if ((i = query_quadoption (OPT_PGPTRADITIONAL, _("Create a traditional (inline) PGP message?"))) == -1)
+ return -1;
+ else if (i == M_YES)
+ traditional = 1;
+ }
}
if (traditional)
{
** \fBdeprecated\fP.
** (PGP only)
*/
+ { "pgp_auto_traditional", DT_BOOL, R_NONE, OPTPGPAUTOTRAD, M_NO },
+ /*
+ ** .pp
+ ** This option causes Mutt to generate an old-style PGP encrypted or
+ ** signed message when replying to an old-style message, and a
+ ** PGP/MIME message when replying to a PGP/MIME message. Note that
+ ** this option is only meaningful when using
+ ** ``$$crypt_replyencrypt'', ``$$crypt_replysign'', or
+ ** ``$$crypt_replysignencrypted''.
+ ** .pp
+ ** Note that PGP/MIME will be used automatically for messages which have
+ ** a character set different from us-ascii, or which consist of more than
+ ** a single MIME part.
+ ** .pp
+ ** This option overrides ``$$pgp_create_traditional''
+ ** (PGP only)
+ */
/* XXX Default values! */
OPTSDEFAULTDECRYPTKEY,
OPTPGPIGNORESUB,
OPTPGPLONGIDS,
+ OPTPGPAUTOTRAD,
#if 0
OPTPGPENCRYPTSELF,
#endif
/* Some prototypes -- old crypt.h. */
-int mutt_protect (HEADER *, char *);
+int mutt_protect (HEADER *, HEADER *, char *);
int mutt_is_multipart_encrypted (BODY *);
clear_content = msg->content;
if ((crypt_get_keys (msg, &pgpkeylist) == -1) ||
- mutt_protect (msg, pgpkeylist) == -1)
+ mutt_protect (msg, cur, pgpkeylist) == -1)
{
msg->content = mutt_remove_multipart (msg->content);
/* this means writing only the main part */
msg->content = clear_content->parts;
- if (mutt_protect (msg, pgpkeylist) == -1)
+ if (mutt_protect (msg, cur, pgpkeylist) == -1)
{
/* we can't do much about it at this point, so
* fallback to saving the whole thing to fcc