sisimai 5.7.0-java → 5.7.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +15 -0
  3. data/README-JA.md +8 -8
  4. data/README.md +8 -8
  5. data/lib/sisimai/arf.rb +2 -1
  6. data/lib/sisimai/eb.rb +116 -0
  7. data/lib/sisimai/fact.rb +24 -17
  8. data/lib/sisimai/lda.rb +20 -18
  9. data/lib/sisimai/lhost/amazonses.rb +11 -10
  10. data/lib/sisimai/lhost/courier.rb +4 -3
  11. data/lib/sisimai/lhost/domino.rb +2 -1
  12. data/lib/sisimai/lhost/einsundeins.rb +3 -2
  13. data/lib/sisimai/lhost/exchange2003.rb +8 -7
  14. data/lib/sisimai/lhost/exchange2007.rb +14 -13
  15. data/lib/sisimai/lhost/exim.rb +7 -6
  16. data/lib/sisimai/lhost/ezweb.rb +4 -3
  17. data/lib/sisimai/lhost/fml.rb +4 -3
  18. data/lib/sisimai/lhost/gmail.rb +10 -9
  19. data/lib/sisimai/lhost/googlegroups.rb +3 -2
  20. data/lib/sisimai/lhost/googleworkspace.rb +2 -1
  21. data/lib/sisimai/lhost/imailserver.rb +3 -2
  22. data/lib/sisimai/lhost/kddi.rb +4 -3
  23. data/lib/sisimai/lhost/notes.rb +2 -1
  24. data/lib/sisimai/lhost/postfix.rb +7 -6
  25. data/lib/sisimai/lhost/qmail.rb +10 -9
  26. data/lib/sisimai/lhost/sendmail.rb +4 -3
  27. data/lib/sisimai/lhost/trendmicro.rb +2 -1
  28. data/lib/sisimai/lhost/v5sendmail.rb +2 -1
  29. data/lib/sisimai/lhost/verizon.rb +3 -2
  30. data/lib/sisimai/reason/authfailure.rb +6 -5
  31. data/lib/sisimai/reason/badreputation.rb +5 -4
  32. data/lib/sisimai/reason/blocked.rb +6 -5
  33. data/lib/sisimai/reason/contenterror.rb +6 -5
  34. data/lib/sisimai/reason/delivered.rb +3 -2
  35. data/lib/sisimai/reason/emailtoolarge.rb +6 -5
  36. data/lib/sisimai/reason/expired.rb +3 -2
  37. data/lib/sisimai/reason/failedstarttls.rb +5 -3
  38. data/lib/sisimai/reason/feedback.rb +2 -1
  39. data/lib/sisimai/reason/filtered.rb +9 -8
  40. data/lib/sisimai/reason/hasmoved.rb +5 -4
  41. data/lib/sisimai/reason/hostunknown.rb +5 -4
  42. data/lib/sisimai/reason/mailboxfull.rb +7 -6
  43. data/lib/sisimai/reason/mailererror.rb +3 -2
  44. data/lib/sisimai/reason/networkerror.rb +3 -2
  45. data/lib/sisimai/reason/norelaying.rb +4 -3
  46. data/lib/sisimai/reason/notaccept.rb +5 -4
  47. data/lib/sisimai/reason/notcompliantrfc.rb +4 -3
  48. data/lib/sisimai/reason/onhold.rb +8 -7
  49. data/lib/sisimai/reason/policyviolation.rb +7 -6
  50. data/lib/sisimai/reason/ratelimited.rb +5 -4
  51. data/lib/sisimai/reason/rejected.rb +18 -14
  52. data/lib/sisimai/reason/requireptr.rb +5 -4
  53. data/lib/sisimai/reason/securityerror.rb +4 -3
  54. data/lib/sisimai/reason/spamdetected.rb +6 -5
  55. data/lib/sisimai/reason/suppressed.rb +4 -3
  56. data/lib/sisimai/reason/suspend.rb +4 -3
  57. data/lib/sisimai/reason/syntaxerror.rb +4 -3
  58. data/lib/sisimai/reason/systemerror.rb +3 -2
  59. data/lib/sisimai/reason/systemfull.rb +4 -3
  60. data/lib/sisimai/reason/undefined.rb +2 -1
  61. data/lib/sisimai/reason/userunknown.rb +13 -9
  62. data/lib/sisimai/reason/vacation.rb +2 -1
  63. data/lib/sisimai/reason/virusdetected.rb +6 -5
  64. data/lib/sisimai/reason.rb +45 -40
  65. data/lib/sisimai/rfc1894.rb +8 -2
  66. data/lib/sisimai/rfc2045.rb +6 -3
  67. data/lib/sisimai/rfc3464/thirdparty.rb +10 -9
  68. data/lib/sisimai/rfc3834.rb +4 -2
  69. data/lib/sisimai/rhost/aol.rb +3 -2
  70. data/lib/sisimai/rhost/apple.rb +12 -11
  71. data/lib/sisimai/rhost/cloudflare.rb +3 -2
  72. data/lib/sisimai/rhost/cox.rb +38 -37
  73. data/lib/sisimai/rhost/facebook.rb +17 -16
  74. data/lib/sisimai/rhost/franceptt.rb +39 -38
  75. data/lib/sisimai/rhost/godaddy.rb +35 -34
  76. data/lib/sisimai/rhost/google.rb +22 -21
  77. data/lib/sisimai/rhost/gsuite.rb +8 -7
  78. data/lib/sisimai/rhost/iua.rb +11 -10
  79. data/lib/sisimai/rhost/kddi.rb +3 -2
  80. data/lib/sisimai/rhost/messagelabs.rb +13 -12
  81. data/lib/sisimai/rhost/microsoft.rb +33 -32
  82. data/lib/sisimai/rhost/mimecast.rb +18 -17
  83. data/lib/sisimai/rhost/nttdocomo.rb +10 -9
  84. data/lib/sisimai/rhost/outlook.rb +3 -2
  85. data/lib/sisimai/rhost/spectrum.rb +19 -18
  86. data/lib/sisimai/rhost/tencent.rb +10 -9
  87. data/lib/sisimai/rhost/yahooinc.rb +11 -10
  88. data/lib/sisimai/rhost/zoho.rb +8 -7
  89. data/lib/sisimai/smtp/command.rb +13 -8
  90. data/lib/sisimai/smtp/failure.rb +9 -8
  91. data/lib/sisimai/smtp/reply.rb +23 -22
  92. data/lib/sisimai/smtp/status.rb +141 -140
  93. data/lib/sisimai/smtp/transcript.rb +3 -2
  94. data/lib/sisimai/version.rb +1 -1
  95. data/lib/sisimai.rb +2 -1
  96. data/set-of-emails/maildir/bsd/lhost-postfix-81.eml +130 -0
  97. data/set-of-emails/should-not-crash/go-423-deeply-nested-mime-parts.eml +20050 -0
  98. metadata +5 -2
@@ -5,13 +5,14 @@ module Sisimai
5
5
  # This class is called only Sisimai::Fact class.
6
6
  module YahooInc
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'authfailure' => [
10
+ Sisimai::Eb::ReAUTH => [
10
11
  # - 550 5.7.9 This mail has been blocked because the sender is unauthenticated. Yahoo
11
12
  # requires all senders to authenticate with either SPF or DKIM.
12
13
  'yahoo requires all senders to authenticate with either spf or dkim',
13
14
  ],
14
- 'blocked' => [
15
+ Sisimai::Eb::ReBLOC => [
15
16
  # - 553 5.7.1 [BL21] Connections will not be accepted from 192.0.2.25,
16
17
  # because the ip is in Spamhaus's list; see http://postmaster.yahoo.com/550-bl23.html
17
18
  # - 553 5.7.1 [BL23] Connections not accepted from IP addresses on Spamhaus XBL;
@@ -19,26 +20,26 @@ module Sisimai
19
20
  " because the ip is in spamhaus's list;",
20
21
  'not accepted from ip addresses on spamhaus xbl',
21
22
  ],
22
- 'norelaying' => [
23
+ Sisimai::Eb::RePASS => [
23
24
  # - 550 relaying denied for <***@yahoo.com>
24
25
  'relaying denied for ',
25
26
  ],
26
- 'notcompliantrfc' => ['headers are not rfc compliant'],
27
- 'policyviolation' => [
27
+ Sisimai::Eb::ReNRFC => ['headers are not rfc compliant'],
28
+ Sisimai::Eb::ReWONT => [
28
29
  # - 554 Message not allowed - [PH01] Email not accepted for policy reasons.
29
30
  # Please visit https://postmaster.yahooinc.com/error-codes
30
31
  # - 554 5.7.9 Message not accepted for policy reasons.
31
32
  # See https://postmaster.yahooinc.com/error-codes
32
33
  'not accepted for policy reasons',
33
34
  ],
34
- 'ratelimited' => [
35
+ Sisimai::Eb::ReRATE => [
35
36
  # - 421 Max message per connection reached, closing transmission channel
36
37
  'max message per connection reached',
37
38
 
38
39
  # - 450 User is receiving mail too quickly
39
40
  'user is receiving mail too quickly',
40
41
  ],
41
- 'rejected' => [
42
+ Sisimai::Eb::ReFROM => [
42
43
  # Observed the following error message since around March 2024:
43
44
  #
44
45
  # - 421 4.7.0 [TSS04] Messages from 192.0.2.25 temporarily deferred due to unexpected
@@ -60,18 +61,18 @@ module Sisimai
60
61
  # Retrying will NOT succeed. See https://postmaster.yahooinc.com/error-codes
61
62
  ' will be permanently deferred',
62
63
  ],
63
- 'suspend' => [
64
+ Sisimai::Eb::ReQUIT => [
64
65
  # - 554 delivery error: dd ****@yahoo.com is no longer valid.
65
66
  # - 554 30 Sorry, your message to *****@aol.jp cannot be delivered.
66
67
  # This mailbox is disabled (554.30)
67
68
  ' is no longer valid.',
68
69
  'this mailbox is disabled',
69
70
  ],
70
- 'syntaxerror' => [
71
+ Sisimai::Eb::ReCOMM => [
71
72
  # - 501 Syntax error in parameters or arguments
72
73
  'syntax error in parameters or arguments',
73
74
  ],
74
- 'userunknown' => [
75
+ Sisimai::Eb::ReUSER => [
75
76
  # - 554 delivery error: dd This user doesn't have a yahoo.com account (***@yahoo.com)
76
77
  # - 552 1 Requested mail action aborted, mailbox not found (in reply to end of DATA command)
77
78
  "dd this user doesn't have a ",
@@ -5,19 +5,20 @@ module Sisimai
5
5
  # This class is called only Sisimai::Fact class.
6
6
  module Zoho
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'authfailure' => [
10
+ Sisimai::Eb::ReAUTH => [
10
11
  # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 550 5.7.1 Email
11
12
  # rejected per DMARC policy for zoho.com
12
13
  "Email rejected per DMARC policy",
13
14
  ],
14
- 'blocked' => [
15
+ Sisimai::Eb::ReBLOC => [
15
16
  # - mx.zoho.com[204.141.33.44]:25, delay=1202, delays=1200/0/0.91/0.30, dsn=4.7.1,
16
17
  # status=deferred (host mx.zoho.com[204.141.33.44] said:
17
18
  # 451 4.7.1 Greylisted, try again after some time (in reply to RCPT TO command))
18
19
  "Greylisted, try again after some time",
19
20
  ],
20
- 'rejected' => [
21
+ Sisimai::Eb::ReFROM => [
21
22
  # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 554 5.7.1 Email
22
23
  # cannot be delivered. Reason: Email flagged as Spam. (in reply to RCPT TO command)
23
24
  # - <***@zoho.com>: host mx.zoho.com[136.143.183.44] said: 541 5.4.1 Mail rejected
@@ -25,24 +26,24 @@ module Sisimai
25
26
  "Email cannot be delivered. Reason: Email flagged as Spam",
26
27
  "Mail rejected by destination domain",
27
28
  ],
28
- 'policyviolation' => [
29
+ Sisimai::Eb::ReWONT => [
29
30
  # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said: 554 5.7.7 Email
30
31
  # policy violation detected (in reply to end of DATA command)
31
32
  "Email policy violation detected",
32
33
  "Mailbox delivery restricted by policy error",
33
34
  ],
34
- 'systemerror' => [
35
+ Sisimai::Eb::RePROC => [
35
36
  # - https://github.com/zoho/zohodesk-oas/blob/main/v1.0/EmailFailureAlert.json#L168
36
37
  # 452 4.3.1 Temporary System Error
37
38
  "Temporary System Error",
38
39
  ],
39
- 'userunknown' => [
40
+ Sisimai::Eb::ReUSER => [
40
41
  # - <*******@zoho.com>: host smtpin.zoho.com[204.141.33.23] said:
41
42
  # 550 5.1.1 User does not exist - <***@zoho.com> (in reply to RCPT TO command)
42
43
  # - 552 5.1.1 <****@zoho.com> Mailbox delivery failure policy error
43
44
  "User does not exist",
44
45
  ],
45
- 'virusdetected' => [
46
+ Sisimai::Eb::ReEXEC => [
46
47
  # - 552 5.7.1 virus **** detected by Zoho Mail
47
48
  " detected by Zoho Mail",
48
49
  ],
@@ -2,17 +2,22 @@ module Sisimai
2
2
  module SMTP
3
3
  # Sisimai::SMTP::Transcript is an SMTP Command related utilities
4
4
  module Command
5
- ExceptDATA = ["CONN", "EHLO", "HELO", "MAIL", "RCPT"].freeze
6
- BeforeRCPT = ["CONN", "EHLO", "EHLO", "MAIL", "AUTH", "STARTTLS"].freeze
5
+ require 'sisimai/eb'
6
+ ExceptDATA = [Sisimai::Eb::CeCONN, Sisimai::Eb::CeEHLO, Sisimai::Eb::CeHELO,
7
+ Sisimai::Eb::CeMAIL, Sisimai::Eb::CeRCPT].freeze
8
+ BeforeRCPT = [Sisimai::Eb::CeCONN, Sisimai::Eb::CeEHLO, Sisimai::Eb::CeHELO,
9
+ Sisimai::Eb::CeMAIL, Sisimai::Eb::CeAUTH, Sisimai::Eb::CeTTLS].freeze
7
10
  class << self
8
11
  Availables = [
9
- "HELO", "EHLO", "MAIL", "RCPT", "DATA", "QUIT", "RSET", "NOOP", "VRFY", "ETRN", "EXPN",
10
- "HELP", "AUTH", "STARTTLS", "XFORWARD",
11
- "CONN", # CONN is a pseudo SMTP command used only in Sisimai
12
+ Sisimai::Eb::CeEHLO, Sisimai::Eb::CeHELO, Sisimai::Eb::CeMAIL, Sisimai::Eb::CeRCPT, Sisimai::Eb::CeDATA,
13
+ Sisimai::Eb::CeQUIT, Sisimai::Eb::CeRSET, Sisimai::Eb::CeNOOP, Sisimai::Eb::CeVRFY, Sisimai::Eb::CeETRN,
14
+ Sisimai::Eb::CeEXPN, Sisimai::Eb::CeHELP, Sisimai::Eb::CeAUTH, Sisimai::Eb::CeTTLS, Sisimai::Eb::CeXFWD,
15
+ Sisimai::Eb::CeCONN, # CONN is a pseudo SMTP command used only in Sisimai
12
16
  ].freeze
13
17
  Detectable = [
14
- "HELO", "EHLO", "STARTTLS", "AUTH PLAIN", "AUTH LOGIN", "AUTH CRAM-", "AUTH DIGEST-",
15
- "MAIL F", "RCPT", "RCPT T", "DATA", "QUIT", "XFORWARD",
18
+ Sisimai::Eb::CeHELO, Sisimai::Eb::CeEHLO, Sisimai::Eb::CeTTLS, "AUTH PLAIN", "AUTH LOGIN",
19
+ "AUTH CRAM-", "AUTH DIGEST-", "MAIL F", Sisimai::Eb::CeRCPT, "RCPT T", Sisimai::Eb::CeDATA,
20
+ Sisimai::Eb::CeQUIT, Sisimai::Eb::CeXFWD,
16
21
  ].freeze
17
22
 
18
23
  # Check that an SMTP command in the argument is valid or not
@@ -33,7 +38,7 @@ module Sisimai
33
38
  return "" if Sisimai::SMTP::Command.test(argv0) == false
34
39
 
35
40
  issuedcode = " " + argv0.downcase + " "
36
- commandmap = {"STAR" => "STARTTLS", "XFOR" => "XFORWARD"}
41
+ commandmap = {"STAR" => Sisimai::Eb::CeTTLS, "XFOR" => Sisimai::Eb::CeXFWD}
37
42
  commandset = []
38
43
 
39
44
  Detectable.each do |e|
@@ -3,6 +3,7 @@ module Sisimai
3
3
  # Sisimai::SMTP::Failure is utilities for checking SMTP Errors from error message text.
4
4
  module Failure
5
5
  class << self
6
+ require 'sisimai/eb'
6
7
  require 'sisimai/smtp/reply'
7
8
  require 'sisimai/smtp/status'
8
9
 
@@ -44,10 +45,10 @@ module Sisimai
44
45
  # @return [Boolean] true: is a hard bounce
45
46
  def is_hardbounce(argv1 = '', argv2 = '')
46
47
  return false if argv1.to_s == ""
47
- return false if argv1 == "undefined" || argv1 == "onhold"
48
- return false if argv1 == "delivered" || argv1 == "feedback" || argv1 == "vacation"
49
- return true if argv1 == "hasmoved" || argv1 == "userunknown" || argv1 == "hostunknown"
50
- return false if argv1 != "notaccept"
48
+ return false if argv1 == Sisimai::Eb::Re___0 || argv1 == Sisimai::Eb::Re___1
49
+ return false if argv1 == Sisimai::Eb::ReSENT || argv1 == Sisimai::Eb::ReFEED || argv1 == Sisimai::Eb::ReAWAY
50
+ return true if argv1 == Sisimai::Eb::ReMOVE || argv1 == Sisimai::Eb::ReUSER || argv1 == Sisimai::Eb::ReHOST
51
+ return false if argv1 != Sisimai::Eb::Re00MX
51
52
 
52
53
  # NotAccept: 5xx => hard bounce, 4xx => soft bounce
53
54
  hardbounce = false
@@ -72,10 +73,10 @@ module Sisimai
72
73
  # @return [Boolean] true: is a soft bounce
73
74
  def is_softbounce(argv1 = '', argv2 = '')
74
75
  return false if argv1.to_s == ""
75
- return false if argv1 == "delivered" || argv1 == "feedback" || argv1 == "vacation"
76
- return false if argv1 == "hasmoved" || argv1 == "userunknown" || argv1 == "hostunknown"
77
- return true if argv1 == "undefined" || argv1 == "onhold"
78
- return true if argv1 != "notaccept"
76
+ return false if argv1 == Sisimai::Eb::ReSENT || argv1 == Sisimai::Eb::ReFEED || argv1 == Sisimai::Eb::ReAWAY
77
+ return false if argv1 == Sisimai::Eb::ReMOVE || argv1 == Sisimai::Eb::ReUSER || argv1 == Sisimai::Eb::ReHOST
78
+ return true if argv1 == Sisimai::Eb::Re___0 || argv1 == Sisimai::Eb::Re___0
79
+ return true if argv1 != Sisimai::Eb::Re00MX
79
80
 
80
81
  # NotAccept: 5xx => hard bounce, 4xx => soft bounce
81
82
  softbounce = false
@@ -46,6 +46,7 @@ module Sisimai
46
46
  # Sisimai::SMTP::Reply is utilities for getting SMTP Reply Code value from error message text.
47
47
  module Reply
48
48
  class << self
49
+ require 'sisimai/eb'
49
50
  ReplyCode2 = [
50
51
  # http://www.ietf.org/rfc/rfc5321.txt
51
52
  # 211 System status, or system help reply
@@ -111,28 +112,28 @@ module Sisimai
111
112
  ].freeze
112
113
  CodeOfSMTP = {'2' => ReplyCode2, '4' => ReplyCode4, '5' => ReplyCode5}.freeze
113
114
  Associated = {
114
- "422" => ["AUTH", "4.7.12", "securityerror"], # RFC5238
115
- "432" => ["AUTH", "4.7.12", "securityerror"], # RFC4954, RFC5321
116
- "451" => ["", "", "systemerror"], # RFC2465, RFC5321
117
- "452" => ["", "", "systemfull"], # RFC5321
118
- "454" => ["AUTH", "4.7.0", "securityerror"], # RFC3027, RFC4954
119
- "455" => ["", "", "syntaxerror"], # RFC5321
120
- "500" => ["", "", "syntaxerror"], # RFC5321
121
- "501" => ["", "", "syntaxerror"], # RFC5321
122
- "502" => ["", "", "syntaxerror"], # RFC5321
123
- "503" => ["", "", "syntaxerror"], # RFC5321
124
- "504" => ["", "", "syntaxerror"], # RFC5321
125
- "521" => ["CONN", "", "notaccept"], # RFC7504
126
- "523" => ["AUTH", "5.7.10", "securityerror"], # RFC5248
127
- "524" => ["AUTH", "5.7.11", "securityerror"], # RFC5248
128
- "525" => ["AUTH", "5.7.13", "securityerror"], # RFC5248
129
- "534" => ["AUTH", "5.7.9", "securityerror"], # RFC4954, RFC5248
130
- "535" => ["AUTH", "5.7.8", "securityerror"], # RFC4954, RFC5248
131
- "538" => ["AUTH", "5.7.11", "securityerror"], # RFC4954, RFC5248
132
- "551" => ["", "", "hasmoved"], # RFC5321, RFC5336, RFC6531
133
- "552" => ["", "", "mailboxfull"], # RFC5321
134
- "555" => ["", "", "syntaxerror"], # RFC5321
135
- "556" => ["RCPT", "", "notaccept"], # RFC7504
115
+ "422" => [Sisimai::Eb::CeAUTH, "4.7.12", Sisimai::Eb::ReSAFE], # RFC5238
116
+ "432" => [Sisimai::Eb::CeAUTH, "4.7.12", Sisimai::Eb::ReSAFE], # RFC4954, RFC5321
117
+ "451" => ["", "", Sisimai::Eb::RePROC], # RFC2465, RFC5321
118
+ "452" => ["", "", Sisimai::Eb::ReDISK], # RFC5321
119
+ "454" => [Sisimai::Eb::CeAUTH, "4.7.0", Sisimai::Eb::ReSAFE], # RFC3027, RFC4954
120
+ "455" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
121
+ "500" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
122
+ "501" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
123
+ "502" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
124
+ "503" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
125
+ "504" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
126
+ "521" => [Sisimai::Eb::CeCONN, "", Sisimai::Eb::Re00MX], # RFC7504
127
+ "523" => [Sisimai::Eb::CeAUTH, "5.7.10", Sisimai::Eb::ReSAFE], # RFC5248
128
+ "524" => [Sisimai::Eb::CeAUTH, "5.7.11", Sisimai::Eb::ReSAFE], # RFC5248
129
+ "525" => [Sisimai::Eb::CeAUTH, "5.7.13", Sisimai::Eb::ReSAFE], # RFC5248
130
+ "534" => [Sisimai::Eb::CeAUTH, "5.7.9", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
131
+ "535" => [Sisimai::Eb::CeAUTH, "5.7.8", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
132
+ "538" => [Sisimai::Eb::CeAUTH, "5.7.11", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
133
+ "551" => ["", "", Sisimai::Eb::ReMOVE], # RFC5321, RFC5336, RFC6531
134
+ "552" => ["", "", Sisimai::Eb::ReFULL], # RFC5321
135
+ "555" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
136
+ "556" => [Sisimai::Eb::CeRCPT, "", Sisimai::Eb::Re00MX], # RFC7504
136
137
  }.freeze
137
138
 
138
139
  # Check whether a reply code is a valid code or not
@@ -485,6 +485,7 @@ module Sisimai
485
485
  # reason from D.S.N. value, and getting D.S.N. from the text including D.S.N.
486
486
  module Status
487
487
  class << self
488
+ require "sisimai/eb"
488
489
  require "sisimai/rfc791"
489
490
 
490
491
  CodePatterns = [
@@ -494,150 +495,150 @@ module Sisimai
494
495
  %r/\b(2[.][0-7][.][0-7])\b/, # 2.1.5
495
496
  ]
496
497
  StandardCode = {
497
- '2.1.5' => 'delivered', # Successfully delivered
498
+ '2.1.5' => Sisimai::Eb::ReSENT, # Successfully delivered
498
499
  # ---------------------------------------------------------------------------------------
499
- '4.1.6' => 'hasmoved', # Destination mailbox has moved, No forwarding address
500
- '4.1.7' => 'rejected', # Bad sender's mailbox address syntax
501
- '4.1.8' => 'rejected', # Bad sender's system address
502
- '4.1.9' => 'systemerror', # Message relayed to non-compliant mailer
503
- '4.2.1' => 'suspend', # Mailbox disabled, not accepting messages
504
- '4.2.2' => 'mailboxfull', # Mailbox full
505
- '4.2.3' => 'emailtoolarge', # Message length exceeds administrative limit
506
- '4.2.4' => 'systemerror', # Mailing list expansion problem
507
- # '4.3.0' => 'systemerror', # Other or undefined mail system status
508
- '4.3.1' => 'systemfull', # Mail system full
509
- '4.3.2' => 'notaccept', # System not accepting network messages
510
- '4.3.3' => 'systemerror', # System not capable of selected features
511
- '4.3.5' => 'systemerror', # System incorrectly configured
512
- # '4.4.0' => 'networkerror', # Other or undefined network or routing status
513
- '4.4.1' => 'expired', # No answer from host
514
- '4.4.2' => 'networkerror', # Bad connection
515
- '4.4.3' => 'systemerror', # Directory server failure
516
- '4.4.4' => 'networkerror', # Unable to route
517
- '4.4.5' => 'systemfull', # Mail system congestion
518
- '4.4.6' => 'networkerror', # Routing loop detected
519
- '4.4.7' => 'expired', # Delivery time expired
520
- '4.4.8' => 'networkerror', # Retry on IPv4
521
- # '4.5.0' => 'networkerror', # Other or undefined protocol status
522
- '4.5.3' => 'ratelimited', # Too many recipients
523
- '4.5.5' => 'systemerror', # Wrong protocol version
524
- '4.6.0' => 'contenterror', # Other or undefined media error
525
- '4.6.2' => 'contenterror', # Conversion required and prohibited
526
- '4.6.5' => 'contenterror', # Conversion Failed
527
- # :'4.7.0' => 'securityerror', # Other or undefined security status
528
- '4.7.1' => 'blocked', # Delivery not authorized, message refused
529
- '4.7.2' => 'rejected', # Mailing list expansion prohibited
530
- '4.7.5' => 'securityerror', # Cryptographic failure
531
- '4.7.6' => 'securityerror', # Cryptographic algorithm not supported
532
- '4.7.7' => 'securityerror', # Message integrity failure
533
- '4.7.12' => 'securityerror', # A password transition is needed
534
- '4.7.15' => 'securityerror', # Priority Level is too low
535
- '4.7.16' => 'emailtoolarge', # Message is too big for the specified priority
536
- '4.7.24' => 'authfailure ', # SPF validation error
537
- '4.7.25' => 'requireptr', # Reverse DNS validation failed
500
+ '4.1.6' => Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
501
+ '4.1.7' => Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
502
+ '4.1.8' => Sisimai::Eb::ReFROM, # Bad sender's system address
503
+ '4.1.9' => Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
504
+ '4.2.1' => Sisimai::Eb::ReQUIT, # Mailbox disabled, not accepting messages
505
+ '4.2.2' => Sisimai::Eb::ReFULL, # Mailbox full
506
+ '4.2.3' => Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
507
+ '4.2.4' => Sisimai::Eb::RePROC, # Mailing list expansion problem
508
+ #'4.3.0' => Sisimai::Eb::ReSAFE, # Other or undefined mail system status
509
+ '4.3.1' => Sisimai::Eb::ReDISK, # Mail system full
510
+ '4.3.2' => Sisimai::Eb::Re00MX, # System not accepting network messages
511
+ '4.3.3' => Sisimai::Eb::RePROC, # System not capable of selected features
512
+ '4.3.5' => Sisimai::Eb::RePROC, # System incorrectly configured
513
+ #'4.4.0' => Sisimai::Eb::ReINET, # Other or undefined network or routing status
514
+ '4.4.1' => Sisimai::Eb::ReTIME, # No answer from host
515
+ '4.4.2' => Sisimai::Eb::ReINET, # Bad connection
516
+ '4.4.3' => Sisimai::Eb::RePROC, # Directory server failure
517
+ '4.4.4' => Sisimai::Eb::ReINET, # Unable to route
518
+ '4.4.5' => Sisimai::Eb::ReDISK, # Mail system congestion
519
+ '4.4.6' => Sisimai::Eb::ReINET, # Routing loop detected
520
+ '4.4.7' => Sisimai::Eb::ReTIME, # Delivery time expired
521
+ '4.4.8' => Sisimai::Eb::ReINET, # Retry on IPv4
522
+ #'4.5.0' => Sisimai::Eb::ReINET, # Other or undefined protocol status
523
+ '4.5.3' => Sisimai::Eb::ReRATE, # Too many recipients
524
+ '4.5.5' => Sisimai::Eb::RePROC, # Wrong protocol version
525
+ '4.6.0' => Sisimai::Eb::ReBODY, # Other or undefined media error
526
+ '4.6.2' => Sisimai::Eb::ReBODY, # Conversion required and prohibited
527
+ '4.6.5' => Sisimai::Eb::ReBODY, # Conversion Failed
528
+ #'4.7.0' => Sisimai::Eb::ReSAFE, # Other or undefined security status
529
+ '4.7.1' => Sisimai::Eb::ReBLOC, # Delivery not authorized, message refused
530
+ '4.7.2' => Sisimai::Eb::ReFROM, # Mailing list expansion prohibited
531
+ '4.7.5' => Sisimai::Eb::ReSAFE, # Cryptographic failure
532
+ '4.7.6' => Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
533
+ '4.7.7' => Sisimai::Eb::ReSAFE, # Message integrity failure
534
+ '4.7.12' => Sisimai::Eb::ReSAFE, # A password transition is needed
535
+ '4.7.15' => Sisimai::Eb::ReSAFE, # Priority Level is too low
536
+ '4.7.16' => Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
537
+ '4.7.24' => Sisimai::Eb::ReAUTH, # SPF validation error
538
+ '4.7.25' => Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
538
539
  # ---------------------------------------------------------------------------------------
539
- '5.1.0' => 'userunknown', # Other address status
540
- '5.1.1' => 'userunknown', # Bad destination mailbox address
541
- '5.1.2' => 'hostunknown', # Bad destination system address
542
- '5.1.3' => 'userunknown', # Bad destination mailbox address syntax
543
- '5.1.4' => 'filtered', # Destination mailbox address ambiguous
544
- '5.1.6' => 'hasmoved', # Destination mailbox has moved, No forwarding address
545
- '5.1.7' => 'rejected', # Bad sender's mailbox address syntax
546
- '5.1.8' => 'rejected', # Bad sender's system address
547
- '5.1.9' => 'systemerror', # Message relayed to non-compliant mailer
548
- '5.1.10' => 'notaccept', # Recipient address has null MX
549
- '5.2.0' => 'filtered', # Other or undefined mailbox status
550
- '5.2.1' => 'filtered', # Mailbox disabled, not accepting messages
551
- '5.2.2' => 'mailboxfull', # Mailbox full
552
- '5.2.3' => 'emailtoolarge', # Message length exceeds administrative limit
553
- '5.2.4' => 'systemerror', # Mailing list expansion problem
554
- '5.3.0' => 'systemerror', # Other or undefined mail system status
555
- '5.3.1' => 'systemfull', # Mail system full
556
- '5.3.2' => 'notaccept', # System not accepting network messages
557
- '5.3.3' => 'systemerror', # System not capable of selected features
558
- '5.3.4' => 'emailtoolarge', # Message too big for system
559
- '5.3.5' => 'systemerror', # System incorrectly configured
560
- '5.4.0' => 'networkerror', # Other or undefined network or routing status
561
- '5.4.3' => 'systemerror', # Directory server failure
562
- '5.4.4' => 'hostunknown', # Unable to route
563
- '5.5.2' => 'systemerror', # If the server cannot BASE64 decode any client response (AUTH)
564
- '5.5.3' => 'ratelimited', # Too many recipients
565
- '5.5.4' => 'systemerror', # Invalid command arguments
566
- '5.5.5' => 'systemerror', # Wrong protocol version
567
- '5.5.6' => 'syntaxerror', # Authentication Exchange line is too long
568
- '5.6.0' => 'contenterror', # Other or undefined media error
569
- '5.6.1' => 'contenterror', # Media not supported
570
- '5.6.2' => 'contenterror', # Conversion required and prohibited
571
- '5.6.3' => 'contenterror', # Conversion required but not supported
572
- '5.6.5' => 'contenterror', # Conversion Failed
573
- '5.6.6' => 'contenterror', # Message content not available
574
- '5.6.7' => 'rejected', # Non-ASCII addresses not permitted for that sender/recipient
575
- '5.6.8' => 'contenterror', # UTF-8 string reply is required, but not permitted by the SMTP client
576
- '5.6.9' => 'contenterror', # UTF-8 header message cannot be transferred to one or more recipients
577
- '5.7.0' => 'securityerror', # Other or undefined security status
578
- '5.7.1' => 'securityerror', # Delivery not authorized, message refused
579
- '5.7.2' => 'securityerror', # Mailing list expansion prohibited
580
- '5.7.3' => 'securityerror', # Security conversion required but not possible
581
- '5.7.4' => 'securityerror', # Security features not supported
582
- '5.7.5' => 'securityerror', # Cryptographic failure
583
- '5.7.6' => 'securityerror', # Cryptographic algorithm not supported
584
- '5.7.7' => 'securityerror', # Message integrity failure
585
- '5.7.8' => 'securityerror', # Authentication credentials invalid
586
- '5.7.9' => 'securityerror', # Authentication mechanism is too weak
587
- '5.7.10' => 'securityerror', # Encryption Needed
588
- '5.7.11' => 'securityerror', # Encryption required for requested authentication mechanism
589
- '5.7.13' => 'suspend', # User Account Disabled
590
- '5.7.14' => 'securityerror', # Trust relationship required
591
- '5.7.15' => 'securityerror', # Priority Level is too low
592
- '5.7.16' => 'emailtoolarge', # Message is too big for the specified priority
593
- '5.7.17' => 'hasmoved', # Mailbox owner has changed
594
- '5.7.18' => 'hasmoved', # Domain owner has changed
595
- '5.7.19' => 'systemerror', # RRVS test cannot be completed
596
- '5.7.20' => 'authfailure', # No passing DKIM signature found
597
- '5.7.21' => 'authfailure', # No acceptable DKIM signature found
598
- '5.7.22' => 'authfailure', # No valid author-matched DKIM signature found
599
- '5.7.23' => 'authfailure', # SPF validation failed
600
- '5.7.24' => 'authfailure', # SPF validation error
601
- '5.7.25' => 'requireptr', # Reverse DNS validation failed
602
- '5.7.26' => 'authfailure', # Multiple authentication checks failed
603
- '5.7.27' => 'notaccept', # MX resource record of a destination host is Null MX: RFC7505
604
- '5.7.28' => 'spamdetected', # The message appears to be part of a mail flood of similar abusive messages.
605
- '5.7.29' => 'authfailure', # This status code may be returned when a message fails ARC validation.
606
- '5.7.30' => 'failedstarttls', # REQUIRETLS support required
540
+ '5.1.0' => Sisimai::Eb::ReUSER, # Other address status
541
+ '5.1.1' => Sisimai::Eb::ReUSER, # Bad destination mailbox address
542
+ '5.1.2' => Sisimai::Eb::ReHOST, # Bad destination system address
543
+ '5.1.3' => Sisimai::Eb::ReUSER, # Bad destination mailbox address syntax
544
+ '5.1.4' => Sisimai::Eb::ReFILT, # Destination mailbox address ambiguous
545
+ '5.1.6' => Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
546
+ '5.1.7' => Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
547
+ '5.1.8' => Sisimai::Eb::ReFROM, # Bad sender's system address
548
+ '5.1.9' => Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
549
+ '5.1.10' => Sisimai::Eb::Re00MX, # Recipient address has null MX
550
+ '5.2.0' => Sisimai::Eb::ReFILT, # Other or undefined mailbox status
551
+ '5.2.1' => Sisimai::Eb::ReFILT, # Mailbox disabled, not accepting messages
552
+ '5.2.2' => Sisimai::Eb::ReFULL, # Mailbox full
553
+ '5.2.3' => Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
554
+ '5.2.4' => Sisimai::Eb::RePROC, # Mailing list expansion problem
555
+ '5.3.0' => Sisimai::Eb::RePROC, # Other or undefined mail system status
556
+ '5.3.1' => Sisimai::Eb::ReDISK, # Mail system full
557
+ '5.3.2' => Sisimai::Eb::Re00MX, # System not accepting network messages
558
+ '5.3.3' => Sisimai::Eb::RePROC, # System not capable of selected features
559
+ '5.3.4' => Sisimai::Eb::ReSIZE, # Message too big for system
560
+ '5.3.5' => Sisimai::Eb::RePROC, # System incorrectly configured
561
+ '5.4.0' => Sisimai::Eb::ReINET, # Other or undefined network or routing status
562
+ '5.4.3' => Sisimai::Eb::RePROC, # Directory server failure
563
+ '5.4.4' => Sisimai::Eb::ReHOST, # Unable to route
564
+ '5.5.2' => Sisimai::Eb::RePROC, # If the server cannot BASE64 decode any client response (AUTH)
565
+ '5.5.3' => Sisimai::Eb::ReRATE, # Too many recipients
566
+ '5.5.4' => Sisimai::Eb::RePROC, # Invalid command arguments
567
+ '5.5.5' => Sisimai::Eb::RePROC, # Wrong protocol version
568
+ '5.5.6' => Sisimai::Eb::ReCOMM, # Authentication Exchange line is too long
569
+ '5.6.0' => Sisimai::Eb::ReBODY, # Other or undefined media error
570
+ '5.6.1' => Sisimai::Eb::ReBODY, # Media not supported
571
+ '5.6.2' => Sisimai::Eb::ReBODY, # Conversion required and prohibited
572
+ '5.6.3' => Sisimai::Eb::ReBODY, # Conversion required but not supported
573
+ '5.6.5' => Sisimai::Eb::ReBODY, # Conversion Failed
574
+ '5.6.6' => Sisimai::Eb::ReBODY, # Message content not available
575
+ '5.6.7' => Sisimai::Eb::ReFROM, # Non-ASCII addresses not permitted for that sender/recipient
576
+ '5.6.8' => Sisimai::Eb::ReBODY, # UTF-8 string reply is required, but not permitted by the SMTP client
577
+ '5.6.9' => Sisimai::Eb::ReBODY, # UTF-8 header message cannot be transferred to one or more recipients
578
+ '5.7.0' => Sisimai::Eb::ReSAFE, # Other or undefined security status
579
+ '5.7.1' => Sisimai::Eb::ReSAFE, # Delivery not authorized, message refused
580
+ '5.7.2' => Sisimai::Eb::ReSAFE, # Mailing list expansion prohibited
581
+ '5.7.3' => Sisimai::Eb::ReSAFE, # Security conversion required but not possible
582
+ '5.7.4' => Sisimai::Eb::ReSAFE, # Security features not supported
583
+ '5.7.5' => Sisimai::Eb::ReSAFE, # Cryptographic failure
584
+ '5.7.6' => Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
585
+ '5.7.7' => Sisimai::Eb::ReSAFE, # Message integrity failure
586
+ '5.7.8' => Sisimai::Eb::ReSAFE, # Authentication credentials invalid
587
+ '5.7.9' => Sisimai::Eb::ReSAFE, # Authentication mechanism is too weak
588
+ '5.7.10' => Sisimai::Eb::ReSAFE, # Encryption Needed
589
+ '5.7.11' => Sisimai::Eb::ReSAFE, # Encryption required for requested authentication mechanism
590
+ '5.7.13' => Sisimai::Eb::ReQUIT, # User Account Disabled
591
+ '5.7.14' => Sisimai::Eb::ReSAFE, # Trust relationship required
592
+ '5.7.15' => Sisimai::Eb::ReSAFE, # Priority Level is too low
593
+ '5.7.16' => Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
594
+ '5.7.17' => Sisimai::Eb::ReMOVE, # Mailbox owner has changed
595
+ '5.7.18' => Sisimai::Eb::ReMOVE, # Domain owner has changed
596
+ '5.7.19' => Sisimai::Eb::RePROC, # RRVS test cannot be completed
597
+ '5.7.20' => Sisimai::Eb::ReAUTH, # No passing DKIM signature found
598
+ '5.7.21' => Sisimai::Eb::ReAUTH, # No acceptable DKIM signature found
599
+ '5.7.22' => Sisimai::Eb::ReAUTH, # No valid author-matched DKIM signature found
600
+ '5.7.23' => Sisimai::Eb::ReAUTH, # SPF validation failed
601
+ '5.7.24' => Sisimai::Eb::ReAUTH, # SPF validation error
602
+ '5.7.25' => Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
603
+ '5.7.26' => Sisimai::Eb::ReAUTH, # Multiple authentication checks failed
604
+ '5.7.27' => Sisimai::Eb::Re00MX, # MX resource record of a destination host is Null MX: RFC7505
605
+ '5.7.28' => Sisimai::Eb::ReSPAM, # The message appears to be part of a mail flood of similar abusive messages.
606
+ '5.7.29' => Sisimai::Eb::ReAUTH, # This status code may be returned when a message fails ARC validation.
607
+ '5.7.30' => Sisimai::Eb::ReTTLS, # REQUIRETLS support required
607
608
  }.freeze
608
609
 
609
610
  InternalCode = {
610
- 'authfailure' => ['5.9.130', '4.9.130'],
611
- 'badreputation' => ['5.9.132', '4.9.132'],
612
- 'blocked' => ['5.9.134', '4.9.134'],
613
- 'contenterror' => ['5.9.160', '4.9.160'],
614
- 'emailtoolarge' => ['5.9.161', '4.9.161'],
615
- 'expired' => ['5.9.340', '4.9.340'],
616
- 'failedstarttls' => ['5.9.350', '4.9.350'],
617
- 'filtered' => ['5.9.210', '4.9.210'],
618
- 'hasmoved' => ['5.9.211', ''],
619
- 'hostunknown' => ['5.9.212', ''],
620
- 'mailboxfull' => ['5.9.220', '4.9.220'],
621
- 'mailererror' => ['5.9.230', '4.9.230'],
622
- 'networkerror' => ['5.9.341', '4.9.341'],
623
- 'norelaying' => ['5.9.214', '4.9.214'],
624
- 'notaccept' => ['5.9.215', '4.9.215'],
625
- 'notcompliantrfc' => ['5.9.162', '4.9.162'],
626
- 'onhold' => ['5.9.301', '4.9.301'],
627
- 'policyviolation' => ['5.9.371', '4.9.371'],
628
- 'ratelimited' => ['5.9.131', '4.9.131'],
629
- 'rejected' => ['5.9.110', '4.9.110'],
630
- 'requireptr' => ['5.9.133', '4.9.133'],
631
- 'securityerror' => ['5.9.370', '4.9.370'],
632
- 'spamdetected' => ['5.9.164', '4.9.164'],
633
- 'suppressed' => ['5.9.310', '4.9.310'],
634
- 'suspend' => ['5.9.221', '4.9.221'],
635
- 'syntaxerror' => ['5.9.351', '4.9.351'],
636
- 'systemerror' => ['5.9.231', '4.9.231'],
637
- 'systemfull' => ['5.9.232', '4.9.232'],
638
- 'undefined' => ['5.9.300', '4.9.300'],
639
- 'userunknown' => ['5.9.213', ''],
640
- 'virusdetected' => ['5.9.165', '4.9.165'],
611
+ Sisimai::Eb::ReAUTH => ['5.9.130', '4.9.130'],
612
+ Sisimai::Eb::ReFAMA => ['5.9.132', '4.9.132'],
613
+ Sisimai::Eb::ReBLOC => ['5.9.134', '4.9.134'],
614
+ Sisimai::Eb::ReBODY => ['5.9.160', '4.9.160'],
615
+ Sisimai::Eb::ReSIZE => ['5.9.161', '4.9.161'],
616
+ Sisimai::Eb::ReTIME => ['5.9.340', '4.9.340'],
617
+ Sisimai::Eb::ReTTLS => ['5.9.350', '4.9.350'],
618
+ Sisimai::Eb::ReFILT => ['5.9.210', '4.9.210'],
619
+ Sisimai::Eb::ReMOVE => ['5.9.211', ''],
620
+ Sisimai::Eb::ReHOST => ['5.9.212', ''],
621
+ Sisimai::Eb::ReFULL => ['5.9.220', '4.9.220'],
622
+ Sisimai::Eb::ReUNIX => ['5.9.230', '4.9.230'],
623
+ Sisimai::Eb::ReINET => ['5.9.341', '4.9.341'],
624
+ Sisimai::Eb::RePASS => ['5.9.214', '4.9.214'],
625
+ Sisimai::Eb::Re00MX => ['5.9.215', '4.9.215'],
626
+ Sisimai::Eb::ReNRFC => ['5.9.162', '4.9.162'],
627
+ Sisimai::Eb::Re___1 => ['5.9.301', '4.9.301'],
628
+ Sisimai::Eb::ReWONT => ['5.9.371', '4.9.371'],
629
+ Sisimai::Eb::ReRATE => ['5.9.131', '4.9.131'],
630
+ Sisimai::Eb::ReFROM => ['5.9.110', '4.9.110'],
631
+ Sisimai::Eb::ReQPTR => ['5.9.133', '4.9.133'],
632
+ Sisimai::Eb::ReSAFE => ['5.9.370', '4.9.370'],
633
+ Sisimai::Eb::ReSPAM => ['5.9.164', '4.9.164'],
634
+ Sisimai::Eb::ReSTOP => ['5.9.310', '4.9.310'],
635
+ Sisimai::Eb::ReQUIT => ['5.9.221', '4.9.221'],
636
+ Sisimai::Eb::ReCOMM => ['5.9.351', '4.9.351'],
637
+ Sisimai::Eb::RePROC => ['5.9.231', '4.9.231'],
638
+ Sisimai::Eb::ReDISK => ['5.9.232', '4.9.232'],
639
+ Sisimai::Eb::Re___0 => ['5.9.300', '4.9.300'],
640
+ Sisimai::Eb::ReUSER => ['5.9.213', ''],
641
+ Sisimai::Eb::ReEXEC => ['5.9.165', '4.9.165'],
641
642
  }.freeze
642
643
 
643
644
  # Convert from the reason string to the internal status code
@@ -839,7 +840,7 @@ module Sisimai
839
840
  when "4.4.7", "4.7.0" then return codeinmesg
840
841
  when "5.1.3" then return codeinmesg if codeinmesg.start_with?('5.7.')
841
842
  when "5.1.1"
842
- # "5.1.1" is a code of "userunknown"
843
+ # "5.1.1" is a code of "UserUnknown"
843
844
  return statuscode if codeinmesg.start_with?('5.5.') || zeroindex1['error'] > 0
844
845
  return codeinmesg
845
846
  end
@@ -3,6 +3,7 @@ module Sisimai
3
3
  # Sisimai::SMTP::Transcript is a decoder for the transcript logs of the SMTP session
4
4
  module Transcript
5
5
  class << self
6
+ require 'sisimai/eb'
6
7
  require 'sisimai/smtp/reply'
7
8
  require 'sisimai/smtp/status'
8
9
 
@@ -43,7 +44,7 @@ module Sisimai
43
44
  # An SMTP server response starting with '<<<' is the first
44
45
  esmtp << table.call
45
46
  cx = esmtp[-1]
46
- cx['command'] = 'CONN'
47
+ cx['command'] = Sisimai::Eb::CeCONN
47
48
  argv0 = argv0[p2, argv0.size] if p2 > -1
48
49
  else
49
50
  # An SMTP command starting with '>>>' is the first
@@ -68,7 +69,7 @@ module Sisimai
68
69
  cx = esmtp[-1]
69
70
  cx['command'] = thecommand.upcase
70
71
 
71
- if thecommand =~ /\A(?:MAIL|RCPT|XFORWARD)/
72
+ if thecommand == Sisimai::Eb::CeMAIL || thecommand == Sisimai::Eb::CeRCPT || thecommand == Sisimai::Eb::CeXFWD
72
73
  # MAIL or RCPT
73
74
  if cv = commandarg.match(/\A(?:FROM|TO):[ ]*<(.+[@].+)>[ ]*(.*)\z/)
74
75
  # >>> MAIL FROM: <neko@example.com> SIZE=65535