Apparently In-Reply-To is another possibly important header. http://www.ietf.org/rfc/rfc2822.txt documents in detail what the References and In-Reply-To headers are meant to be, but basically as near as I can figure it:
In-Reply-To: lists the message ids of all the messages this reply is replying to (so whatever message was selected for the “Reply” button, plus any message quoted. Just the former would probably be sufficient.
References: lists the parent’s References header followed by the parent’s message ID.
If you look at ours currently, it looks like this:
Message-ID: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>
In-Reply-To: <topic/96@forum.keyboardmaestro.com>
References: <topic/96@forum.keyboardmaestro.com>
and
Message-ID: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
In-Reply-To: <topic/96@forum.keyboardmaestro.com>
References: <topic/96@forum.keyboardmaestro.com>
which is clearly wrong. The first one was the original PM, so should not have an In-Reply-To or References header, and the second one (the reply, should look like this:
Message-ID: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
In-Reply-To: <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
References: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>
And a reply to that reply should look like this:
Message-ID: <adsassadfdfsdfs_sddfsdfsaererfgdsf@forum.mail>
In-Reply-To: <539a986f8300_5a3fae28acd8c8201e9@forum.mail>
References: <539a986f8300_5a3fae28acd8c8201e9@forum.mail> <539a9904d40bd_5a3fae28d5b8242036d@forum.mail>
Does that help?