sisimai 4.25.16 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -3
  3. data/ANALYTICAL-PRECISION +2 -2
  4. data/Benchmarks.mk +3 -3
  5. data/CONTRIBUTING +1 -1
  6. data/ChangeLog.md +412 -393
  7. data/Developers.mk +5 -6
  8. data/Gemfile +1 -1
  9. data/Makefile +15 -15
  10. data/README-JA.md +140 -78
  11. data/README.md +290 -143
  12. data/Rakefile +9 -3
  13. data/Repository.mk +2 -3
  14. data/lib/sisimai/address.rb +118 -74
  15. data/lib/sisimai/arf.rb +84 -82
  16. data/lib/sisimai/datetime.rb +5 -52
  17. data/lib/sisimai/{data → fact}/json.rb +7 -9
  18. data/lib/sisimai/fact/yaml.rb +31 -0
  19. data/lib/sisimai/fact.rb +468 -0
  20. data/lib/sisimai/lhost/activehunter.rb +12 -14
  21. data/lib/sisimai/lhost/amavis.rb +11 -14
  22. data/lib/sisimai/lhost/amazonses.rb +37 -41
  23. data/lib/sisimai/lhost/amazonworkmail.rb +15 -18
  24. data/lib/sisimai/lhost/aol.rb +12 -14
  25. data/lib/sisimai/lhost/apachejames.rb +19 -21
  26. data/lib/sisimai/lhost/barracuda.rb +10 -12
  27. data/lib/sisimai/lhost/bigfoot.rb +21 -21
  28. data/lib/sisimai/lhost/biglobe.rb +15 -16
  29. data/lib/sisimai/lhost/courier.rb +20 -20
  30. data/lib/sisimai/lhost/domino.rb +23 -19
  31. data/lib/sisimai/lhost/einsundeins.rb +23 -18
  32. data/lib/sisimai/lhost/exchange2003.rb +30 -29
  33. data/lib/sisimai/lhost/exchange2007.rb +70 -58
  34. data/lib/sisimai/lhost/exim.rb +175 -161
  35. data/lib/sisimai/lhost/ezweb.rb +31 -56
  36. data/lib/sisimai/lhost/facebook.rb +21 -33
  37. data/lib/sisimai/lhost/fml.rb +43 -48
  38. data/lib/sisimai/lhost/gmail.rb +29 -29
  39. data/lib/sisimai/lhost/gmx.rb +18 -17
  40. data/lib/sisimai/lhost/googlegroups.rb +9 -10
  41. data/lib/sisimai/lhost/gsuite.rb +21 -27
  42. data/lib/sisimai/lhost/imailserver.rb +25 -39
  43. data/lib/sisimai/lhost/interscanmss.rb +28 -31
  44. data/lib/sisimai/lhost/kddi.rb +22 -28
  45. data/lib/sisimai/lhost/mailfoundry.rb +11 -12
  46. data/lib/sisimai/lhost/mailmarshalsmtp.rb +25 -29
  47. data/lib/sisimai/lhost/mailru.rb +33 -27
  48. data/lib/sisimai/lhost/mcafee.rb +21 -31
  49. data/lib/sisimai/lhost/messagelabs.rb +17 -20
  50. data/lib/sisimai/lhost/messagingserver.rb +40 -37
  51. data/lib/sisimai/lhost/mfilter.rb +15 -16
  52. data/lib/sisimai/lhost/mxlogic.rb +24 -23
  53. data/lib/sisimai/lhost/notes.rb +17 -17
  54. data/lib/sisimai/lhost/office365.rb +63 -27
  55. data/lib/sisimai/lhost/opensmtpd.rb +12 -13
  56. data/lib/sisimai/lhost/outlook.rb +12 -15
  57. data/lib/sisimai/lhost/postfix.rb +179 -129
  58. data/lib/sisimai/lhost/powermta.rb +12 -14
  59. data/lib/sisimai/lhost/qmail.rb +44 -47
  60. data/lib/sisimai/lhost/receivingses.rb +15 -20
  61. data/lib/sisimai/lhost/sendgrid.rb +34 -32
  62. data/lib/sisimai/lhost/sendmail.rb +66 -53
  63. data/lib/sisimai/lhost/surfcontrol.rb +19 -19
  64. data/lib/sisimai/lhost/v5sendmail.rb +45 -39
  65. data/lib/sisimai/lhost/verizon.rb +35 -39
  66. data/lib/sisimai/lhost/x1.rb +18 -17
  67. data/lib/sisimai/lhost/x2.rb +17 -14
  68. data/lib/sisimai/lhost/x3.rb +19 -19
  69. data/lib/sisimai/lhost/x4.rb +72 -57
  70. data/lib/sisimai/lhost/x5.rb +17 -19
  71. data/lib/sisimai/lhost/x6.rb +41 -17
  72. data/lib/sisimai/lhost/yahoo.rb +17 -16
  73. data/lib/sisimai/lhost/yandex.rb +16 -20
  74. data/lib/sisimai/lhost/zoho.rb +16 -15
  75. data/lib/sisimai/lhost.rb +8 -10
  76. data/lib/sisimai/mail/maildir.rb +1 -3
  77. data/lib/sisimai/mail/mbox.rb +3 -4
  78. data/lib/sisimai/mail/memory.rb +0 -1
  79. data/lib/sisimai/mail/stdin.rb +1 -3
  80. data/lib/sisimai/mail.rb +3 -7
  81. data/lib/sisimai/mda.rb +28 -42
  82. data/lib/sisimai/message.rb +435 -326
  83. data/lib/sisimai/order.rb +5 -5
  84. data/lib/sisimai/reason/authfailure.rb +64 -0
  85. data/lib/sisimai/reason/badreputation.rb +53 -0
  86. data/lib/sisimai/reason/blocked.rb +94 -160
  87. data/lib/sisimai/reason/contenterror.rb +8 -9
  88. data/lib/sisimai/reason/delivered.rb +4 -6
  89. data/lib/sisimai/reason/exceedlimit.rb +10 -12
  90. data/lib/sisimai/reason/expired.rb +6 -8
  91. data/lib/sisimai/reason/feedback.rb +2 -3
  92. data/lib/sisimai/reason/filtered.rb +17 -19
  93. data/lib/sisimai/reason/hasmoved.rb +9 -10
  94. data/lib/sisimai/reason/hostunknown.rb +15 -15
  95. data/lib/sisimai/reason/mailboxfull.rb +10 -12
  96. data/lib/sisimai/reason/mailererror.rb +18 -20
  97. data/lib/sisimai/reason/mesgtoobig.rb +9 -11
  98. data/lib/sisimai/reason/networkerror.rb +5 -8
  99. data/lib/sisimai/reason/norelaying.rb +8 -11
  100. data/lib/sisimai/reason/notaccept.rb +13 -14
  101. data/lib/sisimai/reason/notcompliantrfc.rb +43 -0
  102. data/lib/sisimai/reason/onhold.rb +6 -9
  103. data/lib/sisimai/reason/policyviolation.rb +14 -12
  104. data/lib/sisimai/reason/rejected.rb +26 -24
  105. data/lib/sisimai/reason/requireptr.rb +69 -0
  106. data/lib/sisimai/reason/securityerror.rb +33 -36
  107. data/lib/sisimai/reason/spamdetected.rb +114 -147
  108. data/lib/sisimai/reason/speeding.rb +49 -0
  109. data/lib/sisimai/reason/suspend.rb +11 -11
  110. data/lib/sisimai/reason/syntaxerror.rb +11 -10
  111. data/lib/sisimai/reason/systemerror.rb +7 -9
  112. data/lib/sisimai/reason/systemfull.rb +7 -8
  113. data/lib/sisimai/reason/toomanyconn.rb +9 -11
  114. data/lib/sisimai/reason/undefined.rb +2 -3
  115. data/lib/sisimai/reason/userunknown.rb +129 -146
  116. data/lib/sisimai/reason/vacation.rb +3 -4
  117. data/lib/sisimai/reason/virusdetected.rb +10 -11
  118. data/lib/sisimai/reason.rb +59 -64
  119. data/lib/sisimai/rfc1894.rb +55 -28
  120. data/lib/sisimai/rfc2045.rb +373 -0
  121. data/lib/sisimai/rfc3464.rb +250 -308
  122. data/lib/sisimai/rfc3834.rb +42 -45
  123. data/lib/sisimai/rfc5322.rb +75 -100
  124. data/lib/sisimai/rfc5965.rb +31 -0
  125. data/lib/sisimai/rhost/cox.rb +5 -6
  126. data/lib/sisimai/rhost/franceptt.rb +6 -8
  127. data/lib/sisimai/rhost/godaddy.rb +12 -12
  128. data/lib/sisimai/rhost/{googleapps.rb → google.rb} +80 -72
  129. data/lib/sisimai/rhost/iua.rb +9 -10
  130. data/lib/sisimai/rhost/kddi.rb +6 -8
  131. data/lib/sisimai/rhost/{exchangeonline.rb → microsoft.rb} +115 -114
  132. data/lib/sisimai/rhost/mimecast.rb +42 -40
  133. data/lib/sisimai/rhost/nttdocomo.rb +12 -12
  134. data/lib/sisimai/rhost/spectrum.rb +10 -12
  135. data/lib/sisimai/rhost/{tencentqq.rb → tencent.rb} +7 -8
  136. data/lib/sisimai/rhost.rb +23 -31
  137. data/lib/sisimai/smtp/command.rb +59 -0
  138. data/lib/sisimai/smtp/error.rb +4 -7
  139. data/lib/sisimai/smtp/reply.rb +161 -74
  140. data/lib/sisimai/smtp/status.rb +504 -393
  141. data/lib/sisimai/smtp/transcript.rb +124 -0
  142. data/lib/sisimai/smtp.rb +0 -1
  143. data/lib/sisimai/string.rb +74 -5
  144. data/lib/sisimai/time.rb +1 -2
  145. data/lib/sisimai/version.rb +1 -1
  146. data/lib/sisimai.rb +35 -21
  147. data/set-of-emails/maildir/bsd/lhost-domino-02.eml +6 -3
  148. data/set-of-emails/maildir/bsd/lhost-googlegroups-15.eml +174 -0
  149. data/set-of-emails/maildir/bsd/lhost-gsuite-15.eml +229 -0
  150. data/set-of-emails/maildir/bsd/lhost-postfix-75.eml +51 -0
  151. data/set-of-emails/maildir/bsd/lhost-postfix-76.eml +101 -0
  152. data/set-of-emails/maildir/bsd/lhost-postfix-77.eml +74 -0
  153. data/set-of-emails/maildir/bsd/lhost-postfix-78.eml +91 -0
  154. data/set-of-emails/maildir/bsd/lhost-receivingses-08.eml +88 -0
  155. data/set-of-emails/maildir/bsd/rfc3464-43.eml +88 -0
  156. data/set-of-emails/maildir/bsd/rhost-google-03.eml +101 -0
  157. data/set-of-emails/maildir/bsd/rhost-google-04.eml +102 -0
  158. data/set-of-emails/maildir/bsd/rhost-google-05.eml +82 -0
  159. data/set-of-emails/maildir/bsd/rhost-google-06.eml +102 -0
  160. data/set-of-emails/maildir/bsd/rhost-google-07.eml +69 -0
  161. data/set-of-emails/maildir/bsd/rhost-google-08.eml +99 -0
  162. data/sisimai-java.gemspec +1 -1
  163. data/sisimai.gemspec +1 -1
  164. metadata +41 -20
  165. data/.rspec +0 -2
  166. data/lib/sisimai/data/yaml.rb +0 -33
  167. data/lib/sisimai/data.rb +0 -411
  168. data/lib/sisimai/mime.rb +0 -456
  169. /data/set-of-emails/maildir/bsd/{rfc3464-41.eml → rfc3834-05.eml} +0 -0
  170. /data/set-of-emails/maildir/bsd/{rhost-googleapps-01.eml → rhost-google-01.eml} +0 -0
  171. /data/set-of-emails/maildir/bsd/{rhost-googleapps-02.eml → rhost-google-02.eml} +0 -0
  172. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-01.eml → rhost-microsoft-01.eml} +0 -0
  173. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-02.eml → rhost-microsoft-02.eml} +0 -0
  174. /data/set-of-emails/maildir/bsd/{rhost-exchangeonline-03.eml → rhost-microsoft-03.eml} +0 -0
  175. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-01.eml → rhost-tencent-01.eml} +0 -0
  176. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-02.eml → rhost-tencent-02.eml} +0 -0
  177. /data/set-of-emails/maildir/bsd/{rhost-tencentqq-03.eml → rhost-tencent-03.eml} +0 -0
@@ -1,514 +1,455 @@
1
1
  # http://www.iana.org/assignments/smtp-enhanced-status-codes/smtp-enhanced-status-codes.xhtml
2
- #
3
- # ------------------------------------------------------------------------------
2
+ # -------------------------------------------------------------------------------------------------
4
3
  # [Class Sub-Codes]
5
4
  # 2.X.Y Success
6
5
  # 4.X.Y Persistent Transient Failure
7
6
  # 5.X.Y Permanent Failure
8
7
  #
9
- # ------------------------------------------------------------------------------
8
+ # -------------------------------------------------------------------------------------------------
10
9
  # [Subject Sub-Codes]
11
- #
12
10
  # X.0.X --- Other or Undefined Status
13
11
  # There is no additional subject information available.
14
12
  #
15
13
  # X.1.X --- Addressing Status
16
- # The address status reports on the originator or destination address.
17
- # It may include address syntax or validity.
18
- # These errors can generally be corrected by the sender and retried.
14
+ # The address status reports on the originator or destination address. It may include
15
+ # address syntax or validity. These errors can generally be corrected by the sender and
16
+ # retried.
19
17
  #
20
18
  # X.2.X --- Mailbox Status
21
- # Mailbox status indicates that something having to do with the mailbox
22
- # has caused this DSN. Mailbox issues are assumed to be under the general
23
- # control of the recipient.
19
+ # Mailbox status indicates that something having to do with the mailbox has caused this
20
+ # DSN. Mailbox issues are assumed to be under the general control of the recipient.
24
21
  #
25
22
  # X.3.X --- Mail System Status
26
- # Mail system status indicates that something having to do with the
27
- # destination system has caused this DSN. System issues are assumed to
28
- # be under the general control of the destination system administrator.
23
+ # Mail system status indicates that something having to do with the destination system
24
+ # has caused this DSN. System issues are assumed to be under the general control of the
25
+ # destination system administrator.
29
26
  #
30
27
  # X.4.X --- Network and Routing Status
31
- # The networking or routing codes report status about the delivery
32
- # system itself. These system components include any necessary
33
- # infrastructure such as directory and routing services. Network issues
34
- # are assumed to be under the control of the destination or intermediate
35
- # system administrator.
28
+ # The networking or routing codes report status about the delivery system itself. These
29
+ # system components include any necessary infrastructure such as directory and routing
30
+ # services. Network issues are assumed to be under the control of the destination or
31
+ # intermediate system administrator.
36
32
  #
37
33
  # X.5.X --- Mail Delivery Protocol Status
38
- # The mail delivery protocol status codes report failures involving
39
- # the message delivery protocol. These failures include the full range
40
- # of problems resulting from implementation errors or an unreliable
41
- # connection.
34
+ # The mail delivery protocol status codes report failures involving the message delivery
35
+ # protocol. These failures include the full range of problems resulting from
36
+ # implementation errors or an unreliable connection.
42
37
  #
43
38
  # X.6.X --- Message Content or Media Status
44
- # The message content or media status codes report failures involving
45
- # the content of the message. These codes report failures due to
46
- # translation, transcoding, or otherwise unsupported message media.
47
- # Message content or media issues are under the control of both the
48
- # sender and the receiver, both of which must support a common set of
49
- # supported content-types.
39
+ # The message content or media status codes report failures involving the content of the
40
+ # message. These codes report failures due to translation, transcoding, or otherwise
41
+ # unsupported message media. Message content or media issues are under the control of both
42
+ # the sender and the receiver, both of which must support a common set of supported
43
+ # content-types.
50
44
  #
51
45
  # X.7.X --- Security or Policy Status
52
- # The security or policy status codes report failures involving policies
53
- # such as per-recipient or per-host filtering and cryptographic operations.
54
- # Security and policy status issues are assumed to be under the control
55
- # of either or both the sender and recipient.
56
- # Both the sender and recipient must permit the exchange of messages
57
- # and arrange the exchange of necessary keys and certificates for
58
- # cryptographic operations.
59
- #
60
- # ------------------------------------------------------------------------------
61
- # [Enumerated Status Codes]
46
+ # The security or policy status codes report failures involving policies such as
47
+ # per-recipient or per-host filtering and cryptographic operations. Security and policy
48
+ # status issues are assumed to be under the control of either or both the sender and
49
+ # recipient. Both the sender and recipient must permit the exchange of messages and
50
+ # arrange the exchange of necessary keys and certificates for cryptographic operations.
62
51
  #
52
+ # -------------------------------------------------------------------------------------------------
53
+ # [Enumerated Status Codes]
63
54
  # X.0.0 Any Other undefined Status:(RFC 3463)
64
- # Other undefined status is the only undefined error code. It
65
- # should be used for all errors for which only the class of the
66
- # error is known.
55
+ # Other undefined status is the only undefined error code. It should be used for all
56
+ # errors for which only the class of the error is known.
67
57
  #
68
58
  # X.1.0 --- Other address status:(RFC 3463)
69
- # Something about the address specified in the message caused
70
- # this DSN.
59
+ # Something about the address specified in the message caused this DSN.
71
60
  #
72
61
  # X.1.1 451 Bad destination mailbox address:(RFC3463)
73
- # 550 The mailbox specified in the address does not exist.
74
- # For Internet mail names, this means the address portion to the
75
- # the left of the "@" sign is invalid.
76
- # This code is only useful for permanent failures.
62
+ # 550 The mailbox specified in the address does not exist. For Internet mail names, this
63
+ # means the address portion to the the left of the "@" sign is invalid. This code is
64
+ # only useful for permanent failures.
77
65
  #
78
66
  # X.1.2 --- Bad destination system addres:
79
- # The destination system specified in the address does not exist
80
- # or is incapable of accepting mail. For Internet mail names,
81
- # this means the address portion to the right of the "@" is
82
- # invalid for mail.
83
- # This code is only useful for permanent failures.
67
+ # The destination system specified in the address does not exist or is incapable of
68
+ # accepting mail. For Internet mail names, this means the address portion to the
69
+ # right of the "@" is invalid for mail. This code is only useful for permanent
70
+ # failures.
84
71
  #
85
72
  # X.1.3 501 Bad destination mailbox address syntax:
86
- # The destination address was syntactically invalid. This can
87
- # apply to any field in the address. This code is only useful
88
- # for permanent failures.
73
+ # The destination address was syntactically invalid. This can apply to any field in
74
+ # the address. This code is only useful for permanent failures.
89
75
  #
90
76
  # X.1.4 --- Destination mailbox address ambiguous:(RFC 3463)
91
- # The mailbox address as specified matches one or more recipients
92
- # on the destination system.
93
- # This may result if a heuristic address mapping algorithm is
94
- # used to map the specified address to a local mailbox name.
77
+ # The mailbox address as specified matches one or more recipients on the destination
78
+ # system. This may result if a heuristic address mapping algorithm is used to map
79
+ # the specified address to a local mailbox name.
95
80
  #
96
81
  # X.1.5 250 Destination address valid:(RFC 3463)
97
- # This mailbox address as specified was valid. This status code
98
- # should be used for positive delivery reports.
82
+ # This mailbox address as specified was valid. This status code should be used for
83
+ # positive delivery reports.
99
84
  #
100
85
  # X.1.6 --- Destination mailbox has moved, No forwarding address:(RFC 3463)
101
- # The mailbox address provided was at one time valid, but mail
102
- # is no longer being accepted for that address.
103
- # This code is only useful for permanent failures.
86
+ # The mailbox address provided was at one time valid, but mail is no longer being
87
+ # accepted for that address. This code is only useful for permanent failures.
104
88
  #
105
89
  # X.1.7 --- Bad sender's mailbox address syntax:(RFC 3463)
106
- # The sender's address was syntactically invalid. This can apply
107
- # to any field in the address.
90
+ # The sender's address was syntactically invalid. This can apply to any field in
91
+ # the address.
108
92
  #
109
93
  # X.1.8 451 Bad sender's system address:(RFC 3463)
110
- # 501 The sender's system specified in the address does not exist or
111
- # is incapable of accepting return mail. For domain names, this
112
- # means the address portion to the right of the "@" is invalid
113
- # for mail.
94
+ # 501 The sender's system specified in the address does not exist or is incapable of
95
+ # accepting return mail. For domain names, this means the address portion to the
96
+ # right of the "@" is invalid for mail.
114
97
  #
115
98
  # X.1.9 --- Message relayed to non-compliant mailer:(RFC 5248, 3886)
116
- # The mailbox address specified was valid, but the message has
117
- # been relayed to a system that does not speak this protocol;
118
- # no further information can be provided.
99
+ # The mailbox address specified was valid, but the message has been relayed to a
100
+ # system that does not speak this protocol; no further information can be provided.
119
101
  #
120
102
  # X.1.10 --- Recipient address has null MX:(RFC 7505)
121
- # This status code is returned when the associated address is
122
- # marked as invalid using a null MX.
123
- # ------------------------------------------------------------------------------
103
+ # This status code is returned when the associated address is marked as invalid
104
+ # using a null MX.
105
+ # -------------------------------------------------------------------------------------------------
124
106
  # X.2.0 --- Other or undefined mailbox status:(RFC 3463)
125
- # The mailbox exists, but something about the destination mailbox
126
- # has caused the sending of this DSN.
107
+ # The mailbox exists, but something about the destination mailbox has caused the
108
+ # sending of this DSN.
127
109
  #
128
110
  # X.2.1 --- Mailbox disabled, not accepting messages:(RFC 3463)
129
- # The mailbox exists, but is not accepting messages. This may be
130
- # a permanent error if the mailbox will never be re-enabled or a
131
- # transient error if the mailbox is only temporarily disabled.
111
+ # The mailbox exists, but is not accepting messages. This may be a permanent error
112
+ # if the mailbox will never be re-enabled or a transient error if the mailbox is
113
+ # only temporarily disabled.
132
114
  #
133
115
  # X.2.2 552 Mailbox full:(RFC 3463)
134
- # The mailbox is full because the user has exceeded a per-mailbox
135
- # administrative quota or physical capacity. The general semantics
136
- # implies that the recipient can delete messages to make more
137
- # space available.
138
- # This code should be used as a persistent transient failure.
116
+ # The mailbox is full because the user has exceeded a per-mailbox administrative
117
+ # quota or physical capacity. The general semantics implies that the recipient can
118
+ # delete messages to make more space available. This code should be used as a
119
+ # persistent transient failure.
139
120
  #
140
121
  # X.2.3 552 Message length exceeds administrative limit:(RFC 3463)
141
- # A per-mailbox administrative message length limit has been
142
- # exceeded. This status code should be used when the per-mailbox
143
- # message length limit is less than the general system limit.
144
- # This code should be used as a permanent failure.
122
+ # A per-mailbox administrative message length limit has been exceeded. This status
123
+ # code should be used when the per-mailbox message length limit is less than the
124
+ # general system limit. This code should be used as a permanent failure.
145
125
  #
146
126
  # X.2.4 450 Mailing list expansion problem:(RFC 3463)
147
- # 452 The mailbox is a mailing list address and the mailing list was
148
- # unable to be expanded. This code may represent a permanent
149
- # failure or a persistent transient failure.
150
- # ------------------------------------------------------------------------------
127
+ # 452 The mailbox is a mailing list address and the mailing list was unable to be
128
+ # expanded. This code may represent a permanent failure or a persistent transient
129
+ # failure.
130
+ # -------------------------------------------------------------------------------------------------
151
131
  # X.3.0 221 Other or undefined mail system status:(RFC 3463)
152
- # 250 The destination system exists and normally accepts mail, but
153
- # 421,451 something about the system has caused the generation of this
154
- # 550,554 DSN.
132
+ # 250 The destination system exists and normally accepts mail, but something about the
133
+ # 421,451 system has caused the generation of this DSN.
134
+ # 550,554
155
135
  #
156
136
  # X.3.1 452 Mail system full:(RFC 3463)
157
- # Mail system storage has been exceeded. The general semantics
158
- # imply that the individual recipient may not be able to delete
159
- # material to make room for additional messages. This is useful
160
- # only as a persistent transient error.
137
+ # Mail system storage has been exceeded. The general semantics imply that the
138
+ # individual recipient may not be able to delete material to make room for
139
+ # additional messages. This is useful only as a persistent transient error.
161
140
  #
162
141
  # X.3.2 453 System not accepting network messages:(RFC 3463)
163
- # 521 The host on which the mailbox is resident is not accepting messages.
164
- # Examples of such conditions include an imminent shutdown, excessive
165
- # load, or system maintenance. This is useful for both permanent
166
- # and persistent transient errors.
142
+ # 521 The host on which the mailbox is resident is not accepting messages. Examples of
143
+ # such conditions include an imminent shutdown, excessive load, or system
144
+ # maintenance. This is useful for both permanent and persistent transient errors.
167
145
  #
168
146
  # X.3.3 --- System not capable of selected features:(RFC 3463)
169
- # Selected features specified for the message are not supported
170
- # by the destination system. This can occur in gateways when
171
- # features from one domain cannot be mapped onto the supported
172
- # feature in another.
147
+ # Selected features specified for the message are not supported by the destination
148
+ # system. This can occur in gateways when features from one domain cannot be mapped
149
+ # onto the supported feature in another.
173
150
  #
174
151
  # X.3.4 552 Message too big for system:(RFC 3463)
175
- # 554 The message is larger than per-message size limit. This limit
176
- # may either be for physical or administrative reasons. This is
177
- # useful only as a permanent error.
152
+ # 554 The message is larger than per-message size limit. This limit may either be for
153
+ # physical or administrative reasons. This is useful only as a permanent error.
178
154
  #
179
155
  # X.3.5 --- System incorrectly configured:(RFC 3463)
180
- # The system is not configured in a manner that will permit it
181
- # to accept this message.
182
- # ------------------------------------------------------------------------------
156
+ # The system is not configured in a manner that will permit it to accept this
157
+ # message.
158
+ # -------------------------------------------------------------------------------------------------
183
159
  # X.4.0 --- Other or undefined network or routing status:(RFC 3463)
184
- # Something went wrong with the networking, but it is not clear
185
- # what the problem is, or the problem cannot be well expressed
186
- # with any of the other provided detail codes.
160
+ # Something went wrong with the networking, but it is not clear what the problem is,
161
+ # or the problem cannot be well expressed with any of the other provided detail
162
+ # codes.
187
163
  #
188
164
  # X.4.1 451 No answer from host:(RFC 3463)
189
- # The outbound connection attempt was not answered, because either
190
- # the remote system was busy, or was unable to take a call.
191
- # This is useful only as a persistent transient error.
165
+ # The outbound connection attempt was not answered, because either the remote system
166
+ # was busy, or was unable to take a call. This is useful only as a persistent
167
+ # transient error.
192
168
  #
193
169
  # X.4.2 421 Bad connection:(RFC 3463)
194
- # The outbound connection was established, but was unable to
195
- # complete the message transaction, either because of time-out,
196
- # or inadequate connection quality. This is useful only as a
197
- # persistent transient error.
170
+ # The outbound connection was established, but was unable to complete the message
171
+ # transaction, either because of time-out, or inadequate connection quality. This
172
+ # is useful only as a persistent transient error.
198
173
  #
199
174
  # X.4.3 451 Directory server failure:(RFC 3463)
200
- # 550 The network system was unable to forward the message, because
201
- # a directory server was unavailable. This is useful only as a
202
- # persistent transient error. The inability to connect to an
203
- # Internet DNS server is one example of the directory server
204
- # failure error.
175
+ # 550 The network system was unable to forward the message, because a directory server
176
+ # was unavailable. This is useful only as a persistent transient error. The
177
+ # inability to connect to an Internet DNS server is one example of the directory
178
+ # server failure error.
205
179
  #
206
180
  # X.4.4 --- Unable to route:(RFC 3463)
207
- # The mail system was unable to determine the next hop for the
208
- # message because the necessary routing information was unavailable
209
- # from the directory server. This is useful for both permanent
210
- # and persistent transient errors. A DNS lookup returning only
211
- # an SOA (Start of Administration) record for a domain name is
212
- # one example of the unable to route error.
181
+ # The mail system was unable to determine the next hop for the message because the
182
+ # necessary routing information was unavailable from the directory server. This is
183
+ # useful for both permanent and persistent transient errors. A DNS lookup returning
184
+ # only an SOA (Start of Administration) record for a domain name is one example of
185
+ # the unable to route error.
213
186
  #
214
187
  # X.4.5 451 Mail system congestion:(RFC 3463)
215
- # The mail system was unable to deliver the message because the
216
- # mail system was congested. This is useful only as a persistent
217
- # transient error.
188
+ # The mail system was unable to deliver the message because the mail system was
189
+ # congested. This is useful only as a persistent transient error.
218
190
  #
219
191
  # X.4.6 --- Routing loop detected:(RFC 3463)
220
- # A routing loop caused the message to be forwarded too many times,
221
- # either because of incorrect routing tables or a user-forwarding
222
- # loop. This is useful only as a persistent transient error.
192
+ # A routing loop caused the message to be forwarded too many times, either because
193
+ # of incorrect routing tables or a user-forwarding loop. This is useful only as a
194
+ # persistent transient error.
223
195
  #
224
196
  # X.4.7 --- Delivery time expired:(RFC 3463)
225
- # The message was considered too old by the rejecting system,
226
- # either because it remained on that host too long or because
227
- # the time-to-live value specified by the sender of the message
228
- # was exceeded. If possible, the code for the actual problem
229
- # found when delivery was attempted should be returned rather
230
- # than this code.
231
- # ------------------------------------------------------------------------------
197
+ # The message was considered too old by the rejecting system, either because it
198
+ # remained on that host too long or because the time-to-live value specified by the
199
+ # sender of the message was exceeded. If possible, the code for the actual problem
200
+ # found when delivery was attempted should be returned rather than this code.
201
+
202
+ # X.4.8 421 Retry on IPv4
203
+ # 451 the mail system will not accept this message over IPv6 because it lacks some re-
204
+ # 456 quirments described in the full text of the rejection, however the sending mail
205
+ # system can retry immediately to submit the message over IPv4 only.
206
+ # https://datatracker.ietf.org/doc/html/draft-martin-smtp-ipv6-to-ipv4-fallback-00
207
+ #
208
+ # -------------------------------------------------------------------------------------------------
232
209
  # X.5.0 220 Other or undefined protocol status:(RFC 3463)
233
- # 250-253 Something was wrong with the protocol necessary to deliver the
234
- # 451,452 message to the next hop and the problem cannot be well expressed
235
- # 454,458 with any of the other provided detail codes.
210
+ # 250-253 Something was wrong with the protocol necessary to deliver the message to the next
211
+ # 451,452 hop and the problem cannot be well expressed with any of the other provided detail
212
+ # 454,458 codes.
236
213
  # 459,554
237
214
  # 501-503
238
215
  #
239
216
  # X.5.1 430 Invalid command:(RFC 3463)
240
- # 500,501 A mail transaction protocol command was issued which was either
241
- # 503,530 out of sequence or unsupported.
242
- # 550,554 This is useful only as a permanent error.
217
+ # 500,501 A mail transaction protocol command was issued which was either out of sequence
218
+ # 503,530 or unsupported. This is useful only as a permanent error.
219
+ # 550,554
243
220
  # 555
244
221
  #
245
222
  # X.5.2 500 Syntax error:(RFC 3463)
246
- # 500,501 A mail transaction protocol command was issued which could not
247
- # 502,550 be interpreted, either because the syntax was wrong or the
248
- # 555 command is unrecognized.
249
- # This is useful only as a permanent error.
223
+ # 500,501 A mail transaction protocol command was issued which could not be interpreted,
224
+ # 502,550 either because the syntax was wrong or the command is unrecognized. This is useful
225
+ # 555 only as a permanent error.
250
226
  #
251
227
  # X.5.3 451 Too many recipients:(RFC 3463)
252
- # More recipients were specified for the message than could have
253
- # been delivered by the protocol. This error should normally result
254
- # in the segmentation of the message into two, the remainder of
255
- # the recipients to be delivered on a subsequent delivery attempt.
256
- # It is included in this list in the event that such segmentation
257
- # is not possible.
228
+ # More recipients were specified for the message than could have been delivered by
229
+ # the protocol. This error should normally result in the segmentation of the message
230
+ # into two, the remainder of the recipients to be delivered on a subsequent delivery
231
+ # attempt. It is included in this list in the event that such segmentation is not
232
+ # possible.
258
233
  #
259
234
  # X.5.4 451 Invalid command arguments:(RFC 3463)
260
- # 501-504 A valid mail transaction protocol command was issued with
261
- # 550 invalid arguments, either because the arguments were out of
262
- # 555 range or represented unrecognized features.
263
- # This is useful only as a permanent error.
235
+ # 501-504 A valid mail transaction protocol command was issued with invalid arguments,
236
+ # 550 either because the arguments were out of range or represented unrecognized
237
+ # 555 features. This is useful only as a permanent error.
264
238
  #
265
239
  # X.5.5 --- Wrong protocol version:(RFC 3463)
266
- # A protocol version mis-match existed which could not be
267
- # automatically resolved by the communicating parties.
240
+ # A protocol version mis-match existed which could not be automatically resolved by
241
+ # the communicating parties.
268
242
  #
269
243
  # X.5.6 550 Authentication Exchange line is too long (RFC 4954)
270
- # This enhanced status code SHOULD be returned when the server
271
- # fails the AUTH command due to the client sending a [BASE64]
272
- # response which is longer than the maximum buffer size available
273
- # for the currently selected SASL mechanism. This is useful for
274
- # both permanent and persistent transient errors.
275
- # ------------------------------------------------------------------------------
244
+ # This enhanced status code SHOULD be returned when the server fails the AUTH
245
+ # command due to the client sending a [BASE64] response which is longer than the
246
+ # maximum buffer size available for the currently selected SASL mechanism. This is
247
+ # useful for both permanent and persistent transient errors.
248
+ # -------------------------------------------------------------------------------------------------
276
249
  # X.6.0 --- Other or undefined media error:(RFC 3463)
277
- # Something about the content of a message caused it to be considered
278
- # undeliverable and the problem cannot be well expressed with
279
- # any of the other provided detail codes.
250
+ # Something about the content of a message caused it to be considered undeliverable
251
+ # and the problem cannot be well expressed with any of the other provided detail
252
+ # codes.
280
253
  #
281
254
  # X.6.1 --- Media not supported:(RFC 3463)
282
- # The media of the message is not supported by either the delivery
283
- # protocol or the next system in the forwarding path. This is
284
- # useful only as a permanent error.
255
+ # The media of the message is not supported by either the delivery protocol or the
256
+ # next system in the forwarding path. This is useful only as a permanent error.
285
257
  #
286
258
  # X.6.2 --- Conversion required and prohibited:(RFC 3463)
287
- # The content of the message must be converted before it can be
288
- # delivered and such conversion is not permitted. Such prohibitions
289
- # may be the expression of the sender in the message itself or
290
- # the policy of the sending host.
259
+ # The content of the message must be converted before it can be delivered and such
260
+ # conversion is not permitted. Such prohibitions may be the expression of the sender
261
+ # in the message itself or the policy of the sending host.
291
262
  #
292
263
  # X.6.3 554 Conversion required but not supported:(RFC 3463)
293
- # The message content must be converted in order to be forwarded
294
- # but such conversion is not possible or is not practical by a
295
- # host in the forwarding path. This condition may result when
296
- # an ESMTP gateway supports 8bit transport but is not able to
297
- # downgrade the message to 7 bit as required for the next hop.
264
+ # The message content must be converted in order to be forwarded but such conversion
265
+ # is not possible or is not practical by a host in the forwarding path. This
266
+ # condition may result when an ESMTP gateway supports 8bit transport but is not able
267
+ # to downgrade the message to 7 bit as required for the next hop.
298
268
  #
299
269
  # X.6.4 250 Conversion with loss performed:(RFC 3463)
300
- # This is a warning sent to the sender when message delivery was
301
- # successfully but when the delivery required a conversion in
302
- # which some data was lost. This may also be a permanent error
303
- # if the sender has indicated that conversion with loss is
270
+ # This is a warning sent to the sender when message delivery was successfully but
271
+ # when the delivery required a conversion in which some data was lost. This may also
272
+ # be a permanent error if the sender has indicated that conversion with loss is
304
273
  # prohibited for the message.
305
274
  #
306
275
  # X.6.5 --- Conversion Failed:(RFC 3463)
307
- # A conversion was required but was unsuccessful. This may be
308
- # useful as a permanent or persistent temporary notification.
276
+ # A conversion was required but was unsuccessful. This may be useful as a permanent
277
+ # or persistent temporary notification.
309
278
  #
310
279
  # X.6.6 554 Message content not available (RFC 4468)
311
- # The message content could not be fetched from a remote system.
312
- # This may be useful as a permanent or persistent temporary
313
- # notification.
280
+ # The message content could not be fetched from a remote system. This may be useful
281
+ # as a permanent or persistent temporary notification.
314
282
  #
315
283
  # X.6.7 553 The ALT-ADDRESS is required but not specified:(RFC 6531)
316
- # 550 This indicates the reception of a MAIL or RCPT command that
317
- # non-ASCII addresses are not permitted
284
+ # 550 This indicates the reception of a MAIL or RCPT command that non-ASCII addresses
285
+ # are not permitted
318
286
  #
319
287
  # X.6.8 252 UTF-8 string reply is required, but not permitted by the client:(RFC 6531)
320
- # 553 This indicates that a reply containing a UTF-8 string is required
321
- # 550 to show the mailbox name, but that form of response is not permitted
322
- # by the SMTP client.
288
+ # 553 This indicates that a reply containing a UTF-8 string is required to show the
289
+ # 550 mailbox name, but that form of response is not permitted by the SMTP client.
323
290
  #
324
291
  # X.6.9 550 UTF8SMTP downgrade failed:(RFC 6531)
325
- # This indicates that transaction failed after the final "." of
326
- # the DATA command.
292
+ # This indicates that transaction failed after the final "." of the DATA command.
327
293
  #
328
294
  # X.6.10 This is a duplicate of X.6.8 and is thus deprecated.
329
- # ------------------------------------------------------------------------------
295
+ # -------------------------------------------------------------------------------------------------
330
296
  # X.7.0 220 Other or undefined security status:(RFC 3463)
331
- # 235 Something related to security caused the message to be returned,
332
- # 450,454 and the problem cannot be well expressed with any of the other
333
- # 500,501 provided detail codes. This status code may also be used when
334
- # 503,504 the condition cannot be further described because of security
335
- # 530,535 policies in force.
297
+ # 235 Something related to security caused the message to be returned, and the problem
298
+ # 450,454 cannot be well expressed with any of the other provided detail codes. This status
299
+ # 500,501 code may also be used when the condition cannot be further described because of
300
+ # 503,504 security policies in force.
301
+ # 530,535
336
302
  # 550
337
303
  #
338
304
  # X.7.1 451 Delivery not authorized, message refused:(RFC 3463)
339
- # 454,502 The sender is not authorized to send to the destination. This
340
- # 503,533 can be the result of per-host or per-recipient filtering. This
341
- # 550,551 memo does not discuss the merits of any such filtering, but
342
- # provides a mechanism to report such. This is useful only as
343
- # a permanent error.
305
+ # 454,502 The sender is not authorized to send to the destination. This can be the result
306
+ # 503,533 of per-host or per-recipient filtering. This memo does not discuss the merits of
307
+ # 550,551 any such filtering, but provides a mechanism to report such. This is useful only
308
+ # as a permanent error.
344
309
  #
345
310
  # X.7.2 550 Mailing list expansion prohibited:(RFC 3463)
346
- # The sender is not authorized to send a message to the intended
347
- # mailing list. This is useful only as a permanent error.
311
+ # The sender is not authorized to send a message to the intended mailing list. This
312
+ # is useful only as a permanent error.
348
313
  #
349
314
  # X.7.3 --- Security conversion required but not possible:(RFC 3463)
350
- # A conversion from one secure messaging protocol to another was
351
- # required for delivery and such conversion was not possible.
352
- # This is useful only as a permanent error.
315
+ # A conversion from one secure messaging protocol to another was required for
316
+ # delivery and such conversion was not possible. This is useful only as a permanent
317
+ # error.
353
318
  #
354
319
  # X.7.4 504 Security features not supported:(RFC 3463)
355
- # A message contained security features such as secure authentication
356
- # that could not be supported on the delivery protocol. This is
357
- # useful only as a permanent error.
320
+ # A message contained security features such as secure authentication that could not
321
+ # be supported on the delivery protocol. This is useful only as a permanent error.
358
322
  #
359
323
  # X.7.5 --- Cryptographic failure:(RFC 3463)
360
- # A transport system otherwise authorized to validate or decrypt
361
- # a message in transport was unable to do so because necessary
362
- # information such as key was not available or such information
363
- # was invalid.
324
+ # A transport system otherwise authorized to validate or decrypt a message in
325
+ # transport was unable to do so because necessary information such as key was not
326
+ # available or such information was invalid.
364
327
  #
365
328
  # X.7.6 --- Cryptographic algorithm not supported:(RFC 3463)
366
- # A transport system otherwise authorized to validate or decrypt
367
- # a message was unable to do so because the necessary algorithm
368
- # was not supported.
329
+ # A transport system otherwise authorized to validate or decrypt a message was
330
+ # unable to do so because the necessary algorithm was not supported.
369
331
 
370
332
  # X.7.7 --- Message integrity failure:(RFC 3463)
371
- # A transport system otherwise authorized to validate a message
372
- # was unable to do so because the message was corrupted or altered.
373
- # This may be useful as a permanent, transient persistent, or
374
- # successful delivery code.
333
+ # A transport system otherwise authorized to validate a message was unable to do so
334
+ # because the message was corrupted or altered. This may be useful as a permanent,
335
+ # transient persistent, or successful delivery code.
375
336
  #
376
337
  # X.7.8 535 Trust relationship required:(RFC 4954)
377
- # 554 This response to the AUTH command indicates that the authentication
378
- # failed due to invalid or insufficient authentication credentials.
379
- # In this case, the client SHOULD ask the user to supply new credentials
380
- # (such as by presenting a password dialog box).
338
+ # 554 This response to the AUTH command indicates that the authentication failed due to
339
+ # invalid or insufficient authentication credentials. In this case, the client
340
+ # SHOULD ask the user to supply new credentials (such as by presenting a password
341
+ # dialog box).
381
342
  #
382
343
  # X.7.9 534 Authentication mechanism is too weak:(RFC 4954)
383
- # This response to the AUTH command indicates that the selected
384
- # authentication mechanism is weaker than server policy permits
385
- # for that user. The client SHOULD retry with a new authentication
386
- # mechanism.
344
+ # This response to the AUTH command indicates that the selected authentication
345
+ # mechanism is weaker than server policy permits for that user. The client SHOULD
346
+ # retry with a new authentication mechanism.
387
347
  #
388
348
  # X.7.10 523 Encryption Needed:(RFC 5248)
389
- # This indicates that external strong privacy layer is needed in
390
- # order to use the requested authentication mechanism. This is
391
- # primarily intended for use with clear text authentication mechanisms.
392
- # A client which receives this may activate a security layer such
393
- # as TLS prior to authenticating, or attempt to use a stronger
349
+ # This indicates that external strong privacy layer is needed in order to use the
350
+ # requested authentication mechanism. This is primarily intended for use with clear
351
+ # text authentication mechanisms. A client which receives this may activate a
352
+ # security layer such as TLS prior to authenticating, or attempt to use a stronger
394
353
  # mechanism.
395
354
  #
396
355
  # X.7.11 524 Encryption required for requested authentication mechanism:(RFC 4954)
397
- # 538 This response to the AUTH command indicates that the selected
398
- # authentication mechanism may only be used when the underlying
399
- # SMTP connection is encrypted. Note that this response code is
400
- # documented here for historical purposes only. Modern implementations
401
- # SHOULD NOT advertise mechanisms that are not permitted due to
402
- # lack of encryption, unless an encryption layer of sufficient
403
- # strength is currently being employed.
356
+ # 538 This response to the AUTH command indicates that the selected authentication
357
+ # mechanism may only be used when the underlying SMTP connection is encrypted. Note
358
+ # that this response code is documented here for historical purposes only. Modern
359
+ # implementations SHOULD NOT advertise mechanisms that are not permitted due to lack
360
+ # of encryption, unless an encryption layer of sufficient strength is currently
361
+ # being employed.
404
362
  #
405
363
  # X.7.12 422 A password transition is needed:(RFC 4954)
406
- # 432 This response to the AUTH command indicates that the user needs
407
- # to transition to the selected authentication mechanism. This
408
- # is typically done by authenticating once using the [PLAIN]
409
- # authentication mechanism. The selected mechanism SHOULD then
410
- # work for authentications in subsequent sessions.
364
+ # 432 This response to the AUTH command indicates that the user needs to transition to
365
+ # the selected authentication mechanism. This is typically done by authenticating
366
+ # once using the [PLAIN] authentication mechanism. The selected mechanism SHOULD
367
+ # then work for authentications in subsequent sessions.
411
368
  #
412
369
  # X.7.13 525 User Account Disabled:(RFC 5248)
413
- # Sometimes a system administrator will have to disable a user's
414
- # account (e.g., due to lack of payment, abuse, evidence of a
415
- # break-in attempt, etc).
416
- # This error code occurs after a successful authentication to a
417
- # disabled account. This informs the client that the failure is
418
- # permanent until the user contacts their system administrator
419
- # to get the account re-enabled.
420
- # It differs from a generic authentication failure where the
421
- # client's best option is to present the passphrase entry dialog
422
- # in case the user simply mistyped their passphrase.
370
+ # Sometimes a system administrator will have to disable a user's account (e.g., due
371
+ # to lack of payment, abuse, evidence of a break-in attempt, etc). This error code
372
+ # occurs after a successful authentication to a disabled account. This informs the
373
+ # client that the failure is permanent until the user contacts their system
374
+ # administrator to get the account re-enabled. It differs from a generic
375
+ # authentication failure where the client's best option is to present the passphrase
376
+ # entry dialog in case the user simply mistyped their passphrase.
423
377
  #
424
378
  # X.7.14 535 Trust relationship required:(RFC 5248)
425
- # 554 The submission server requires a configured trust relationship
426
- # with a third-party server in order to access the message content.
427
- # This value replaces the prior use of X.7.8 for this error condition.
428
- # thereby updating [RFC4468].
379
+ # 554 The submission server requires a configured trust relationship with a third-party
380
+ # server in order to access the message content. This value replaces the prior use
381
+ # of X.7.8 for this error condition. thereby updating [RFC4468].
429
382
  #
430
383
  # X.7.15 450 Priority Level is too low:(RFC6710)
431
- # 550 The specified priority level is below the lowest priority acceptable
432
- # 4xx for the receiving SMTP server. This condition might be temporary,
433
- # 5xx for example the server is operating in a mode where only higher
434
- # priority messages are accepted for transfer and delivery, while
435
- # lower priority messages are rejected.
384
+ # 550 The specified priority level is below the lowest priority acceptable for the
385
+ # 4xx receiving SMTP server. This condition might be temporary, for example the server
386
+ # 5xx is operating in a mode where only higher priority messages are accepted for
387
+ # transfer and delivery, while lower priority messages are rejected.
436
388
  #
437
389
  # X.7.16 552 Message is too big for the specified priority:(RFC 6710)
438
- # 4xx The message is too big for the specified priority.
439
- # 5xx This condition might be temporary, for example the server is
440
- # operating in a mode where only higher priority messages below
441
- # certain size are accepted for transfer and delivery.
390
+ # 4xx The message is too big for the specified priority. This condition might be
391
+ # 5xx temporary, for example the server is operating in a mode where only higher
392
+ # priority messages below certain size are accepted for transfer and delivery.
442
393
  #
443
394
  # X.7.17 5xx Mailbox owner has changed:(RFC 6710)
444
- # This status code is returned when a message is received with
445
- # a Require-Recipient-Valid-Since field or RRVS extension and
446
- # the receiving system is able to determine that the intended
447
- # recipient mailbox has not been under continuous ownership since
448
- # the specified date-time.
395
+ # This status code is returned when a message is received with a
396
+ # Require-Recipient-Valid-Since field or RRVS extension and the receiving system is
397
+ # able to determine that the intended recipient mailbox has not been under
398
+ # continuous ownership since the specified date-time.
449
399
  #
450
400
  # X.7.18 5xx Domain owner has changed:(RFC 7293)
451
- # This status code is returned when a message is received with
452
- # a Require-Recipient-Valid-Since field or RRVS extension and
453
- # the receiving system wishes to disclose that the owner of the
454
- # domain name of the recipient has changed since the specified
455
- # date-time.
401
+ # This status code is returned when a message is received with a
402
+ # Require-Recipient-Valid-Since field or RRVS extension and the receiving system
403
+ # wishes to disclose that the owner of the domain name of the recipient has changed
404
+ # since the specified date-time.
456
405
  #
457
406
  # X.7.19 5xx RRVS test cannot be completed:(RFC 7293)
458
- # This status code is returned when a message is received with
459
- # a Require-Recipient-Valid-Since field or RRVS extension and
460
- # the receiving system cannot complete the requested evaluation
461
- # because the required timestamp was not recorded.
462
- # The message originator needs to decide whether to reissue the
463
- # message without RRVS protection.
407
+ # This status code is returned when a message is received with a
408
+ # Require-Recipient-Valid-Since field or RRVS extension and the receiving system
409
+ # cannot complete the requested evaluation because the required timestamp was not
410
+ # recorded. The message originator needs to decide whether to reissue the message
411
+ # without RRVS protection.
464
412
  #
465
413
  # X.7.20 550 No passing DKIM signature found:(RFC 7372)
466
- # This status code is returned when a message did not contain
467
- # any passing DKIM signatures. (This violates the advice of
468
- # Section 6.1 of [RFC6376].)
414
+ # This status code is returned when a message did not contain any passing DKIM
415
+ # signatures. (This violates the advice of Section 6.1 of [RFC6376].)
469
416
  #
470
417
  # X.7.21 550 No acceptable DKIM signature found:(RFC 7372, 6476)
471
- # This status code is returned when a message contains one or
472
- # more passing DKIM signatures, but none are acceptable.
473
- # (This violates the advice of Section 6.1 of [RFC6376].)
418
+ # This status code is returned when a message contains one or more passing DKIM
419
+ # signatures, but none are acceptable. (This violates the advice of Section 6.1 of
420
+ # [RFC6376].)
474
421
  #
475
422
  # X.7.22 550 No valid author-matched DKIM signature found:(RFC 7372)
476
- # This status code is returned when a message contains one or
477
- # more passing DKIM signatures, but none are acceptable because
478
- # none have an identifier(s) that matches the author address(es)
479
- # found in the From header field.
480
- # This is a special case of X.7.21. (This violates the advice of
481
- # Section 6.1 of [RFC6376].)
423
+ # This status code is returned when a message contains one or more passing DKIM
424
+ # signatures, but none are acceptable because none have an identifier(s) that
425
+ # matches the author address(es) found in the From header field. This is a special
426
+ # case of X.7.21. (This violates the advice of Section 6.1 of [RFC6376].)
482
427
  #
483
428
  # X.7.23 550 SPF validation failed:(RFC 7273, 7208)
484
- # This status code is returned when a message completed an SPF
485
- # check that produced a "fail" result, contrary to local policy
486
- # requirements. Used in place of 5.7.1 as described in Section
487
- # 8.4 of [RFC7208].
429
+ # This status code is returned when a message completed an SPF check that produced
430
+ # a "fail" result, contrary to local policy requirements. Used in place of 5.7.1 as
431
+ # described in Section 8.4 of [RFC7208].
488
432
  #
489
433
  # X.7.24 451 SPF validation error:(RFC 7372, 7208)
490
- # 550 This status code is returned when evaluation of SPF relative
491
- # to an arriving message resulted in an error. Used in place of
492
- # 4.4.3 or 5.5.2 as described in Sections 8.6 and 8.7 of [RFC7208].
434
+ # 550 This status code is returned when evaluation of SPF relative to an arriving
435
+ # message resulted in an error. Used in place of 4.4.3 or 5.5.2 as described in
436
+ # Sections 8.6 and 8.7 of [RFC7208].
493
437
  #
494
438
  # X.7.25 550 Reverse DNS validation failed:(RFC 7372, 7601)
495
- # This status code is returned when an SMTP client's IP address
496
- # failed a reverse DNS validation check, contrary to local policy
497
- # requirements.
439
+ # This status code is returned when an SMTP client's IP address failed a reverse
440
+ # DNS validation check, contrary to local policy requirements.
498
441
  #
499
442
  # X.7.26 550 Multiple authentication checks failed:(RFC 7372)
500
- # This status code is returned when a message failed more than
501
- # one message authentication check, contrary to local policy
502
- # requirements. The particular mechanisms that failed are not
503
- # specified.
443
+ # This status code is returned when a message failed more than one message
444
+ # authentication check, contrary to local policy requirements. The particular
445
+ # mechanisms that failed are not specified.
504
446
  #
505
447
  # X.7.27 550 Sender address has null MX:(RFC 7505)
506
- # This status code is returned when the associated sender address
507
- # has a null MX, and the SMTP receiver is configured to reject
508
- # mail from such sender (e.g., because it could not return a DSN).
509
- # ------------------------------------------------------------------------------
448
+ # This status code is returned when the associated sender address has a null MX,
449
+ # and the SMTP receiver is configured to reject mail from such sender
450
+ # (e.g., because it could not return a DSN).
451
+ # -------------------------------------------------------------------------------------------------
510
452
  # SAMPLES
511
- #
512
453
  # 554 5.5.0 No recipients have been specified
513
454
  # 503 5.5.0 Valid RCPT TO required before BURL
514
455
  # 554 5.6.3 Conversion required but not supported
@@ -531,14 +472,12 @@
531
472
  # 5.7.8 Authentication credentials invalid
532
473
  # 5.7.9 Authentication mechanism is too weak
533
474
  # 5.7.11 Encryption required for requested authentication mechanism
534
- # ------------------------------------------------------------------------------
475
+ # -------------------------------------------------------------------------------------------------
535
476
  module Sisimai
536
477
  module SMTP
537
- # Sisimai::RFC3463 is utilities for getting D.S.N. value from error reason text,
538
- # getting the reason from D.S.N. value, and getting D.S.N. from the text including
539
- # D.S.N.
478
+ # Sisimai::RFC3463 is utilities for getting D.S.N. value from error reason text, getting the
479
+ # reason from D.S.N. value, and getting D.S.N. from the text including D.S.N.
540
480
  module Status
541
- # Imported from p5-Sisimail/lib/Sisimai/SMTP/Status.pm
542
481
  class << self
543
482
  CodePatterns = [
544
483
  %r/[ ]?[(][#]([45][.]\d[.]\d+)[)]?[ ]?/, # #5.5.1
@@ -548,7 +487,7 @@ module Sisimai
548
487
  ]
549
488
  StandardCode = {
550
489
  '2.1.5' => 'delivered', # Successfully delivered
551
- # ------------------------------------------------------------------------------
490
+ # ---------------------------------------------------------------------------------------
552
491
  '4.1.6' => 'hasmoved', # Destination mailbox has moved, No forwarding address
553
492
  '4.1.7' => 'rejected', # Bad sender's mailbox address syntax
554
493
  '4.1.8' => 'rejected', # Bad sender's system address
@@ -565,12 +504,13 @@ module Sisimai
565
504
  # '4.4.0' => 'networkerror', # Other or undefined network or routing status
566
505
  '4.4.1' => 'expired', # No answer from host
567
506
  '4.4.2' => 'networkerror', # Bad connection
568
- # '4.4.3' => 'systemerror', # Directory server failure
507
+ '4.4.3' => 'systemerror', # Directory server failure
569
508
  '4.4.4' => 'networkerror', # Unable to route
570
509
  '4.4.5' => 'systemfull', # Mail system congestion
571
510
  '4.4.6' => 'networkerror', # Routing loop detected
572
511
  '4.4.7' => 'expired', # Delivery time expired
573
- # '4.5.0' => 'networkerror', # Other or undefined protocol status
512
+ '4.4.8' => 'networkerror', # Retry on IPv4
513
+ # '4.5.0' => 'networkerror', # Other or undefined protocol status
574
514
  '4.5.3' => 'systemerror', # Too many recipients
575
515
  '4.5.5' => 'systemerror', # Wrong protocol version
576
516
  '4.6.0' => 'contenterror', # Other or undefined media error
@@ -585,9 +525,9 @@ module Sisimai
585
525
  '4.7.12' => 'securityerror', # A password transition is needed
586
526
  '4.7.15' => 'securityerror', # Priority Level is too low
587
527
  '4.7.16' => 'mesgtoobig', # Message is too big for the specified priority
588
- '4.7.24' => 'securityerror', # SPF validation error
589
- '4.7.25' => 'blocked', # Reverse DNS validation failed
590
- # ------------------------------------------------------------------------------
528
+ '4.7.24' => 'authfailure ', # SPF validation error
529
+ '4.7.25' => 'requireptr', # Reverse DNS validation failed
530
+ # ---------------------------------------------------------------------------------------
591
531
  '5.1.0' => 'userunknown', # Other address status
592
532
  '5.1.1' => 'userunknown', # Bad destination mailbox address
593
533
  '5.1.2' => 'hostunknown', # Bad destination system address
@@ -612,10 +552,11 @@ module Sisimai
612
552
  '5.4.0' => 'networkerror', # Other or undefined network or routing status
613
553
  '5.4.3' => 'systemerror', # Directory server failure
614
554
  '5.4.4' => 'hostunknown', # Unable to route
555
+ '5.5.2' => 'syntaxerror', # If the server cannot BASE64 decode any client response (AUTH)
615
556
  '5.5.3' => 'toomanyconn', # Too many recipients
616
557
  '5.5.4' => 'systemerror', # Invalid command arguments
617
558
  '5.5.5' => 'systemerror', # Wrong protocol version
618
- '5.5.6' => 'securityerror', # Authentication Exchange line is too long
559
+ '5.5.6' => 'syntaxerror', # Authentication Exchange line is too long
619
560
  '5.6.0' => 'contenterror', # Other or undefined media error
620
561
  '5.6.1' => 'contenterror', # Media not supported
621
562
  '5.6.2' => 'contenterror', # Conversion required and prohibited
@@ -644,43 +585,50 @@ module Sisimai
644
585
  '5.7.17' => 'hasmoved', # Mailbox owner has changed
645
586
  '5.7.18' => 'hasmoved', # Domain owner has changed
646
587
  '5.7.19' => 'securityerror', # RRVS test cannot be completed
647
- '5.7.20' => 'securityerror', # No passing DKIM signature found
648
- '5.7.21' => 'securityerror', # No acceptable DKIM signature found
649
- '5.7.22' => 'securityerror', # No valid author-matched DKIM signature found
650
- '5.7.23' => 'securityerror', # SPF validation failed
651
- '5.7.24' => 'securityerror', # SPF validation error
652
- '5.7.25' => 'blocked', # Reverse DNS validation failed
653
- '5.7.26' => 'securityerror', # Multiple authentication checks failed
588
+ '5.7.20' => 'authfailure', # No passing DKIM signature found
589
+ '5.7.21' => 'authfailure', # No acceptable DKIM signature found
590
+ '5.7.22' => 'authfailure', # No valid author-matched DKIM signature found
591
+ '5.7.23' => 'authfailure', # SPF validation failed
592
+ '5.7.24' => 'authfailure', # SPF validation error
593
+ '5.7.25' => 'requireptr', # Reverse DNS validation failed
594
+ '5.7.26' => 'authfailure', # Multiple authentication checks failed
654
595
  '5.7.27' => 'notaccept', # MX resource record of a destination host is Null MX: RFC7505
655
596
  }.freeze
656
597
 
657
598
  InternalCode = {
658
599
  :temporary => {
659
- 'blocked' => '4.0.971',
660
- 'contenterror' => '4.0.960',
661
- # 'exceedlimit' => '4.0.923',
662
- 'expired' => '4.0.947',
663
- 'filtered' => '4.0.924',
664
- # 'hasmoved' => '4.0.916',
665
- # 'hostunknown' => '4.0.912',
666
- 'mailboxfull' => '4.0.922',
667
- # 'mailererror' => '4.0.939',
668
- # 'mesgtoobig' => '4.0.934',
669
- 'networkerror' => '4.0.944',
670
- # 'norelaying' => '4.0.909',
671
- 'notaccept' => '4.0.932',
672
- 'onhold' => '4.0.901',
673
- 'rejected' => '4.0.918',
674
- 'securityerror' => '4.0.970',
675
- 'spamdetected' => '4.0.980',
676
- # 'suspend' => '4.0.921',
677
- 'systemerror' => '4.0.930',
678
- 'systemfull' => '4.0.931',
679
- 'toomanyconn' => '4.0.945',
680
- # 'userunknown' => '4.0.911',
681
- 'undefined' => '4.0.900',
600
+ 'authfailure' => '4.0.972',
601
+ 'badreputation' => '4.0.975',
602
+ 'blocked' => '4.0.971',
603
+ 'contenterror' => '4.0.960',
604
+ # 'exceedlimit' => '4.0.923',
605
+ 'expired' => '4.0.947',
606
+ 'filtered' => '4.0.924',
607
+ # 'hasmoved' => '4.0.916',
608
+ # 'hostunknown' => '4.0.912',
609
+ 'mailboxfull' => '4.0.922',
610
+ # 'mailererror' => '4.0.939',
611
+ # 'mesgtoobig' => '4.0.934',
612
+ 'networkerror' => '4.0.944',
613
+ # 'norelaying' => '4.0.909',
614
+ 'notaccept' => '4.0.932',
615
+ 'notcompliantrfc' => '4.0.974',
616
+ 'onhold' => '4.0.901',
617
+ 'rejected' => '4.0.918',
618
+ 'requireptr' => '4.0.973',
619
+ 'securityerror' => '4.0.970',
620
+ 'spamdetected' => '4.0.980',
621
+ 'speeding' => '4.0.946',
622
+ # 'suspend' => '4.0.921',
623
+ 'systemerror' => '4.0.930',
624
+ 'systemfull' => '4.0.931',
625
+ 'toomanyconn' => '4.0.945',
626
+ # 'userunknown' => '4.0.911',
627
+ 'undefined' => '4.0.900',
682
628
  },
683
629
  :permanent => {
630
+ 'authfailure' => '5.0.972',
631
+ 'badreputation' => '5.0.975',
684
632
  'blocked' => '5.0.971',
685
633
  'contenterror' => '5.0.960',
686
634
  'exceedlimit' => '5.0.923',
@@ -694,11 +642,14 @@ module Sisimai
694
642
  'networkerror' => '5.0.944',
695
643
  'norelaying' => '5.0.909',
696
644
  'notaccept' => '5.0.932',
645
+ 'notcompliantrfc' => '5.0.974',
697
646
  'onhold' => '5.0.901',
698
647
  'policyviolation' => '5.0.972',
699
648
  'rejected' => '5.0.918',
649
+ 'requireptr' => '5.0.973',
700
650
  'securityerror' => '5.0.970',
701
651
  'spamdetected' => '5.0.980',
652
+ 'speeding' => '5.0.946',
702
653
  'suspend' => '5.0.921',
703
654
  'systemerror' => '5.0.930',
704
655
  'systemfull' => '5.0.931',
@@ -727,38 +678,198 @@ module Sisimai
727
678
 
728
679
  # Convert from the status code to the reason string
729
680
  # @param [String] argv1 Status code(DSN)
730
- # @return [String, Nil] Reason name or Nil if the first argument did
731
- # not match with values in Sisimai's reason list
681
+ # @return [String] Reason name
682
+ # [Nil] The first argument did not match with values in reason list
732
683
  # @see code
733
684
  def name(argv1 = nil)
734
685
  return nil unless argv1
735
- return nil unless argv1 =~ /\A[245][.]\d[.]\d+\z/
686
+ return nil unless Sisimai::SMTP::Status.test(argv1)
736
687
  return StandardCode[argv1] || nil
737
688
  end
738
689
 
690
+ # Check whether a status code is a valid code or not
691
+ # @param [String] argv1 Status code(DSN)
692
+ # @return [Boolean] 0 = Invalid status code, 1 = Valid status code
693
+ # @see code
694
+ # @since v5.0.0
695
+ def test(argv1 = '')
696
+ return nil if argv1.to_s.empty?
697
+ return false if argv1.size < 5
698
+ return false if argv1.size > 7
699
+
700
+ token = []
701
+ argv1.split('.').each { |e| token << e.to_i }
702
+ return false unless token.size == 3
703
+ return false if token[0] < 2
704
+ return false if token[0] == 3
705
+ return false if token[0] > 5
706
+ return false if token[1] < 0
707
+ return false if token[1] > 7
708
+ return false if token[2] < 0
709
+ return true
710
+ end
711
+
739
712
  # Get a DSN code value from given string including DSN
740
713
  # @param [String] argv1 String including DSN
741
- # @return [String, Nil] DSN or Nil if the first agument did not
742
- # include DSN
743
- def find(argv1 = nil)
744
- return nil unless argv1
745
- return nil if argv1.empty?
714
+ # @param [String] argv2 An SMTP Reply Code or 2 or 4 or 5
715
+ # @return [String, Nil] An SMTP Status Code
716
+ def find(argv1 = nil, argv2 = '0')
717
+ return nil if argv1.to_s.empty?
718
+ return nil if argv1.size < 7
719
+
720
+ givenclass = argv2[0, 1]
721
+ eestatuses = if givenclass == '2' || givenclass == '4' || givenclass == '5'
722
+ [givenclass + '.']
723
+ else
724
+ ['5.', '4.', '2.']
725
+ end
726
+ esmtperror = ' ' + argv1 + ' '
727
+ lookingfor = []
746
728
 
747
- found = nil
748
- CodePatterns.each do |e|
749
- # Get the value of D.S.N. in the text
750
- next unless r = argv1.match(e)
751
- found = r[1]
729
+ Sisimai::String.ipv4(esmtperror).each do |e|
730
+ # Rewrite an IPv4 address in the given string(argv1) with '***.***.***.***'
731
+ p0 = esmtperror.index(e) || next
732
+ esmtperror[p0, e.size] = '***.***.***.***'
733
+ end
734
+
735
+ eestatuses.each do |e|
736
+ # Count the number of "5.", "4.", and "2." in the error message
737
+ p0 = 0; p1 = 0
738
+ while p0
739
+ # Find all of the "5." and "4." string and store its postion
740
+ p0 = esmtperror.index(e, p1) || break
741
+ lookingfor << [p0, e]
742
+ p1 = p0 + 5
743
+ end
744
+ end
745
+ return nil if lookingfor.size == 0
746
+
747
+ statuscode = [] # List of SMTP Status Code, Keep the order of appearances
748
+ anotherone = '' # Alternative code
749
+ readbuffer = ''
750
+ characters = [] # Characters around the status code found by index()
751
+ indexofees = nil # A position of SMTP status code found by the index()
752
+
753
+ lookingfor.sort_by(&:first).each do |e|
754
+ # Try to find an SMTP Status Code from the given string
755
+ indexofees = esmtperror.index(e[1], e[0]); next unless indexofees
756
+ characters = [esmtperror[indexofees - 1, 1].ord] # [0] The previous character of the status
757
+ [2, 3].each do |i|
758
+ # [1] The value of the "Subject", "5.[7].261"
759
+ # [2] "." chacater, a separator of the Subject and the Detail
760
+ if indexofees + 1 + i > esmtperror.size
761
+ characters << 0
762
+ else
763
+ characters << esmtperror[indexofees + i, 1].ord
764
+ end
765
+ end
752
766
 
753
- if argv1 =~ /\b(?:#{found}[.]\d{1,3}|\d{1,3}[.]#{found})\b/
754
- # Clear and skip if the value is an IPv4 address
755
- found = nil
767
+ next if characters[0] > 45 && characters[0] < 58 # Previous character is a number
768
+ next if characters[0] == 86 || characters[0] == 118 # Avoid a version number("V" or "v")
769
+ next if characters[1] < 48 || characters[1] > 55 # The value of the subject is not a number(0-7)
770
+ next if characters[2] != 46 # It is not a "." character: a separator
771
+ readbuffer = e[1] + characters[1].chr + '.'
772
+
773
+ [4, 5, 6, 7].each do |i|
774
+ # [3] The 1st digit of the detail
775
+ # [4] The 2nd digit of the detail
776
+ # [5] The 3rd digit of the detail
777
+ # [6] The next character
778
+ if indexofees + 1 + i > esmtperror.size
779
+ characters << 0
780
+ else
781
+ characters << esmtperror[indexofees + i, 1].ord
782
+ end
783
+ end
784
+
785
+ next if characters[3] < 48 || characters[3] > 57 # The 1st digit of the detail is not a number
786
+ readbuffer << characters[3].chr
787
+
788
+ if readbuffer.index('.0.0') || readbuffer == '4.4.7'
789
+ # Find another status code except *.0.0, 4.4.7
790
+ anotherone = readbuffer
791
+ next
792
+ end
793
+
794
+ if characters[4] < 48 || characters[4] > 57
795
+ # The 2nd digit of the detail is not a number
796
+ statuscode << readbuffer
756
797
  next
757
798
  end
758
- break
799
+ readbuffer << characters[4].chr # The 2nd digit of the detail is a number
800
+
801
+ if characters[5] < 48 || characters[5] > 57
802
+ # The 3rd digit of the detail is not a number
803
+ statuscode << readbuffer
804
+ next
805
+ end
806
+ readbuffer << characters[5].chr # The 3rd digit of the detail is a number
807
+
808
+ next if characters[6] > 47 && characters[6] < 58
809
+ statuscode << readbuffer
810
+ end
811
+
812
+ statuscode << anotherone if anotherone.size > 0
813
+ return nil if statuscode.size == 0
814
+ return statuscode.shift
815
+ end
816
+
817
+ # Return the preferred value selected from the arguments
818
+ # @param [String] argv0 The value of Status:
819
+ # @param [String] argv1 The delivery status picked from the error message
820
+ # @param [String] argv2 The value of An SMTP Reply Code
821
+ # @return [String] The preferred value
822
+ # @since v5.0.0
823
+ def prefer(argv0 = nil, argv1 = nil, argv2 = nil)
824
+ return argv1 unless argv0; return argv1 unless argv0.size > 4
825
+ return argv0 unless argv1; return argv0 unless argv1.size > 4
826
+
827
+ statuscode = argv0
828
+ codeinmesg = argv1
829
+ esmtpreply = argv2 || '000'
830
+ the1stchar = {
831
+ 'field' => statuscode[0, 1].to_i,
832
+ 'error' => codeinmesg[0, 1].to_i,
833
+ 'reply' => esmtpreply.to_s[0, 1].to_i,
834
+ }
835
+
836
+ if the1stchar['reply'] > 0 && the1stchar['field'] != the1stchar['error']
837
+ # There is the 3rd argument (an SMTP Reply Code)
838
+ # Returns the value of $argv0 or $argv1 which begins with the 1st character of argv2
839
+ return statuscode if the1stchar['reply'] == the1stchar['field']
840
+ return codeinmesg if the1stchar['reply'] == the1stchar['error']
841
+ end
842
+ return statuscode if statuscode == codeinmesg
843
+
844
+ zeroindex1 = { 'field' => statuscode.index('.0') || -1, 'error' => codeinmesg.index('.0') || -1 }
845
+ zeroindex2 = { 'field' => statuscode.index('.0.0') || -1, 'error' => codeinmesg.index('.0.0') || -1 }
846
+
847
+ if zeroindex2['field'] > 0
848
+ # "Status:" field is "X.0.0"
849
+ return codeinmesg if zeroindex2['error'] < 0
850
+ return statuscode
851
+ end
852
+
853
+ if zeroindex1['field'] > 0
854
+ # "Status:" field is "X.Y.0" or "X.0.Z"
855
+ return codeinmesg if zeroindex1['error'] < 0
856
+ end
857
+
858
+ return statuscode if zeroindex2['error'] > 0 # An SMTP status code is "X.0.0"
859
+ return codeinmesg if statuscode == '4.4.7' # "4.4.7" is an ambiguous code
860
+ return codeinmesg if statuscode.start_with?('5.3.') # "5.3.Z" is an error of a system
861
+
862
+ if statuscode == '5.1.1'
863
+ # "5.1.1" is a code of "userunknown"
864
+ return statuscode if zeroindex1['error'] > 0
865
+ return codeinmesg
866
+
867
+ elsif statuscode == '5.1.3'
868
+ # "5.1.3"
869
+ return codeinmesg if codeinmesg.start_with?('5.7.')
759
870
  end
760
871
 
761
- return found
872
+ return statuscode
762
873
  end
763
874
 
764
875
  end