summaryrefslogtreecommitdiffstats
path: root/notmuch-reply.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-12-08 01:23:54 -0500
committerDavid Bremner <david@tethera.net>2017-12-08 08:08:46 -0400
commit6802b333eb356fdeafd97a4e4ed74999d055a852 (patch)
treef3cf6778668a27006ff63edde8f5e70c6d813cef /notmuch-reply.c
parente4890b5bf9e2260b36bcc36ddb77d8e97e2abe7d (diff)
cli/reply: use decryption policy "auto" by default.
If the user doesn't specify --decrypt= at all, but a stashed session key is known to notmuch, when replying to an encrypted message, notmuch should just go ahead and decrypt. The user can disable this at the command line with --decrypt=false, though it's not clear why they would ever want to do that.
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r--notmuch-reply.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index eec34bed..fd990a9a 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -700,11 +700,12 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
int opt_index;
notmuch_show_params_t params = {
.part = -1,
- .crypto = { .decrypt = NOTMUCH_DECRYPT_FALSE },
+ .crypto = { .decrypt = NOTMUCH_DECRYPT_AUTO },
};
int format = FORMAT_DEFAULT;
int reply_all = true;
bool decrypt = false;
+ bool decrypt_set = false;
notmuch_opt_desc_t options[] = {
{ .opt_keyword = &format, .name = "format", .keywords =
@@ -718,7 +719,7 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
(notmuch_keyword_t []){ { "all", true },
{ "sender", false },
{ 0, 0 } } },
- { .opt_bool = &decrypt, .name = "decrypt" },
+ { .opt_bool = &decrypt, .name = "decrypt", .present = &decrypt_set },
{ .opt_inherit = notmuch_shared_options },
{ }
};
@@ -728,8 +729,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
return EXIT_FAILURE;
notmuch_process_shared_options (argv[0]);
- if (decrypt)
- params.crypto.decrypt = NOTMUCH_DECRYPT_TRUE;
+ if (decrypt_set)
+ params.crypto.decrypt = decrypt ? NOTMUCH_DECRYPT_TRUE : NOTMUCH_DECRYPT_FALSE;
notmuch_exit_if_unsupported_format ();