如何安全地识别 DSN(传递状态通知)邮件

发布于 2024-09-07 06:04:21 字数 127 浏览 1 评论 0原文

我正在从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪漫人生路 2024-09-14 06:04:21

某些邮件服务器实施 RFC 3464。那些这样做的通常会生成传递状态通知,其消息头内容类型为 multipart/report 和三个组成部分(text/plain、message/delivery-status 和 message/rfc822)。因此您可以检测消息的这些特征并进行相应的处理。该消息通常如下所示:

发件人:“邮件传送系统”[电子邮件受保护] >
主题:交付状态通知(失败)内容类型:
多部分/报告;报告类型=交货状态

内容类型:text/plain 人类可读的解释
交付状态通知。

Content-Type: 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:

From: "Mail Delivery System" <[email protected]>
Subject: Delivery Status Notification (Failure) Content-Type:
multipart/report; report-type=delivery-status

Content-Type: text/plain A human readable explanation of the
Delivery Status Notification.

Content-Type: message/delivery-status A structured machine readable
reason for the Delivery Status Notification.

Content-Type: message/rfc822 The original message.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文