X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-reply.c;h=d87ec06d83f4989a8d6563fe141fd025c656b4c4;hb=d9800c893289b56dcc966241528643ae83f2ff9a;hp=3e5a1443719ac80c7fe0791b2ff8e97697c81527;hpb=0f314c0c99befea599a68bea51d759b4133efef6;p=notmuch diff --git a/notmuch-reply.c b/notmuch-reply.c index 3e5a1443..d87ec06d 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -369,6 +369,14 @@ add_recipients_from_message (GMimeMessage *reply, } } + /* If no recipients were added but we found one of the user's + * addresses to use as a from address then the message is from the + * user to the user - add the discovered from address to the list + * of recipients so that the reply goes back to the user. + */ + if (n == 0 && from_addr) + g_mime_message_add_recipient (reply, GMIME_ADDRESS_TYPE_TO, NULL, from_addr); + return from_addr; } @@ -700,6 +708,7 @@ 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_AUTO }, }; int format = FORMAT_DEFAULT; int reply_all = true; @@ -716,7 +725,12 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) (notmuch_keyword_t []){ { "all", true }, { "sender", false }, { 0, 0 } } }, - { .opt_bool = ¶ms.crypto.decrypt, .name = "decrypt" }, + { .opt_keyword = (int*)(¶ms.crypto.decrypt), .name = "decrypt", + .keyword_no_arg_value = "true", .keywords = + (notmuch_keyword_t []){ { "false", NOTMUCH_DECRYPT_FALSE }, + { "auto", NOTMUCH_DECRYPT_AUTO }, + { "true", NOTMUCH_DECRYPT_NOSTASH }, + { 0, 0 } } }, { .opt_inherit = notmuch_shared_options }, { } }; @@ -759,7 +773,7 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) if (do_reply (config, query, ¶ms, format, reply_all) != 0) return EXIT_FAILURE; - notmuch_crypto_cleanup (¶ms.crypto); + _notmuch_crypto_cleanup (¶ms.crypto); notmuch_query_destroy (query); notmuch_database_destroy (notmuch);