I am working on a project to retrieve emails from a POP3 mailbox and save those to a database. I would like to find a way I can link original messages to replies so I can relationally show them as a chain. I was going to use subject lines those aren't going to be very reliable as they have the ability to change. Is there anything below the hood that I can use to link a reply message to an original message?
问问题
445 次
2 回答
1
可能有办法。许多 SMTP 服务器在消息中包含两个标头:
- Message-ID : 当前消息的唯一 ID
- In-Reply-To:当前消息正在回复的消息 ID。
您可以按照In-Reply-To标识符链返回到原始消息以找到整个电子邮件线程。
于 2009-04-16T21:47:30.217 回答
0
恐怕主题行是唯一通用的方式。看看GMail,他们就是这样做的,如果主题相同,它可能会被骗成线程不相关的项目。
我认为从 Exchange 发送的电子邮件具有某种线程 ID,但这仅适用于运行 Exchange 的组织内部,并且我怀疑如果邮件来自组织外部,则它是不可靠的。
您可以尝试使用主题进行线程化,并应用一些启发式方法来分隔不相关的项目(例如,具有完全不同收件人的电子邮件将不相关)。但这并不是万无一失的。
于 2009-04-16T21:50:44.827 回答