X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=0d29cf075d0c8b61d39910ec6ddd24605a0a8649;hp=cb42de45b300acc0615080796c30c6e06fd08359;hb=62379f3dee5bc3673007271bc43ecc2587ac4e22;hpb=fddd3d831b6a34a47b1e68fcaa1bc63d54240df5 diff --git a/notmuch-reply.c b/notmuch-reply.c index cb42de45..0d29cf07 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -207,19 +207,29 @@ mailing_list_munged_reply_to (notmuch_message_t *message) InternetAddressMailbox *mailbox; header = notmuch_message_get_header (message, "reply-to"); + if (*header == '\0') + return 0; + list = internet_address_list_parse_string (header); + if (internet_address_list_length (list) != 1) return 0; + address = internet_address_list_get_address (list, 0); if (INTERNET_ADDRESS_IS_GROUP (address)) return 0; + mailbox = INTERNET_ADDRESS_MAILBOX (address); addr = internet_address_mailbox_get_addr (mailbox); - /* Note that strcasestr() is a GNU extension, strstr() might be sufficient */ - if (strcasestr (notmuch_message_get_header (message, "to"), addr) == 0 || - strcasestr (notmuch_message_get_header (message, "cc"), addr) == 0) + + if (strstr (notmuch_message_get_header (message, "to"), addr) != 0 || + strstr (notmuch_message_get_header (message, "cc"), addr) != 0) + { return 1; - return 0; } + } + + return 0; +} /* Augments the recipients of reply from the headers of message. * @@ -271,6 +281,7 @@ add_recipients_from_message (GMimeMessage *reply, if (from_addr == NULL) from_addr = addr; } + return from_addr; }