X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-reply.c;h=cd1b602b10dade4132d932b527e5784af4a3393f;hb=570349e132da5e19b36a004e633b870cec810170;hp=2c7cc4eba674c7cd761a5532ccb67dd55ad8a2b9;hpb=88f2a72ef1dcfce149bbac776652ea04e564726d;p=notmuch diff --git a/notmuch-reply.c b/notmuch-reply.c index 2c7cc4eb..cd1b602b 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -325,12 +325,6 @@ add_recipients_from_message (GMimeMessage *reply, GMimeMessage *message, bool reply_all) { - - /* There is a memory leak here with gmime-2.6 because get_sender - * returns a newly allocated list, while the others return - * references to libgmime owned data. This leak will be fixed with - * the transition to gmime-3.0. - */ struct { InternetAddressList * (*get_header)(GMimeMessage *message); GMimeRecipientType recipient_type; @@ -369,6 +363,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 +702,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 +719,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 }, { } };