]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-reply.c
reply: Include sender as recipient if they were the original recipient
[notmuch] / notmuch-reply.c
index 75cf7ecb5068534df678e37fd0a606cd6215739e..d87ec06d83f4989a8d6563fe141fd025c656b4c4 100644 (file)
@@ -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;
 }