Commit 6d217f9c authored by Derek Martin's avatar Derek Martin

pgp-auto-decode: When $pgp_auto_decode is set, then mutt will check

for traditional pgp on certain operations.  This is similar (but NOT
identical) to the behavior known from PGP/MIME messages.
parent 5648dc02
......@@ -966,6 +966,7 @@ static int _mutt_check_traditional_pgp (HEADER *h, int *redraw)
rv = 1;
}
h->security |= PGP_TRADITIONAL_CHECKED;
mx_close_message (&msg);
return rv;
}
......
......@@ -1139,6 +1139,8 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
menu->current = mutt_thread_next_unread (Context, CURHDR);
}
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
if ((op = mutt_display_message (CURHDR)) == -1)
{
unset_option (OPTNEEDRESORT);
......@@ -1815,6 +1817,8 @@ CHECK_IMAP_ACL(IMAP_ACL_DELETE);
CHECK_IMAP_ACL(IMAP_ACL_INSERT);
#endif
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
mutt_edit_message (Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
......@@ -1825,6 +1829,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
......@@ -1839,6 +1845,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY|SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
......@@ -1848,6 +1856,8 @@ CHECK_IMAP_ACL(IMAP_ACL_INSERT);
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY|SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
......@@ -1966,6 +1976,8 @@ CHECK_IMAP_ACL(IMAP_ACL_SEEN);
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
if (option (OPTPGPAUTODEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
ci_send_message (SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
......
......@@ -1534,6 +1534,17 @@ struct option_t MuttVars[] = {
** \fBdeprecated\fP.
** (PGP only)
*/
{ "pgp_auto_decode", DT_BOOL, R_NONE, OPTPGPAUTODEC, 0 },
/*
** .pp
** If set, mutt will automatically attempt to decrypt traditional PGP
** messages whenever the user performs an operation which ordinarily would
** result in the contents of the message being operated on. For example,
** if the user displays a pgp-traditional message which has not been manually
** checked with the check-traditional-pgp function, mutt will automatically
** check the message for traditional pgp.
*/
/* XXX Default values! */
......
......@@ -461,6 +461,7 @@ enum
OPTPGPIGNORESUB,
OPTPGPCHECKEXIT,
OPTPGPLONGIDS,
OPTPGPAUTODEC,
#if 0
OPTPGPENCRYPTSELF,
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment