X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-reply.c;h=974df401a5e59af5487dd5ff205160f757a7ccf4;hb=096d45a878ba9606f1677f66d346b14c3c274fa5;hp=75cf7ecb5068534df678e37fd0a606cd6215739e;hpb=2f4beda434c59f9e2f5b7c32d26543bad7217ad4;p=notmuch diff --git a/notmuch-reply.c b/notmuch-reply.c index 75cf7ecb..974df401 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; } @@ -746,10 +748,6 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; } -#if (GMIME_MAJOR_VERSION < 3) - params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config); -#endif - if (notmuch_database_open (notmuch_config_get_database_path (config), NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return EXIT_FAILURE;