break;
case OP_COMPOSE_EDIT_TO:
menu->redraw = edit_address_list (HDR_TO, &msg->env->to);
+ if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
+ {
+ crypt_opportunistic_encrypt (msg);
+ redraw_crypt_lines (msg);
+ }
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_BCC:
menu->redraw = edit_address_list (HDR_BCC, &msg->env->bcc);
+ if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
+ {
+ crypt_opportunistic_encrypt (msg);
+ redraw_crypt_lines (msg);
+ }
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_CC:
menu->redraw = edit_address_list (HDR_CC, &msg->env->cc);
+ if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
+ {
+ crypt_opportunistic_encrypt (msg);
+ redraw_crypt_lines (msg);
+ }
mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_SUBJECT:
mutt_error (_("Bad IDN in \"%s\": '%s'"), tag, err);
FREE (&err);
}
+ if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
+ crypt_opportunistic_encrypt (msg);
}
else
{
{
char *pgpkeylist = NULL;
+ if (!WithCrypto)
+ return;
+
/* crypt_autoencrypt should override crypt_opportunistic_encrypt */
if (option (OPTCRYPTAUTOENCRYPT))
return;
** $$crypt_replyencrypt,
** $$crypt_autosign, $$crypt_replysign and $$smime_is_default.
*/
+ { "crypt_opportunistic_encrypt", DT_BOOL, R_NONE, OPTCRYPTOPPORTUNISTICENCRYPT, 0 },
+ /*
+ ** .pp
+ ** Setting this variable will cause Mutt to automatically enable and
+ ** disable encryption, based on whether all message recipient keys
+ ** can be located by mutt.
+ ** .pp
+ ** When this option is enabled, mutt will determine the encryption
+ ** setting each time the TO, CC, and BCC lists are edited. If
+ ** $$edit_headers is set, mutt will also do so each time the message
+ ** is edited.
+ ** .pp
+ ** While this is set, encryption settings can't be manually changed.
+ ** The pgp or smime menus provide an option to disable the option for
+ ** a particular message.
+ ** .pp
+ ** If $$crypt_autoencrypt or $$crypt_replyencrypt enable encryption for
+ ** a message, this option will be disabled for the message. It can
+ ** be manually re-enabled in the pgp or smime menus.
+ ** (Crypto only)
+ */
{ "pgp_replyencrypt", DT_SYN, R_NONE, UL "crypt_replyencrypt", 1 },
{ "crypt_replyencrypt", DT_BOOL, R_NONE, OPTCRYPTREPLYENCRYPT, 1 },
/*
OPTCRYPTAUTOENCRYPT,
OPTCRYPTAUTOPGP,
OPTCRYPTAUTOSMIME,
+ OPTCRYPTOPPORTUNISTICENCRYPT,
OPTCRYPTREPLYENCRYPT,
OPTCRYPTREPLYSIGN,
OPTCRYPTREPLYSIGNENCRYPTED,
msg->security |= INLINE;
}
- if (msg->security)
+ if (msg->security || option (OPTCRYPTOPPORTUNISTICENCRYPT))
{
/*
* When replying / forwarding, use the original message's
}
}
+ /* opportunistic encrypt relys on SMIME or PGP already being selected */
+ if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
+ {
+ crypt_opportunistic_encrypt(msg);
+ }
+
/* No permissible mechanisms found. Don't sign or encrypt. */
if (!(msg->security & (APPLICATION_SMIME|APPLICATION_PGP)))
msg->security = 0;