2

guys. 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...

Konstantin Milyutin
  • 11,946
  • 11
  • 59
  • 85

1 Answers1

3

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.

Community
  • 1
  • 1
Nemo
  • 70,042
  • 10
  • 116
  • 153