如何准确解析smtp消息状态码(DSN)?

发布于 2024-07-29 20:33:02 字数 1197 浏览 3 评论 0原文

RFC1893 声称状态代码将采用以下格式,您可以在此处阅读更多信息。

但是我们的退回邮件管理系统很难从退回邮件中解析错误状态代码。 我们能够获取原始消息,但根据电子邮件服务器,代码将出现在不同的位置。 是否有关于如何解析此类消息以获得更好结果的规则。 我们不是在寻找 100% 的解决方案,而是至少 80% 的解决方案。

本文档定义了一组新的状态代码来报告邮件系统 状况。 这些状态代码旨在用于媒体和 独立于语言的状态报告。 它们不适合用于 系统特定诊断。

新状态代码的语法 定义为:

 状态代码 = 类“.”   主题 ”。”   细节 
        类别=“2”/“4”/“5” 
        主题 = 1*3 位数字 
        详细信息 = 1*3 位 
  

空白字符和注释 不允许在状态内-
代码。 内的每个数字子代码 状态码必须被表达
没有前导零数字。

上面来自 RFC 的引用说明了一件事,但下面来自跳出管理领先工具的文本说明了不同的情况,我可以在其中获得标准状态代码的良好来源:

返回码说明
0 未确定 - (即收件人回复)
10 硬弹跳 -(即用户未知)
20 软弹跳 - 一般
21 软弹跳 - DNS 故障
22 软弹跳 - 邮箱已满
23 软弹跳 - 消息太大
30 退回 - 没有电子邮件地址。 非常罕见!
40 一般弹跳
50 邮件块 - 一般
51 邮件阻止 - 已知垃圾邮件发送者
52 邮件阻止 - 检测到垃圾邮件
53 邮件阻止 - 检测到附件
54 邮件阻止 - 中继被拒绝
60 自动回复 - (即外出)
70 瞬态弹跳
80 订阅请求
90 取消订阅/删除请求
100 挑战-回应

RFC1893 claims that status codes will come in the format below you can read more here.

But our bounce management system is having a hard time parsing error status code from bounce messages. We are able to get the raw message, but depending on the email server the code will come in different places. Is there any rule on how to parse this type of messages to obtain better results. We are not looking for the 100% solution but at least 80%.

This document defines a new set of status codes to report mail system
conditions. These status codes are intended to be used for media and
language independent status reporting. They are not intended for
system specific diagnostics.

The syntax of the new status codes
is defined as:

      status-code = class "." subject "." detail
      class = "2"/"4"/"5"
      subject = 1*3digit
      detail = 1*3digit

White-space characters and comments
are NOT allowed within a status-
code. Each numeric sub-code within
the status-code MUST be expressed
without leading zero digits.

The quote above from the RFC tells one thing but then the text below from a leading tool on bounce management says something different, where I can get a good source of standard status codes:

Return Code Description
0 UNDETERMINED - (ie. Recipient Reply)
10 HARD BOUNCE - (ie. User Unknown)
20 SOFT BOUNCE - General
21 SOFT BOUNCE - Dns Failure
22 SOFT BOUNCE - Mailbox Full
23 SOFT BOUNCE - Message Too Large
30 BOUNCE - NO EMAIL ADDRESS. VERY RARE!
40 GENERAL BOUNCE
50 MAIL BLOCK - General
51 MAIL BLOCK - Known Spammer
52 MAIL BLOCK - Spam Detected
53 MAIL BLOCK - Attachment Detected
54 MAIL BLOCK - Relay Denied
60 AUTO REPLY - (ie. Out Of Office)
70 TRANSIENT BOUNCE
80 SUBSCRIBE Request
90 UNSUBSCRIBE/REMOVE Request
100 CHALLENGE-RESPONSE

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

陪你到最终 2024-08-05 20:33:02

我不确定这是一个完整的答案,但是 这个算法检测跳出可能会有用。

I'm not sure that it's a full answer, but this algorithm for detecting bounces might be useful.

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