1 diff -urNp -x '*.orig' mutt-2.0.6.org/PATCHES mutt-2.0.6/PATCHES
2 --- mutt-2.0.6.org/PATCHES 2021-04-18 19:23:38.550015388 +0200
3 +++ mutt-2.0.6/PATCHES 2021-04-18 19:23:38.680017105 +0200
5 +patch-1.5.6.dw.crypt-autoselectkey.1
7 patch-1.3.27.cd.signatures_menu.2.1
8 diff -urNp -x '*.orig' mutt-2.0.6.org/init.h mutt-2.0.6/init.h
9 --- mutt-2.0.6.org/init.h 2021-04-18 19:23:38.550015388 +0200
10 +++ mutt-2.0.6/init.h 2021-04-18 19:23:38.680017105 +0200
11 @@ -1203,6 +1203,16 @@ struct option_t MuttVars[] = {
12 ** For a full listing of defined \fCprintf(3)\fP-like sequences see
13 ** the section on $$index_format. See also $$attribution_locale.
17 + { "pgp_autoselectkey", DT_SYN, R_NONE, {.p="crypt_autoselectkey"}, {.l=0} },
18 + { "crypt_autoselectkey", DT_BOOL, R_NONE, OPTCRYPTAUTOSELECT, 0 },
21 + ** If set, then a list of keys is not presented for selection when only
22 + ** one matching key is available. This may be useful in conjunction with
23 + ** the \fIcrypt-hook\fP command.
26 $forward_attribution_trailer default value
28 diff -urNp -x '*.orig' mutt-2.0.6.org/mutt.h mutt-2.0.6/mutt.h
29 --- mutt-2.0.6.org/mutt.h 2021-04-18 19:23:38.546682010 +0200
30 +++ mutt-2.0.6/mutt.h 2021-04-18 19:23:38.680017105 +0200
31 @@ -429,6 +429,7 @@ enum
32 #if defined(HAVE_QDBM) || defined(HAVE_TC) || defined(HAVE_KC)
34 #endif /* HAVE_QDBM */
39 diff -urNp -x '*.orig' mutt-2.0.6.org/pgpkey.c mutt-2.0.6/pgpkey.c
40 --- mutt-2.0.6.org/pgpkey.c 2020-07-25 20:22:53.000000000 +0200
41 +++ mutt-2.0.6/pgpkey.c 2021-04-18 19:23:38.680017105 +0200
42 @@ -440,8 +440,13 @@ static int pgp_id_matches_addr (ADDRESS
47 +#define pgp_trusted_id(uid) (!option(OPTPGPCHECKTRUST) \
48 + || (pgp_id_is_valid((uid)) \
49 + && pgp_id_is_strong((uid))))
51 static pgp_key_t pgp_select_key (pgp_key_t keys,
52 - ADDRESS * p, const char *s)
53 + ADDRESS * p, const char *s)
57 @@ -456,6 +461,7 @@ static pgp_key_t pgp_select_key (pgp_key
59 int (*f) (const void *, const void *);
61 + int keymatch = 0; /* count matching keys */
65 @@ -485,6 +491,7 @@ static pgp_key_t pgp_select_key (pgp_key
73 @@ -493,6 +500,21 @@ static pgp_key_t pgp_select_key (pgp_key
77 + else if (keymatch == 1 && option(OPTCRYPTAUTOSELECT))
80 + * Only one matching key...see if there's an id with enough trust to auto-select
82 + kp = KeyTable[0]->parent;
83 + for (a = kp->address; a; a = a->next)
85 + if (pgp_trusted_id(a))
87 + safe_free ((void **) &KeyTable);
93 switch (PgpSortKeys & SORT_MASK)
95 @@ -609,9 +631,7 @@ static pgp_key_t pgp_select_key (pgp_key
99 - if (option (OPTPGPCHECKTRUST) &&
100 - (!pgp_id_is_valid (KeyTable[menu->current])
101 - || !pgp_id_is_strong (KeyTable[menu->current])))
102 + if (!pgp_trusted_id(KeyTable[menu->current]))
105 char buff[LONG_STRING];