if (crypt_hook != NULL)
{
crypt_hook_val = crypt_hook->data;
- r = M_NO;
- if (! oppenc_mode)
+ r = M_YES;
+ if (! oppenc_mode && option(OPTCRYPTCONFIRMHOOK))
{
snprintf (buf, sizeof (buf), _("Use keyID = \"%s\" for %s?"),
crypt_hook_val, p->mailbox);
r = mutt_yesorno (buf, M_YES);
}
- if (oppenc_mode || (r == M_YES))
+ if (r == M_YES)
{
if (crypt_is_numerical_keyid (crypt_hook_val))
{
You may use multiple crypt-hooks with the same regexp; multiple
matching crypt-hooks result in the use of multiple keyids for
a recipient. During key selection, Mutt will confirm whether each
-crypt-hook is to be used. If all crypt-hooks for a recipient are
-declined, Mutt will use the original recipient address for key selection
-instead.
+crypt-hook is to be used (unless the <link
+linkend="crypt-confirmhook">$crypt_confirmhook</link> option is unset).
+If all crypt-hooks for a recipient are declined, Mutt will use the
+original recipient address for key selection instead.
</para>
<para>
** $$crypt_replyencrypt,
** $$crypt_autosign, $$crypt_replysign and $$smime_is_default.
*/
+ { "crypt_confirmhook", DT_BOOL, R_NONE, OPTCRYPTCONFIRMHOOK, 1 },
+ /*
+ ** .pp
+ ** If set, then you will be prompted for confirmation of keys when using
+ ** the \fIcrypt-hook\fP command. If unset, no such confirmation prompt will
+ ** be presented. This is generally considered unsafe, especially where
+ ** typos are concerned.
+ */
{ "crypt_opportunistic_encrypt", DT_BOOL, R_NONE, OPTCRYPTOPPORTUNISTICENCRYPT, 0 },
/*
** .pp
OPTCRYPTAUTOENCRYPT,
OPTCRYPTAUTOPGP,
OPTCRYPTAUTOSMIME,
+ OPTCRYPTCONFIRMHOOK,
OPTCRYPTOPPORTUNISTICENCRYPT,
OPTCRYPTREPLYENCRYPT,
OPTCRYPTREPLYSIGN,
if (crypt_hook != NULL)
{
keyID = crypt_hook->data;
- r = M_NO;
- if (! oppenc_mode)
+ r = M_YES;
+ if (! oppenc_mode && option(OPTCRYPTCONFIRMHOOK))
{
snprintf (buf, sizeof (buf), _("Use keyID = \"%s\" for %s?"), keyID, p->mailbox);
r = mutt_yesorno (buf, M_YES);
}
- if (oppenc_mode || (r == M_YES))
+ if (r == M_YES)
{
if (crypt_is_numerical_keyid (keyID))
{