How messages are organized into thread? [closed]
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
开发者_开发技巧 Improve this questionguys. Can anyone explain how mailing messages are organized into threads? As I understood, messages are sent always to the same email of the group. So there has to be some identifier of thread...
Every Email message has a unique Message-ID
header.
Every reply has an In-Reply-To
and/or References
header.
This is enough to do a topological sort and put the messages into threads.
[update]
For the gory details, see RFC 5322 (the specification for Internet mail messages). Search for "Message-ID", "References", and "In-Reply-To". Strictly speaking, these headers are optional because the spec uses "SHOULD" and not "MUST" when describing them. In practice, I have never seen an Email message that did not include a Message-ID except for spam, and I have never seen a mail client that did not include one or both reply headers in replies.
精彩评论