sisimai 5.7.0-java → 5.7.2-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 (102) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +1 -1
  3. data/.github/workflows/rake-test.yml +1 -1
  4. data/ChangeLog.md +25 -0
  5. data/README-JA.md +14 -13
  6. data/README.md +12 -12
  7. data/lib/sisimai/arf.rb +2 -1
  8. data/lib/sisimai/eb.rb +116 -0
  9. data/lib/sisimai/fact.rb +24 -17
  10. data/lib/sisimai/lda.rb +20 -18
  11. data/lib/sisimai/lhost/amazonses.rb +11 -10
  12. data/lib/sisimai/lhost/courier.rb +4 -3
  13. data/lib/sisimai/lhost/domino.rb +2 -1
  14. data/lib/sisimai/lhost/einsundeins.rb +3 -2
  15. data/lib/sisimai/lhost/exchange2003.rb +8 -7
  16. data/lib/sisimai/lhost/exchange2007.rb +14 -13
  17. data/lib/sisimai/lhost/exim.rb +7 -6
  18. data/lib/sisimai/lhost/ezweb.rb +4 -3
  19. data/lib/sisimai/lhost/fml.rb +4 -3
  20. data/lib/sisimai/lhost/gmail.rb +10 -9
  21. data/lib/sisimai/lhost/googlegroups.rb +3 -2
  22. data/lib/sisimai/lhost/googleworkspace.rb +2 -1
  23. data/lib/sisimai/lhost/imailserver.rb +3 -2
  24. data/lib/sisimai/lhost/kddi.rb +4 -3
  25. data/lib/sisimai/lhost/notes.rb +2 -1
  26. data/lib/sisimai/lhost/postfix.rb +7 -6
  27. data/lib/sisimai/lhost/qmail.rb +10 -9
  28. data/lib/sisimai/lhost/sendmail.rb +4 -3
  29. data/lib/sisimai/lhost/trendmicro.rb +2 -1
  30. data/lib/sisimai/lhost/v5sendmail.rb +2 -1
  31. data/lib/sisimai/lhost/verizon.rb +3 -2
  32. data/lib/sisimai/message.rb +5 -6
  33. data/lib/sisimai/reason/authfailure.rb +6 -5
  34. data/lib/sisimai/reason/badreputation.rb +5 -4
  35. data/lib/sisimai/reason/blocked.rb +6 -5
  36. data/lib/sisimai/reason/contenterror.rb +6 -5
  37. data/lib/sisimai/reason/delivered.rb +3 -2
  38. data/lib/sisimai/reason/emailtoolarge.rb +6 -5
  39. data/lib/sisimai/reason/expired.rb +3 -2
  40. data/lib/sisimai/reason/failedstarttls.rb +5 -3
  41. data/lib/sisimai/reason/feedback.rb +2 -1
  42. data/lib/sisimai/reason/filtered.rb +9 -8
  43. data/lib/sisimai/reason/hasmoved.rb +5 -4
  44. data/lib/sisimai/reason/hostunknown.rb +5 -4
  45. data/lib/sisimai/reason/mailboxfull.rb +7 -6
  46. data/lib/sisimai/reason/mailererror.rb +3 -2
  47. data/lib/sisimai/reason/networkerror.rb +3 -2
  48. data/lib/sisimai/reason/norelaying.rb +4 -3
  49. data/lib/sisimai/reason/notaccept.rb +5 -4
  50. data/lib/sisimai/reason/notcompliantrfc.rb +4 -3
  51. data/lib/sisimai/reason/onhold.rb +8 -7
  52. data/lib/sisimai/reason/policyviolation.rb +7 -6
  53. data/lib/sisimai/reason/ratelimited.rb +5 -4
  54. data/lib/sisimai/reason/rejected.rb +18 -14
  55. data/lib/sisimai/reason/requireptr.rb +5 -4
  56. data/lib/sisimai/reason/securityerror.rb +4 -3
  57. data/lib/sisimai/reason/spamdetected.rb +6 -5
  58. data/lib/sisimai/reason/suppressed.rb +4 -3
  59. data/lib/sisimai/reason/suspend.rb +4 -3
  60. data/lib/sisimai/reason/syntaxerror.rb +4 -3
  61. data/lib/sisimai/reason/systemerror.rb +3 -2
  62. data/lib/sisimai/reason/systemfull.rb +4 -3
  63. data/lib/sisimai/reason/undefined.rb +2 -1
  64. data/lib/sisimai/reason/userunknown.rb +13 -9
  65. data/lib/sisimai/reason/vacation.rb +2 -1
  66. data/lib/sisimai/reason/virusdetected.rb +6 -5
  67. data/lib/sisimai/reason.rb +45 -40
  68. data/lib/sisimai/rfc1894.rb +8 -2
  69. data/lib/sisimai/rfc2045.rb +6 -3
  70. data/lib/sisimai/rfc3464/thirdparty.rb +10 -9
  71. data/lib/sisimai/rfc3834.rb +4 -2
  72. data/lib/sisimai/rhost/aol.rb +3 -2
  73. data/lib/sisimai/rhost/apple.rb +12 -11
  74. data/lib/sisimai/rhost/cloudflare.rb +3 -2
  75. data/lib/sisimai/rhost/cox.rb +38 -37
  76. data/lib/sisimai/rhost/facebook.rb +17 -16
  77. data/lib/sisimai/rhost/franceptt.rb +39 -38
  78. data/lib/sisimai/rhost/godaddy.rb +35 -34
  79. data/lib/sisimai/rhost/google.rb +22 -21
  80. data/lib/sisimai/rhost/gsuite.rb +8 -7
  81. data/lib/sisimai/rhost/iua.rb +11 -10
  82. data/lib/sisimai/rhost/kddi.rb +3 -2
  83. data/lib/sisimai/rhost/messagelabs.rb +13 -12
  84. data/lib/sisimai/rhost/microsoft.rb +33 -32
  85. data/lib/sisimai/rhost/mimecast.rb +18 -17
  86. data/lib/sisimai/rhost/nttdocomo.rb +10 -9
  87. data/lib/sisimai/rhost/outlook.rb +3 -2
  88. data/lib/sisimai/rhost/spectrum.rb +19 -18
  89. data/lib/sisimai/rhost/tencent.rb +10 -9
  90. data/lib/sisimai/rhost/yahooinc.rb +11 -10
  91. data/lib/sisimai/rhost/zoho.rb +8 -7
  92. data/lib/sisimai/smtp/command.rb +13 -8
  93. data/lib/sisimai/smtp/failure.rb +9 -8
  94. data/lib/sisimai/smtp/reply.rb +23 -22
  95. data/lib/sisimai/smtp/status.rb +141 -140
  96. data/lib/sisimai/smtp/transcript.rb +3 -2
  97. data/lib/sisimai/string.rb +4 -3
  98. data/lib/sisimai/version.rb +1 -1
  99. data/lib/sisimai.rb +2 -1
  100. data/set-of-emails/maildir/bsd/lhost-postfix-81.eml +130 -0
  101. data/set-of-emails/should-not-crash/go-423-deeply-nested-mime-parts.eml +20050 -0
  102. metadata +5 -2
@@ -5,10 +5,11 @@ module Sisimai
5
5
  # is called only Sisimai::Fact class.
6
6
  module Mimecast
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
10
  # - https://community.mimecast.com/s/article/email-security-cloud-gateway-mimecast-smtp-error-codes
10
11
  # - https://mimecastsupport.zendesk.com/hc/en-us/articles/34000709564691-Policies-Mimecast-SMTP-Error-Codes
11
- 'authfailure' => [
12
+ Sisimai::Eb::ReAUTH => [
12
13
  # - The inbound message has been rejected because the originated IP address isn't list-
13
14
  # ed in the published SPF records for the sending domain.
14
15
  # - Ensure all the IP addresses for your mail servers are listed in your SPF records.
@@ -30,7 +31,7 @@ module Sisimai
30
31
  # - Ensure all the IP addresses for your mail servers are listed in your SPF records.
31
32
  [550, 'dmarc sender invalid - envelope rejected'],
32
33
  ],
33
- 'badreputation' => [
34
+ Sisimai::Eb::ReFAMA => [
34
35
  # - The sending mail server is subjected to Greylisting. This requires the server to
35
36
  # retry the connection, between one minute and 12 hours. Alternatively, the sender's
36
37
  # IP address has a poor reputation.
@@ -45,7 +46,7 @@ module Sisimai
45
46
  # You can request a review of your source IP ranges by completing our online form.
46
47
  [550, 'local ct ip reputation - (reject)'],
47
48
  ],
48
- 'blocked' => [
49
+ Sisimai::Eb::ReBLOC => [
49
50
  # - Sender address blocked.
50
51
  # A Blocked Senders Policy has blocked the sender's IP address.
51
52
  # - The sender's IP address has been blocked by a Blocked Senders Policy.
@@ -69,7 +70,7 @@ module Sisimai
69
70
  # the associated IP address from the RBL.
70
71
  #[550, '< details of RBL >'], NEED AN ACTUAL ERROR MESSAGE STRING
71
72
  ],
72
- 'emailtoolarge' => [
73
+ Sisimai::Eb::ReSIZE => [
73
74
  # - The email size either exceeds an Email Size Limit policy or is larger than the
74
75
  # Mimecast service limit. The default is 100 MB for the Legacy MTA, and 200 MB for
75
76
  # "the Latest MTA".
@@ -78,7 +79,7 @@ module Sisimai
78
79
  # sage with a 70 MB attachment, can have an overall size larger than 100 MB).
79
80
  [554, 'maximum email size exceeded'],
80
81
  ],
81
- 'expired' => [
82
+ Sisimai::Eb::ReTIME => [
82
83
  # - Journal messages past the expiration
83
84
  # - Attempts are being made to journal mail past the set expiry threshold.
84
85
  # A retry response will replace the failure because the message is marked for retry
@@ -87,7 +88,7 @@ module Sisimai
87
88
  # Discontinue journaling old messages past the expiry threshold.
88
89
  [550, 'journal messages past the expiration'],
89
90
  ],
90
- 'failedstarttls' => [
91
+ Sisimai::Eb::ReTTLS => [
91
92
  # - SMTP inbound TLS has been enabled but no SSL certificate (or no valid certificate)
92
93
  # has been selected to be used.
93
94
  # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
@@ -121,7 +122,7 @@ module Sisimai
121
122
  # - Check you DNS has the required umbrella accounts listed as comma-separated values.
122
123
  [554, 'configuration is invalid for this certificate'],
123
124
  ],
124
- 'networkerror' => [
125
+ Sisimai::Eb::ReINET => [
125
126
  # - The recipients' domains have MX records configured incorrectly
126
127
  # - Check and remove any MX records that point to hostnames with outbound references.
127
128
  # Only Inbound smart hosts are supported on MX records.
@@ -134,7 +135,7 @@ module Sisimai
134
135
  # are configured on the mail servers.
135
136
  [554, 'mail loop detected'],
136
137
  ],
137
- 'norelaying' => [
138
+ Sisimai::Eb::RePASS => [
138
139
  # - Both the sender and recipient domains specified in the transmission are external to
139
140
  # Mimecast, and aren't allowed to relay through the Mimecast service and/or the con-
140
141
  # necting IP address isn't recognized as authorized.
@@ -143,12 +144,12 @@ module Sisimai
143
144
  [451, 'open relay not allowed'],
144
145
  [451, 'open relay is not allowed'],
145
146
  ],
146
- 'notaccept' => [
147
+ Sisimai::Eb::Re00MX => [
147
148
  # - The customer account Inbound emails are disabled in the Administration Console.
148
149
  # - Contact Mimecast Support if the account's inbound traffic should be allowed.
149
150
  [451, 'account inbounds disabled'],
150
151
  ],
151
- 'onhold' => [
152
+ Sisimai::Eb::Re___1 => [
152
153
  # - The customer account outbound emails are disabled in the Administration Console.
153
154
  # - Contact Mimecast Support if the account's outbound traffic should be allowed.
154
155
  [451, 'account outbounds disabled'],
@@ -164,7 +165,7 @@ module Sisimai
164
165
  # Discontinue journaling old messages past the expiry threshold.
165
166
  [550, 'journal message past expiration'],
166
167
  ],
167
- 'policyviolation' => [
168
+ Sisimai::Eb::ReWONT => [
168
169
  # - The message has triggered an Anti-Spoofing policy.
169
170
  # - Create an Anti-Spoofing policy to take no action for the sender's address or IP ad-
170
171
  # dress.
@@ -181,7 +182,7 @@ module Sisimai
181
182
  [554, 'host network not allowed'],
182
183
  [554, 'host network, not allowed'],
183
184
  ],
184
- 'ratelimited' => [
185
+ Sisimai::Eb::ReRATE => [
185
186
  # - There are too many concurrent inbound connections for the account. The default is 20.
186
187
  # - The IP address is automatically removed from the block list after five minutes.
187
188
  # Continued invalid connections result in the IP being readded to the block list. En-
@@ -206,7 +207,7 @@ module Sisimai
206
207
  # - Send the messages in smaller chunks to recipients.
207
208
  [550, 'exceeding outbound thread limit'],
208
209
  ],
209
- 'rejected' => [
210
+ Sisimai::Eb::ReFROM => [
210
211
  # - The sender's email address or domain has triggered a Blocked Senders Policy or
211
212
  # there's an SPF hard rejection.
212
213
  # - Delete or modify the Blocked Senders policy to exclude the sender address.
@@ -224,7 +225,7 @@ module Sisimai
224
225
  [550, 'rejected by header-based blocked senders - block policy for header from'],
225
226
  [550, 'envelope rejected - block policy for envelope from address'],
226
227
  ],
227
- 'securityerror' => [
228
+ Sisimai::Eb::ReSAFE => [
228
229
  # - Messages submitted to SMTP port 587 require authentication. This error indicates
229
230
  # the authentication details provided were incorrect.
230
231
  # - Check your authentication details match an internal email address in Mimecast, with
@@ -234,7 +235,7 @@ module Sisimai
234
235
  [550, 'submitter failed to disabled'],
235
236
  [550, 'submitter failed to authenticate'],
236
237
  ],
237
- 'spamdetected' => [
238
+ Sisimai::Eb::ReSPAM => [
238
239
  # - A signature was detected that could either be a virus, or a spam score over the
239
240
  # maximum threshold. The spam score isn't available in the Administration Console. If
240
241
  # you aren't a Mimecast customer but have emails rejected with this error code, con-
@@ -247,7 +248,7 @@ module Sisimai
247
248
  # Activity and searching for the required email address.
248
249
  [554, 'email rejected due to security policies'],
249
250
  ],
250
- 'systemerror' => [
251
+ Sisimai::Eb::RePROC => [
251
252
  # - The Mimecast server is under maximum load.
252
253
  # - No action is required from the end-user. The message will retry 30 times and when
253
254
  # server resources are available, the message is processed.
@@ -270,7 +271,7 @@ module Sisimai
270
271
  # - Contact Mimecast Support.
271
272
  [451, 'unable to process an email at this time'],
272
273
  ],
273
- 'userunknown' => [
274
+ Sisimai::Eb::ReUSER => [
274
275
  # - The email address isn't a valid SMTP address.
275
276
  # - The sender must resend the message to a valid internal email address.
276
277
  [501, 'invalid address'],
@@ -5,11 +5,12 @@ module Sisimai
5
5
  # is called only Sisimai::Fact class.
6
6
  module NTTDOCOMO
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'mailboxfull' => ['552 too much mail data'],
10
- 'ratelimited' => ['552 too many recipients'],
11
- 'syntaxerror' => ['503 bad sequence of commands', '504 command parameter not implemented'],
12
- 'userunknown' => ['550 unknown user'],
10
+ Sisimai::Eb::ReFULL => ['552 too much mail data'],
11
+ Sisimai::Eb::ReRATE => ['552 too many recipients'],
12
+ Sisimai::Eb::ReCOMM => ['503 bad sequence of commands', '504 command parameter not implemented'],
13
+ Sisimai::Eb::ReUSER => ['550 unknown user'],
13
14
  }.freeze
14
15
 
15
16
  # Detect bounce reason from NTT DOCOMO
@@ -44,15 +45,15 @@ module Sisimai
44
45
  # Final-Recipient: RFC822; ***@docomo.ne.jp
45
46
  # Action: failed
46
47
  # Status: 5.2.0
47
- return 'userunknown' if statuscode == '5.1.1' || statuscode == '5.9.213'
48
- return 'filtered' if statuscode == '5.2.0'
48
+ return Sisimai::Eb::ReUSER if statuscode == '5.1.1' || statuscode == '5.9.213'
49
+ return Sisimai::Eb::ReFILT if statuscode == '5.2.0'
49
50
 
50
51
  MessagesOf.each_key do |e|
51
52
  # The value of "Diagnostic-Code:" field is not empty
52
53
  # - The key name is a bounce reason name
53
54
  # - https://github.com/sisimai/go-sisimai/issues/64
54
55
  # - After March 12, 2025, if an error message contains "550 Unknown user", the
55
- # bounce reason will be definitively "userunknown". This is because NTT DOCOMO
56
+ # bounce reason will be definitively "UserUnknown". This is because NTT DOCOMO
56
57
  # no longer rejects emails via SMTP for domain-specific rejection or specified
57
58
  # reception filters.
58
59
  return e if MessagesOf[e].any? { |a| esmtperror.include?(a) }
@@ -84,8 +85,8 @@ module Sisimai
84
85
  # Status: 5.0.0
85
86
  # Remote-MTA: dns; mfsmax.docomo.ne.jp
86
87
  # Diagnostic-Code: smtp; 550 Unknown user ***@docomo.ne.jp
87
- return 'userunknown' if thecommand == 'RCPT'
88
- return 'rejected' if thecommand == 'DATA'
88
+ return Sisimai::Eb::ReUSER if thecommand == Sisimai::Eb::CeRCPT
89
+ return Sisimai::Eb::ReFROM if thecommand == Sisimai::Eb::CeDATA
89
90
  end
90
91
 
91
92
  # 1. Rejected by other SMTP commands: AUTH, MAIL,
@@ -5,9 +5,10 @@ module Sisimai
5
5
  # only from Sisimai::Fact class.
6
6
  module Outlook
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- "hostunknown" => ["The mail could not be delivered to the recipient because the domain is not reachable"],
10
- "userunknown" => ["Requested action not taken: mailbox unavailable"],
10
+ Sisimai::Eb::ReHOST => ["The mail could not be delivered to the recipient because the domain is not reachable"],
11
+ Sisimai::Eb::ReUSER => ["Requested action not taken: mailbox unavailable"],
11
12
  }.freeze
12
13
 
13
14
  # Detect bounce reason from Microsoft Outlook.com: https://www.outlook.com/
@@ -5,6 +5,7 @@ module Sisimai
5
5
  # called only Sisimai::Fact class.
6
6
  module Spectrum
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  ErrorCodes = [
9
10
  # https://www.spectrumbusiness.net/support/internet/understanding-email-error-codes
10
11
  # Error codes are placed in one of two categories: incoming or outgoing.
@@ -19,81 +20,81 @@ module Sisimai
19
20
  # 1000 Your IP address has been blocked due to suspicious activity. If you're a Spectrum
20
21
  # customer using a Spectrum-issued IP, contact us. If you're using an IP address
21
22
  # other than one provided by Spectrum, blocks will remain in place until they expire.
22
- [1000, 0, 'blocked'],
23
+ [1000, 0, Sisimai::Eb::ReBLOC],
23
24
 
24
25
  # 1010 This email account has been blocked from sending emails due to suspicious activity.
25
26
  # Blocks will expire based on the nature of the activity. If you're a Spectrum customer,
26
27
  # change all of your Spectrum passwords to secure your account and then contact us.
27
- [1010, 0, 'rejected'],
28
+ [1010, 0, Sisimai::Eb::ReFROM],
28
29
 
29
30
  # 1020 This email account has limited access to send emails based on suspicious activity.
30
31
  # 1080 Blocks will expire based on the nature of the activity.
31
32
  # If you're a Spectrum customer, contact us to remove the block.
32
- [1020, 1080, 'rejected'],
33
+ [1020, 1080, Sisimai::Eb::ReFROM],
33
34
 
34
35
  # 1090 The email you're trying to send can't be processed. Try sending again at a later time.
35
- [1090, 0, 'systemerror'],
36
+ [1090, 0, Sisimai::Eb::RePROC],
36
37
 
37
38
  # 1100 The IP address you're trying to connect from has an issue with the Domain Name System.
38
39
  # 1150 Spectrum requires a full circle DNS for emails to be allowed through. Verify the IP
39
40
  # you're connecting from, and check the IP address to ensure a reverse DNS entry exists
40
41
  # for the IP. If the IP address is a Spectrum-provided email address, contact us.
41
- [1100, 1150, 'requireptr'],
42
+ [1100, 1150, Sisimai::Eb::ReQPTR],
42
43
 
43
44
  # 1160 The email you tried to send goes against your domain's security policies.
44
45
  # 1190 Please contact the email administrators of your domain.
45
- [1160, 1190, 'policyviolation'],
46
+ [1160, 1190, Sisimai::Eb::ReWONT],
46
47
 
47
48
  # 1200 The IP address you're trying to send from has been flagged by Cloudmark CSI as
48
49
  # 1210 potential spam. Have your IP administrator request a reset.
49
50
  # Note: Cloudmark has sole discretion whether to remove the sending IP address from
50
51
  # their lists.
51
- [1200, 1210, 'blocked'],
52
+ [1200, 1210, Sisimai::Eb::ReBLOC],
52
53
 
53
54
  # 1220 Your IP address has been blacklisted by Spamhaus. The owner of the IP address must
54
55
  # 1250 contact Spamhaus to be removed from the list.
55
56
  # Note: Spamhaus has sole discretion whether to remove the sending IP address from
56
57
  # their lists.
57
- [1220, 1250, 'blokced'],
58
+ [1220, 1250, Sisimai::Eb::ReBLOC],
58
59
 
59
60
  # 1260 Spectrum doesn't process IPV6 addresses. Connect with an IPv4 address and try again.
60
- [1260, 0, 'networkerror'],
61
+ [1260, 0, Sisimai::Eb::ReINET],
61
62
 
62
63
  # 1300 Spectrum limits the number of concurrent connections from a sender, as well as the
63
64
  # 1340 total number of connections allowed. Limits vary based on the reputation of the IP
64
65
  # address. Reduce your number of connections and try again later.
65
- [1300, 1340, 'ratelimited'],
66
+ [1300, 1340, Sisimai::Eb::ReRATE],
66
67
 
67
68
  # 1350 Spectrum limits emails by the number of messages sent, amount of recipients,
68
69
  # 1490 potential for spam and invalid recipients.
69
- [1350, 1490, 'ratelimited'],
70
+ [1350, 1490, Sisimai::Eb::ReRATE],
70
71
 
71
72
  # 1500 Your email was rejected for attempting to send as a different email address than you
72
73
  # signed in under. Check that you're sending emails from the address you signed in with.
73
- [1500, 0, 'rejected'],
74
+ [1500, 0, Sisimai::Eb::ReFROM],
74
75
 
75
76
  # 1520 Your email was rejected for attempting to send as a different email address than a
76
77
  # domain that we host. Check the outgoing email address and try again.
77
- [1520, 0, 'rejected'],
78
+ [1520, 0, Sisimai::Eb::ReFROM],
78
79
 
79
80
  # 1530 Your email was rejected because it's larger than the maximum size of 20MB.
80
- [1530, 0, 'emailtoolarge'],
81
+ [1530, 0, Sisimai::Eb::ReSIZE],
81
82
 
82
83
  # 1540 Your emails were deferred for attempting to send too many in a single session.
83
84
  # Reconnect and try reducing the number of emails you send at one time.
84
- [1540, 0, 'ratelimited'],
85
+ [1540, 0, Sisimai::Eb::ReRATE],
85
86
 
86
87
  # 1550 Your email was rejected for having too many recipients in one message. Reduce the
87
88
  # number of recipients and try again later.
88
- [1550, 0, 'ratelimited'],
89
+ [1550, 0, Sisimai::Eb::ReRATE],
89
90
 
90
91
  # 1560 Your email was rejected for having too many invalid recipients. Check your outgoing
91
92
  # email addresses and try again later.
92
- [1560, 0, 'ratelimited'],
93
+ [1560, 0, Sisimai::Eb::ReRATE],
93
94
 
94
95
  # 1580 You've tried to send messages to too many recipients in a short period of time.
95
96
  # Wait a little while and try again later.
96
- [1580, 0, 'ratelimited'],
97
+ [1580, 0, Sisimai::Eb::ReRATE],
97
98
  ].freeze
98
99
 
99
100
  # Detect bounce reason from https://www.spectrum.com/
@@ -5,20 +5,21 @@ module Sisimai
5
5
  # only Sisimai::Fact class.
6
6
  module Tencent
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'authfailure' => [
10
+ Sisimai::Eb::ReAUTH => [
10
11
  'spf check failed', # https://service.mail.qq.com/detail/122/72
11
12
  'dmarc check failed',
12
13
  ],
13
- 'blocked' => [
14
+ Sisimai::Eb::ReBLOC => [
14
15
  'suspected bounce attacks', # https://service.mail.qq.com/detail/122/57
15
16
  'suspected spam ip', # https://service.mail.qq.com/detail/122/66
16
17
  'connection denied', # https://service.mail.qq.com/detail/122/170
17
18
  ],
18
- 'emailtoolarge' => [
19
+ Sisimai::Eb::ReSIZE => [
19
20
  'message too large', # https://service.mail.qq.com/detail/122/168
20
21
  ],
21
- 'ratelimited' => [
22
+ Sisimai::Eb::ReRATE => [
22
23
  'mailbox unavailable or access denined', # https://service.mail.qq.com/detail/122/166
23
24
  'ip frequency limited', # https://service.mail.qq.com/detail/122/172
24
25
  'domain frequency limited', # https://service.mail.qq.com/detail/122/173
@@ -26,21 +27,21 @@ module Sisimai
26
27
  'connection frequency limited', # https://service.mail.qq.com/detail/122/175
27
28
  "frequency of receiving messages is limited", # https://service.mail.qq.com/detail/122/1011
28
29
  ],
29
- 'rejected' => [
30
+ Sisimai::Eb::ReFROM => [
30
31
  'suspected spam', # https://service.mail.qq.com/detail/122/71
31
32
  'mail is rejected by recipients', # https://service.mail.qq.com/detail/122/92
32
33
  ],
33
- 'spamdetected' => [
34
+ Sisimai::Eb::ReSPAM => [
34
35
  'spam is embedded in the email', # https://service.mail.qq.com/detail/122/59
35
36
  'mail content denied', # https://service.mail.qq.com/detail/122/171
36
37
  ],
37
- 'suspend' => [
38
+ Sisimai::Eb::ReQUIT => [
38
39
  'is a deactivated mailbox', # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
39
40
  ],
40
- 'syntaxerror' => [
41
+ Sisimai::Eb::ReCOMM => [
41
42
  'bad address syntax', # https://service.mail.qq.com/detail/122/167
42
43
  ],
43
- 'userunknown' => [
44
+ Sisimai::Eb::ReUSER => [
44
45
  'mailbox not found', # https://service.mail.qq.com/detail/122/169
45
46
  ],
46
47
  }.freeze
@@ -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