[notmuch] [PATCH 2/2] notmuch-reply.c: Handle munged `Reply-To' headers.

Carl Worth cworth at cworth.org
Thu Feb 4 12:54:20 PST 2010


On Sun, 29 Nov 2009 00:19:36 +0100, Jed Brown <jed at 59A2.org> wrote:
> Some mailing lists engage in the evil practice of changing the Reply-To
> header so that replies from all mailers go to the list by default, at
> the expense of not responding to the person who actually sent the
> message.  When this is detected, we reply to `From' and remove the
> duplicate response to the mailing list.  Consider a reply to the
> following message.

Thanks for the patch, Jed!

I've gone ahead and pushed this out, (along with some cleanups/fixes).

I augmented the notmuch test suite to actually test this case, (and the
related case of honoring Reply-To for a non-munged message). And I'm
glad I did because that turned up a bug in the patch, (using == instead
of != for the return value of strcasestr resulted in *all* messages with
a Reply-To header being considered as munged).

Here's one cleanup I made which you might find interesting as a style
issue (where I prefer naming a function based on what it *does* rather
than on what it's being *used* for):

commit d111c720bad53f98edba958aa605e857036a2bc8
Author: Carl Worth <cworth at cworth.org>
Date:   Thu Feb 4 12:39:11 2010 -0800

    notmuch reply: Rename the mailing_list_munged_reply_to function
    
    This function detects whether the address in the Reply-To header
    already appears in either To or Cc. So give it a name that reflects
    what it does (reply_to_header_is_redundant) rather than the old name
    which described one possible use of the function, (as a simple
    heuristic for detecting whether a mailing list had applied reply-to
    munging).

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100204/bad9893c/attachment.pgp>


More information about the notmuch mailing list