]> git.notmuchmail.org Git - notmuch/commitdiff
Make parsing of References and In-Reply-To header less error prone
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 26 May 2014 14:05:57 +0000 (16:05 +0200)
committerDavid Bremner <david@tethera.net>
Sun, 17 Aug 2014 00:45:16 +0000 (17:45 -0700)
According to RFC2822 References and In-Reply-To headers are supposed
to contain one or more Message-IDs, however older RFC822 allowed
almost any content. When both References and In-Reply-To headers ends
with something else that a Message-ID (see e.g. [1]), the thread
structure presented by notmuch is incorrect. The reason is that
notmuch treats this case as if the email contained no "replyto"
information (see _notmuch_database_link_message_to_parents).

This patch changes the parse_references() function to return the last
valid Message-ID encountered rather than NULL resulting from the last
hunk of text not being the Message-ID.

[1] https://lkml.org/lkml/headers/2014/5/19/864


No differences found