如何安全地识别 DSN(传递状态通知)邮件
我正在从 POP3 服务器获取电子邮件,并且希望区分常规电子邮件和 DSN(送达状态通知)/NDR(未送达报告/收据)消息。
识别这些消息的最佳/最安全方法是什么?我应该寻找任何特定的消息标头吗?
提前致谢!
I'm fetching emails from a POP3 server and I'd like to make a difference between a regular email and DSN (Delivery Status Notification) / NDR (Non-Delivery Report/Receipt) messages.
What is the best/safest way to identify those messages? Are there any particular message-headers I should be looking for?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
某些邮件服务器实施 RFC 3464。那些这样做的通常会生成传递状态通知,其消息头内容类型为 multipart/report 和三个组成部分(text/plain、message/delivery-status 和 message/rfc822)。因此您可以检测消息的这些特征并进行相应的处理。该消息通常如下所示:
对于那些以非结构化格式生成传递状态通知的邮件服务器,可能仍然需要通过分析 From: 和Subject: 消息标头的文本来检测其通知。
Some mail servers implement RFC 3464. Those that do will typically generate Delivery Status Notifications with a message header Content-Type of multipart/report and three component parts (text/plain, message/delivery-status and message/rfc822). So you could detect those characteristics of the message and process accordingly. The message will generally look like this:
For those mail servers that generate Delivery Status Notifications in an unstructured format, it is probably still necessary to detect their notifications by analysing the text of the From: and Subject: message headers.