[英]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.com
的Received
标头(其中x@x.com
将是收件人)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.