问题
I want to tie email "threads" together programmatically, specifically gmail and yahoo email "conversations." Is there a way to do this (some kind of link or pointer or "thread ID" contained within an email), or am I stuck with relying on the emailers not changing the text in the "Subject" line?
And besides, that trick would be barely functional at all, as many unrelated threads may have the same subject (such as "[no subject]" etc.).
回答1:
Yes. EMails contain a header (message ID), that is a unique identifier for that email. It conveys no meaning itself, but another header (in-reply-to) that refers to the message Id of the email it is in reply to. almost every email client does a passable job with these and is used by many to provide the threading you refer to.
In addition, you can use the subject plus relative times to allow relative ordering.
Wikipedia has a great article that discusses these, and links you off to the relevant RFCs: http://en.wikipedia.org/wiki/Email#Message_format
来源:https://stackoverflow.com/questions/11622951/is-there-a-way-to-tie-emails-together-other-than-by-the-subject-text