简体   繁体   English

我如何解析电子邮件以获取电子邮件的原始收件人?

[英]How I can parse email to get original recipient of an email?

I had email source with me and want parse original recipient of email. 我有电子邮件来源,并希望解析电子邮件的原始收件人。

Lets say "user1@test.com" is receiving a email, but in "To" list user1@test.com, user2@test.com & user3@test.com are mentioned. 假设“user1@test.com”正在接收电子邮件,但在“To”列表中提到了user1@test.com,提到了user2@test.com和user3@test.com。 I want to get only user1 from email source. 我想从电子邮件源只获取user1。

In initial analysis, email from mdeamon server contains "X-MDaemon-Deliver-To:" tag. 在初始分析中,来自mdeamon服务器的电子邮件包含“X-MDaemon-Deliver-To:”标记。 Similarly email from Devcot mail server contains "Delivered-To:". 同样,来自Devcot邮件服务器的电子邮件包含“Delivered-To:”。 But not getting generic parsing logic to get original email recipient. 但是没有获得通用的解析逻辑来获取原始电子邮件收件人。

How I can parse email to get original recipient of an email? 我如何解析电子邮件以获取电子邮件的原始收件人?

The best way to get this information is probably to parse the Received headers to see who the message was delivered for. 获取此信息的最佳方法可能是解析Received标头以查看邮件的发送者。 In other words, look for a Received header that has a for token followed by x@x.com (where x@x.com will be the recipient). 换句话说,查找具有for token后跟x@x.comReceived标头(其中x@x.com将是收件人)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以与我在Windows资源管理器中“发送到邮件收件人”相同的方式以编程方式发送电子邮件? - How do I programmatically send an email in the same way that I can “Send To Mail Recipient” in Windows Explorer? 如何通过指定的电子邮件客户端发送消息? - How can I send a message via a specified email client? 如何获取进程的进程原始文件名? - How can i get process original file name for a process? 如何使用MAPI从配置文件中获取电子邮件地址 - How to get email address from profile with MAPI pthread我可以得到原始参数吗? - pthread can I get the original argument? 如何使用 c++ 代码通过 cmd 发送 email? - How can i send an email through cmd using c++ code? 用户修改后如何使用旧驱动程序中的 PE 标头获取原始文件类型 - how can I get the original file type after user modification using PE header in legacy driver 用c ++发送带附件的邮件? (或者如何构建可以发送到SMTP的MIME编码电子邮件?) - sending mail with attachment in c++? (or How do I construct a MIME encoded email message that I can send to SMTP?) 如何使用C ++ Builder获取电子邮件正文 - How to get Body of the email using c++ builder 我在哪里可以从 Android 框架中获取原始 PCM 数据? - Where can I get the original PCM data from the Android framework?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM