]> git.notmuchmail.org Git - notmuch/commit
lib/database.cc: change how the parent of a message is calculated
authorAaron Ecay <aaronecay@gmail.com>
Wed, 6 Mar 2013 03:31:49 +0000 (22:31 -0500)
committerDavid Bremner <bremner@unb.ca>
Tue, 14 May 2013 00:29:13 +0000 (21:29 -0300)
commitcf8aaafbad6815ebdfcd9b3b36cfe3ca5ff2764b
tree55d81c9a7e3b0af3f26f7cec7207a7f11b71ec49
parent983d5e1df2b227b8dfbc71984c828b925f4025f7
lib/database.cc: change how the parent of a message is calculated

Presently, the code which finds the parent of a message as it is being
added to the database assumes that the first Message-ID-like substring
of the In-Reply-To header is the parent Message ID.  Some mail clients,
however, put stuff other than the Message-ID of the parent in the
In-Reply-To header, such as the email address of the sender of the
parent.  This can fool notmuch.

The updated algorithm prefers the last Message ID in the References
header.  The References header lists messages oldest-first, so the last
Message ID is the parent (RFC2822, p. 24).  The References header is
also less likely to be in a non-standard
syntax (http://cr.yp.to/immhf/thread.html,
http://www.jwz.org/doc/threading.html).  In case the References header
is not to be found, fall back to the old behavior.

V2 of this patch, incorporating feedback from Jani and (indirectly)
Austin.
lib/database.cc
test/thread-replies