X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-reply.c;h=d51fdfc360dd58edc1e5358433663273188aa8a9;hb=1c036cca99c4c7cdd649721511cc76b451ef6c98;hp=47993d223090ee423b7c42126122dcd688215c8b;hpb=998a8a95c3cd19950b78c50912345669952ba3eb;p=notmuch diff --git a/notmuch-reply.c b/notmuch-reply.c index 47993d22..d51fdfc3 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -21,6 +21,7 @@ */ #include "notmuch-client.h" +#include "string-util.h" #include "sprinter.h" static void @@ -465,14 +466,21 @@ guess_from_in_received_headers (notmuch_config_t *config, notmuch_message_t *message) { const char *received, *addr; + char *sanitized; received = notmuch_message_get_header (message, "received"); if (! received) return NULL; - addr = guess_from_in_received_for (config, received); + sanitized = sanitize_string (NULL, received); + if (! sanitized) + return NULL; + + addr = guess_from_in_received_for (config, sanitized); if (! addr) - addr = guess_from_in_received_by (config, received); + addr = guess_from_in_received_by (config, sanitized); + + talloc_free (sanitized); return addr; } @@ -761,7 +769,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) .part = -1, .crypto = { .verify = FALSE, - .decrypt = FALSE + .decrypt = FALSE, + .gpgpath = NULL } }; int format = FORMAT_DEFAULT; @@ -813,6 +822,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; } + params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config); + if (notmuch_database_open (notmuch_config_get_database_path (config), NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return EXIT_FAILURE;