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,8 +5,9 @@ module Sisimai
5
5
  # called only Sisimai::Fact class.
6
6
  module Google
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'authfailure' => [
10
+ Sisimai::Eb::ReAUTH => [
10
11
  # - 451 4.7.24 The SPF record of the sending domain has one or more suspicious entries.
11
12
  # To protect our users from spam, mail sent from your IP address has been temporarily
12
13
  # rate limited. For more information, go to Email sender guidelines.
@@ -96,7 +97,7 @@ module Sisimai
96
97
  ["421", "4.7.40", "to add a dmarc record to "],
97
98
  ["550", "5.7.40", "to add a dmarc record to "],
98
99
  ],
99
- 'badreputation' => [
100
+ Sisimai::Eb::ReFAMA => [
100
101
  # - 421 4.7.0 This message is suspicious due to the very low reputation of the sending
101
102
  # IP address/domain. To protect our users from spam, mail sent from your IP address
102
103
  # has been temporarily rate limited. For more information, go to Why has Gmail blocked
@@ -111,7 +112,7 @@ module Sisimai
111
112
  ['550', '5.7.1', 'this message is likely suspicious due to the very low reputation of the sending ip address'],
112
113
  ['550', '5.7.1', 'this message is likely suspicious due to the very low reputation of the sending domain'],
113
114
  ],
114
- 'blocked' => [
115
+ Sisimai::Eb::ReBLOC => [
115
116
  # - 421 4.7.0 IP not in whitelist for RCPT domain, closing connection.
116
117
  # For more information, go to Allowlists, denylists, and approved senders.
117
118
  # https://support.google.com/a/answer/60752
@@ -150,7 +151,7 @@ module Sisimai
150
151
  ['550', '5.7.1', 'an unusual rate of unsolicited mail'],
151
152
  ['550', '5.7.28', 'an unusual rate of unsolicited mail'],
152
153
  ],
153
- 'contenterror' => [
154
+ Sisimai::Eb::ReBODY => [
154
155
  # - 552 5.7.0 Our system detected an illegal attachment on your message. Please visit
155
156
  # http://mail.google.com/support/bin/answer.py?answer=6590 to review our attachment
156
157
  # guidelines.
@@ -161,7 +162,7 @@ module Sisimai
161
162
  # our message content and attachment content guidelines.
162
163
  ['552', '5.7.0', 'blocked because its content presents a potential security issue'],
163
164
  ],
164
- 'emailtoolarge' => [
165
+ Sisimai::Eb::ReSIZE => [
165
166
  # - 552 5.2.3 Your message exceeded Google's message size limits. For more information,
166
167
  # visit https://support.google.com/mail/answer/6584
167
168
  ['552', '5.2.3', "your message exceeded google's message size limits"],
@@ -190,7 +191,7 @@ module Sisimai
190
191
  ['552', '5.3.4', "exceeds google's message header size limit"],
191
192
  ['552', '5.3.4', "exceeded google's message size limits"],
192
193
  ],
193
- 'expired' => [
194
+ Sisimai::Eb::ReTIME => [
194
195
  # - 421 4.7.0 Connection expired, try reconnecting. For more information, go to About
195
196
  # SMTP error messages. https://support.google.com/a/answer/3221692
196
197
  ['421', '4.7.0', 'connection expired'],
@@ -199,7 +200,7 @@ module Sisimai
199
200
  # error messages. https://support.google.com/a/answer/3221692
200
201
  ['451', '4.4.2', 'timeout - closing connection'],
201
202
  ],
202
- 'failedstarttls' => [
203
+ Sisimai::Eb::ReTTLS => [
203
204
  # - 530 5.7.0 Must issue a STARTTLS command first. For more information, go to About
204
205
  # SMTP error messages and review RFC 3207 specifications.
205
206
  ['530', '5.7.0', 'must issue a starttls command first'],
@@ -215,7 +216,7 @@ module Sisimai
215
216
  ['421', '4.7.29', 'senders to use tls/ssl for smtp'],
216
217
  ['550', '5.7.29', 'senders to use tls/ssl for smtp'],
217
218
  ],
218
- 'mailboxfull' => [
219
+ Sisimai::Eb::ReFULL => [
219
220
  # - 452 4.2.2 The recipient's inbox is out of storage space.
220
221
  # Please direct the recipient to https://support.google.com/mail/?p=OverQuotaTemp
221
222
  # - Please direct the recipient to https://support.google.com/mail/?p=OverQuotaPerm
@@ -228,13 +229,13 @@ module Sisimai
228
229
  ['552', '5.2.2', 'is over quota'],
229
230
  ['550', '5.7.1', 'email quota exceeded'],
230
231
  ],
231
- 'networkerror' => [
232
+ Sisimai::Eb::ReINET => [
232
233
  # - 554 5.4.6 Message exceeded 50 hops, this may indicate a mail loop.
233
234
  # For more information, go to Gmail Help. https://support.google.com/mail/?p=MailLoop
234
235
  ['554', '5.4.6', 'message exceeded 50 hops'],
235
236
  ['554', '5.6.0', 'message exceeded 50 hops'],
236
237
  ],
237
- 'norelaying' => [
238
+ Sisimai::Eb::RePASS => [
238
239
  # - 550 5.7.0 Mail relay denied <ip-address>. Invalid credentials for relay for one of
239
240
  # the domains in: <domain-name> (as obtained from HELO and MAIL FROM). Email is being
240
241
  # sent from a domain or IP address which isn't registered in your Workspace account.
@@ -260,7 +261,7 @@ module Sisimai
260
261
  # - https://support.google.com/mail/?p=NotAuthorizedError
261
262
  ['550', '5.7.1', 'is not authorized to send email directly to our servers'],
262
263
  ],
263
- 'notcompliantrfc' => [
264
+ Sisimai::Eb::ReNRFC => [
264
265
  # - 550 5.7.1 Messages missing a valid address in the From: header, or having no From:
265
266
  # header, are not accepted. For more information, go to Email sender guidelines and
266
267
  # review RFC 5322 specifications.
@@ -300,14 +301,14 @@ module Sisimai
300
301
  # - https://support.google.com/mail/?p=RfcMessageNonCompliant
301
302
  ['554', '5.6.0', 'mail message is malformed'],
302
303
  ],
303
- 'policyviolation' => [
304
+ Sisimai::Eb::ReWONT => [
304
305
  # - 550 5.7.1 The user or domain that you are sending to (or from) has a policy that
305
306
  # prohibited the mail that you sent. Please contact your domain administrator for
306
307
  # further details.
307
308
  # For more information, visit https://support.google.com/a/answer/172179
308
309
  ['550', '5.7.1', 'you are sending to (or from) has a policy that prohibited'],
309
310
  ],
310
- 'ratelimited' => [
311
+ Sisimai::Eb::ReRATE => [
311
312
  # - 450 4.2.1 The user you are trying to contact is receiving mail too quickly. Please
312
313
  # resend your message at a later time. If the user is able to receive mail at that
313
314
  # time, your message will be delivered.
@@ -351,14 +352,14 @@ module Sisimai
351
352
  # https://support.google.com/mail/answer/188131
352
353
  ['421', '4.7.28', 'sending messages with the same message-id:'],
353
354
  ],
354
- 'rejected' => [
355
+ Sisimai::Eb::ReFROM => [
355
356
  # - 550 5.7.0, Mail Sending denied. This error occurs if the sender account is disabled
356
357
  # or not registered within your Google Workspace domain.
357
358
  # - https://support.google.com/a/answer/6140680#maildenied
358
359
  ['550', '5.7.0', 'mail sending denied'],
359
360
  ['550', '5.7.1', 'unauthenticated email is not accepted'],
360
361
  ],
361
- 'requireptr' => [
362
+ Sisimai::Eb::ReQPTR => [
362
363
  # - 550 5.7.1 This message does not meet IPv6 sending guidelines regarding PTR records
363
364
  # and authentication. For more information, go to Email sender guidelines.
364
365
  # https://support.google.com/mail/?p=IPv6AuthError
@@ -387,7 +388,7 @@ module Sisimai
387
388
  ['550', '5.7.25', 'does not have a ptr record'],
388
389
  ['550', '5.7.25', 'does not match the ip address of the hostname'],
389
390
  ],
390
- 'securityerror' => [
391
+ Sisimai::Eb::ReSAFE => [
391
392
  # - 454 4.7.0 Too many login attempts, please try again later. For more information, go
392
393
  # to Add Gmail to another email client. https://support.google.com/mail/answer/7126229
393
394
  ['454', '4.7.0', 'too many login attempts'],
@@ -419,7 +420,7 @@ module Sisimai
419
420
  ['535', '5.7.1', 'username and password not accepted'],
420
421
  ['535', '5.7.80', 'username and password not accepted'],
421
422
  ],
422
- 'spamdetected' => [
423
+ Sisimai::Eb::ReSPAM => [
423
424
  # - 421 4.7.0 This message is suspicious due to the nature of the content or the links
424
425
  # within. To best protect our users from spam, the message has been blocked. For more
425
426
  # information, go to Why has Gmail blocked my messages?.
@@ -432,13 +433,13 @@ module Sisimai
432
433
  # - https://support.google.com/mail/?p=UnsolicitedMessageError
433
434
  ['550', '5.7.1', 'likely unsolicited mail'],
434
435
  ],
435
- 'suspend' => [
436
+ Sisimai::Eb::ReQUIT => [
436
437
  # - 550 5.2.1 The email account that you tried to reach is inactive.
437
438
  # For more information, go to https://support.google.com/mail/?p=DisabledUser
438
439
  ['550', '5.2.1', 'account that you tried to reach is disabled'],
439
440
  ['550', '5.2.1', 'account that you tried to reach is inactive'],
440
441
  ],
441
- 'syntaxerror' => [
442
+ Sisimai::Eb::ReCOMM => [
442
443
  # - 523 5.7.10 SMTP protocol violation, no commands allowed to pipeline after STARTTLS.
443
444
  # For more information, go to About SMTP error messages and review RFC 3207
444
445
  # specifications.
@@ -476,7 +477,7 @@ module Sisimai
476
477
  ['504', '5.7.40', 'xoauth is no longer supported'],
477
478
  ['554', '5.7.0', 'too many unauthenticated commands'],
478
479
  ],
479
- 'systemerror' => [
480
+ Sisimai::Eb::RePROC => [
480
481
  # About SMTP error messages, https://support.google.com/a/answer/3221692
481
482
  ['421', '4.3.0', 'temporary system problem'],
482
483
  ['421', '4.7.0', 'temporary system problem'],
@@ -500,7 +501,7 @@ module Sisimai
500
501
  # https://support.google.com/a/answer/3221692
501
502
  ['454', '4.7.0', 'cannot authenticate due to temporary system problem'],
502
503
  ],
503
- 'userunknown' => [
504
+ Sisimai::Eb::ReUSER => [
504
505
  # - 550 5.1.1 The email account that you tried to reach does not exist. Please try dou-
505
506
  # ble-checking the recipient's email address for typos or unnecessary spaces.
506
507
  # For more information, visit https://support.google.com/mail/answer/6596
@@ -5,11 +5,12 @@ module Sisimai
5
5
  # called only from Sisimai::Fact class.
6
6
  module GSuite
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- "hostunknown" => [" responded with code NXDOMAIN", "Domain name not found"],
10
- "networkerror" => [" had no relevant answers.", "responded with code NXDOMAIN", "Domain name not found"],
11
- "notaccept" => ["Null MX"],
12
- "userunknown" => ["because the address couldn't be found. Check for typos or unnecessary spaces and try again."],
10
+ Sisimai::Eb::ReHOST => [" responded with code NXDOMAIN", "Domain name not found"],
11
+ Sisimai::Eb::ReINET => [" had no relevant answers.", "responded with code NXDOMAIN", "Domain name not found"],
12
+ Sisimai::Eb::Re00MX => ["Null MX"],
13
+ Sisimai::Eb::ReUSER => ["because the address couldn't be found. Check for typos or unnecessary spaces and try again."],
13
14
  }.freeze
14
15
 
15
16
  # Detect bounce reason from Gsuite Mail: https://www.aol.com
@@ -25,9 +26,9 @@ module Sisimai
25
26
  MessagesOf.each_key do |e|
26
27
  # Try to match the error message with message patterns defined in $MessagesOf
27
28
  next if MessagesOf[e].none? { |a| argvs["diagnosticcode"].include?(a) }
28
- next if e == "networkerror" && (statuscode == "5" || esmtpreply == "5")
29
- next if e == "hostunknown" && (statuscode == "4" || statuscode == "")
30
- next if e == "hostunknown" && (esmtpreply == "4" || esmtpreply == "")
29
+ next if e == Sisimai::Eb::ReINET && (statuscode == "5" || esmtpreply == "5")
30
+ next if e == Sisimai::Eb::ReHOST && (statuscode == "4" || statuscode == "")
31
+ next if e == Sisimai::Eb::ReHOST && (esmtpreply == "4" || esmtpreply == "")
31
32
  reasontext = e
32
33
  break
33
34
  end
@@ -5,18 +5,19 @@ module Sisimai
5
5
  # only Sisimai::Fact class.
6
6
  module IUA
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  ErrorCodes = {
9
10
  # https://mail.i.ua/err/$(CODE)
10
- '1' => 'norelaying', # The use of SMTP as mail gate is forbidden.
11
- '2' => 'userunknown', # User is not found.
12
- '3' => 'suspend', # Mailbox was not used for more than 3 months
13
- '4' => 'mailboxfull', # Mailbox is full.
14
- '5' => 'ratelimited', # Letter sending limit is exceeded.
15
- '6' => 'norelaying', # Use SMTP of your provider to send mail.
16
- '7' => 'blocked', # Wrong value if command HELO/EHLO parameter.
17
- '8' => 'rejected', # Couldn't check sender address.
18
- '9' => 'blocked', # IP-address of the sender is blacklisted.
19
- '10' => 'filtered', # Not in the list Mail address management.
11
+ '1' => Sisimai::Eb::RePASS, # The use of SMTP as mail gate is forbidden.
12
+ '2' => Sisimai::Eb::ReUSER, # User is not found.
13
+ '3' => Sisimai::Eb::ReQUIT, # Mailbox was not used for more than 3 months
14
+ '4' => Sisimai::Eb::ReFULL, # Mailbox is full.
15
+ '5' => Sisimai::Eb::ReRATE, # Letter sending limit is exceeded.
16
+ '6' => Sisimai::Eb::RePASS, # Use SMTP of your provider to send mail.
17
+ '7' => Sisimai::Eb::ReBLOC, # Wrong value if command HELO/EHLO parameter.
18
+ '8' => Sisimai::Eb::ReFROM, # Couldn't check sender address.
19
+ '9' => Sisimai::Eb::ReBLOC, # IP-address of the sender is blacklisted.
20
+ '10' => Sisimai::Eb::ReFILT # Not in the list Mail address management.
20
21
  }.freeze
21
22
 
22
23
  # Detect bounce reason from https://www.i.ua/
@@ -5,9 +5,10 @@ module Sisimai
5
5
  # This class is called only Sisimai::Fact class.
6
6
  module KDDI
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- 'filtered' => '550 : user unknown', # The response was: 550 : User unknown
10
- 'userunknown' => '>: user unknown', # The response was: 550 <...>: User unknown
10
+ Sisimai::Eb::ReFILT => '550 : user unknown', # The response was: 550 : User unknown
11
+ Sisimai::Eb::ReUSER => '>: user unknown', # The response was: 550 <...>: User unknown
11
12
  }.freeze
12
13
 
13
14
  # Detect bounce reason from au (KDDI)
@@ -5,15 +5,16 @@ module Sisimai
5
5
  # called only from Sisimai::Fact class.
6
6
  module MessageLabs
7
7
  class << self
8
+ require 'sisimai/eb'
8
9
  MessagesOf = {
9
- "authfailure" => [
10
+ Sisimai::Eb::ReAUTH => [
10
11
  # - 553 DMARC domain authentication fail
11
12
  # - https://knowledge.broadcom.com/external/article/175407
12
13
  # An email has failed delivery and the reason provided in Track and Trace is due
13
14
  # to SPF Record. 553-SPF (Sender Policy Framework) domain authentication fail.
14
15
  "domain authentication fail",
15
16
  ],
16
- "badreputation" => [
17
+ Sisimai::Eb::ReFAMA => [
17
18
  # - https://knowledge.broadcom.com/external/article/164955
18
19
  # "501 Connection rejected by policy [7.7]" 20805, please visit www.messagelabs.com/support
19
20
  # for more details about this error message.
@@ -24,7 +25,7 @@ module Sisimai
24
25
  # Symantec Email Security.cloud customer:
25
26
  "Connection rejected by policy",
26
27
  ],
27
- "blocked" => [
28
+ Sisimai::Eb::ReBLOC => [
28
29
  # - https://knowledge.broadcom.com/external/article/165165
29
30
  # You are sending an email to a domain protected by the Symantec Email Security.Cloud
30
31
  # service and are receiving a non delivery receipt (NDR) stating the email delivery failed.
@@ -55,14 +56,14 @@ module Sisimai
55
56
  "your IP address (ip-addr) has been blocked",
56
57
  "your email address (addr) has been blocked",
57
58
  ],
58
- "contenterror" => [
59
+ Sisimai::Eb::ReBODY => [
59
60
  # - 553 Stray linefeeds in message (#5.6.2)
60
61
  # This error message happens because we strictly enforce the Internet Message Format
61
62
  # standard RFC 5322 (and its predecessor RFC 2822) which state, "CR and LF MUST
62
63
  # only occur together as CRLF; they MUST NOT appear independently in the body.
63
64
  "Stray linefeeds in message",
64
65
  ],
65
- "failedstarttls" => [
66
+ Sisimai::Eb::ReTTLS => [
66
67
  # - https://knowledge.broadcom.com/external/article/162152
67
68
  # You are sending to a domain protected by the Symantec Email Security.cloud
68
69
  # service, or you are a customer subscribed to Symantec Email Security.cloud
@@ -73,7 +74,7 @@ module Sisimai
73
74
  # in the Delivered column and "Boundary Encryption" in the "Service" column.
74
75
  "TLS/SSLv3 Connection required",
75
76
  ],
76
- "norelaying" => [
77
+ Sisimai::Eb::RePASS => [
77
78
  # - https://knowledge.broadcom.com/external/article/162137
78
79
  # You received a Non-Delivery Report (NDR) for email sent through the Symantec
79
80
  # Email Security.cloud infrastructure, with the message "You are trying to use
@@ -81,7 +82,7 @@ module Sisimai
81
82
  # to let you [IP, address] do this."
82
83
  " as a relay, ",
83
84
  ],
84
- "notcompliantrfc" => [
85
+ Sisimai::Eb::ReNRFC => [
85
86
  # - The format of your message did not comply with RFC 2822.
86
87
  # - Contact your IT administrator or ISP.
87
88
  # - If the problem persists, contact the recipient by other means (e.g. phone).
@@ -91,7 +92,7 @@ module Sisimai
91
92
  "550 Requested action aborted [4]",
92
93
  "has detected that this message is not RFC 5322",
93
94
  ],
94
- "ratelimited" => [
95
+ Sisimai::Eb::ReRATE => [
95
96
  # - https://knowledge.broadcom.com/external/article/385809
96
97
  # Email Security Cloud is attempting to deliver the email and recipient MTA is
97
98
  # responding "452 Too many recipients received this hour".
@@ -103,7 +104,7 @@ module Sisimai
103
104
  "Too many recipients received this hour",
104
105
  "too many messages",
105
106
  ],
106
- "rejected" => [
107
+ Sisimai::Eb::ReFROM => [
107
108
  # - 550 sender envelope domain not allowed for sender IP address (#5.1.8)
108
109
  # This error occurs when a sender attempts to send an email and any one of the
109
110
  # following are true:
@@ -139,8 +140,8 @@ module Sisimai
139
140
  "your email address has been blacklisted",
140
141
  "your domain has been blacklisted",
141
142
  ],
142
- "securityerror" => ["Please turn on SMTP Authentication in your mail client"],
143
- "spamdetected" => [
143
+ Sisimai::Eb::ReSAFE => ["Please turn on SMTP Authentication in your mail client"],
144
+ Sisimai::Eb::ReSPAM => [
144
145
  # - https://knowledge.broadcom.com/external/article/173867
145
146
  # Legitimate email, either outbound or inbound, is incorrectly flagged as spam
146
147
  # (false positive) by Email Security.cloud. This email may have the following errors:
@@ -149,7 +150,7 @@ module Sisimai
149
150
  "Message Filtered",
150
151
  "filtered by Outbound scanning",
151
152
  ],
152
- "userunknown" => [
153
+ Sisimai::Eb::ReUSER => [
153
154
  # - https://knowledge.broadcom.com/external/article/165163
154
155
  # When sending email to a user on the Symantec Email Security.cloud service, the
155
156
  # message is rejected. The sender receives a non-delivery email with a 500 series
@@ -9,8 +9,9 @@ module Sisimai
9
9
  # https://learn.microsoft.com/en-us/Exchange/mail-flow/non-delivery-reports-and-bounce-messages/non-delivery-reports-and-bounce-messages
10
10
  module Microsoft
11
11
  class << self
12
+ require 'sisimai/eb'
12
13
  MessagesOf = {
13
- 'authfailure' => [
14
+ Sisimai::Eb::ReAUTH => [
14
15
  # - Access denied, a message sent over IPv6 [2a01:111:f200:2004::240] must pass either
15
16
  # SPF or DKIM validation, this message is not signed
16
17
  # - The sending message sent over IPv6 must pass either SPF or DKIM.
@@ -31,7 +32,7 @@ module Sisimai
31
32
  # Spf= Fail , Dkim= Pass , DMARC= Pass ...
32
33
  ["5.7.515", 0, 0, "doesn't meet the required authentication level"],
33
34
  ],
34
- 'badreputation' => [
35
+ Sisimai::Eb::ReFAMA => [
35
36
  # Undocumented error messages ---------------------------------------------------------
36
37
  # - status=deferred (host outlook-com.olc.protection.outlook.com[192.0.2.255] said:
37
38
  # 451 4.7.650 The mail server [192.0.2.5] has been temporarily rate limited due to IP
@@ -39,7 +40,7 @@ module Sisimai
39
40
  # [***.prod.protection.outlook.com] (in reply to MAIL FROM command))
40
41
  ['4.7.650', 0, 0, 'has been temporarily rate limited due to ip reputation'],
41
42
  ],
42
- 'blocked' => [
43
+ Sisimai::Eb::ReBLOC => [
43
44
  # Exchange Server 2019 ----------------------------------------------------------------
44
45
  # - Transient network issues or server problems that might eventually correct them-
45
46
  # selves. The sending server will retry delivery of the message, and will generate
@@ -116,7 +117,7 @@ module Sisimai
116
117
  # Internet service provider since part of their network is on our block list (S3150).
117
118
  ['5.7.1', 0, 0, 'part of their network is on our block list (s3150)'],
118
119
  ],
119
- 'contenterror' => [
120
+ Sisimai::Eb::ReBODY => [
120
121
  # Exchange Server 2019 ----------------------------------------------------------------
121
122
  # - The message was determined to be malformed, and was moved to the poison message
122
123
  # queue. For more information, see Types of queues.
@@ -131,7 +132,7 @@ module Sisimai
131
132
  ['5.4.11', 0, 0, 'agent generated message depth exceeded'],
132
133
  ['5.5.6', 0, 0, 'invalid message content'],
133
134
  ],
134
- 'emailtoolarge' => [
135
+ Sisimai::Eb::ReSIZE => [
135
136
  # Exchange Server 2019 ----------------------------------------------------------------
136
137
  # - The message is too large. Send the message again without any attachments, or confi-
137
138
  # gure a larger message size limit for the recipient. For more information, see Re-
@@ -147,7 +148,7 @@ module Sisimai
147
148
  # Previous versions of Exchange Server ------------------------------------------------
148
149
  ['5.3.4', 0, 0, 'message too big for system'],
149
150
  ],
150
- 'expired' => [
151
+ Sisimai::Eb::ReTIME => [
151
152
  # Exchange Server 2019 ----------------------------------------------------------------
152
153
  # - Transient network issues that might eventually correct themselves. The Exchange
153
154
  # server periodically tries to connect to the destination server to deliver the mes-
@@ -198,7 +199,7 @@ module Sisimai
198
199
  # couldn't be delivered to the original sender.
199
200
  ['5.4.300', 0, 0, 'message expired'],
200
201
  ],
201
- 'failedstarttls' => [
202
+ Sisimai::Eb::ReTTLS => [
202
203
  # Exchange Online ---------------------------------------------------------------------
203
204
  # - DNSSEC checks have passed, yet upon connection, destination mail server doesn't re-
204
205
  # spond to the STARTTLS command. The destination server responds to the STARTTLS com-
@@ -245,14 +246,14 @@ module Sisimai
245
246
  ['4.7.325', 0, 0, 'certificate-host-mismatch:'],
246
247
  ['5.7.325', 0, 0, 'certificate-host-mismatch:'],
247
248
  ],
248
- 'mailboxfull' => [
249
+ Sisimai::Eb::ReFULL => [
249
250
  # Exchange Server 2019 ----------------------------------------------------------------
250
251
  # - The recipient's mailbox has exceeded its storage quota and is no longer able to ac-
251
252
  # cept new messages. For more information about configuring mailbox quotas, see Con-
252
253
  # figure storage quotas for a mailbox.
253
254
  ['5.2.2', 0, 0, 'mailbox full'],
254
255
  ],
255
- 'networkerror' => [
256
+ Sisimai::Eb::ReINET => [
256
257
  # Exchange Server 2019 ----------------------------------------------------------------
257
258
  # - There's a DNS or network adapter configuration issue on the Exchange server. Verify
258
259
  # the internal and external DNS lookup settings for the Exchange by running this com-
@@ -303,7 +304,7 @@ module Sisimai
303
304
  ['5.4.6', 0, 0, 'routing loop detected'],
304
305
  ['5.4.14', 0, 0, 'routing loop detected'],
305
306
  ],
306
- 'norelaying' => [
307
+ Sisimai::Eb::RePASS => [
307
308
  # Exchange Server 2019 ----------------------------------------------------------------
308
309
  # - You have an application server or device that's trying to relay messages through
309
310
  # Exchange. For more information, see Allow anonymous relay on Exchange servers. The
@@ -344,7 +345,7 @@ module Sisimai
344
345
  # Previous versions of Exchange Server ------------------------------------------------
345
346
  ['5.4.310', 0, 0, 'does not exist'], # DNS domain * does not exist
346
347
  ],
347
- 'notaccept' => [
348
+ Sisimai::Eb::Re00MX => [
348
349
  ['4.3.2', 0, 0, 'system not accepting network messages'],
349
350
  ['4.4.4', 0, 0, 'hosted tenant which has no mail-enabled subscriptions'],
350
351
 
@@ -355,7 +356,7 @@ module Sisimai
355
356
  # Book Policy Routing Agent and Address book policies in Exchange Server.
356
357
  ['5.3.2', 0, 0, 'storedrv.deliver: missing or bad storedriver mdb properties'],
357
358
  ],
358
- 'policyviolation' => [
359
+ Sisimai::Eb::ReWONT => [
359
360
  # - 5.0.350 is a generic catch-all error code for a wide variety of non-specific errors
360
361
  # lfrom the recipient's email organization. The specific x-dg-ref header is too long
361
362
  # message is related to Rich Text formatted messages. The specific Requested action
@@ -370,7 +371,7 @@ module Sisimai
370
371
  # Mail flow rule actions in Exchange Server.
371
372
  ['5.7.', 900, 999, 'delivery not authorized, message refused'],
372
373
  ],
373
- 'ratelimited' => [
374
+ Sisimai::Eb::ReRATE => [
374
375
  # Exchange Server 2019 ----------------------------------------------------------------
375
376
  # - The combined total of recipients on the To, Cc, and Bcc lines of the message ex-
376
377
  # ceeds the total number of recipients allowed in a single message for the organiza-
@@ -442,7 +443,7 @@ module Sisimai
442
443
  # Previous versions of Exchange Server ------------------------------------------------
443
444
  ['5.2.122', 0, 0, 'the recipient has exceeded their limit for'],
444
445
  ],
445
- 'rejected' => [
446
+ Sisimai::Eb::ReFROM => [
446
447
  # Exchange Server 2019 ----------------------------------------------------------------
447
448
  # - There's a problem with the sender's email address. Verify the sender's email ad-
448
449
  # dress.
@@ -534,7 +535,7 @@ module Sisimai
534
535
  # Previous versions of Exchange Server ------------------------------------------------
535
536
  ['5.7.', 501, 503, 'access denied, banned sender'],
536
537
  ],
537
- 'securityerror' => [
538
+ Sisimai::Eb::ReSAFE => [
538
539
  # Exchange Server 2019 ----------------------------------------------------------------
539
540
  # - A firewall or other device is blocking the Extended SMTP command that's required
540
541
  # for Exchange Server authentication (X-EXPS). Internal email traffic is flowing
@@ -557,14 +558,14 @@ module Sisimai
557
558
  # the configuration of the application or device.
558
559
  ['5.7.57', 0, 0, 'client was not authenticated to send anonymous mail during mail from'],
559
560
  ],
560
- 'spamdetected' => [
561
+ Sisimai::Eb::ReSPAM => [
561
562
  # Exchange Server 2019 ----------------------------------------------------------------
562
563
  # - The message was quarantined by content filtering. To configure exceptions to con-
563
564
  # tent filtering, see Use the Exchange Management Shell to configure recipient and
564
565
  # sender exceptions for content filtering.
565
566
  ['5.2.1', 0, 0, 'content filter agent quarantined this message'],
566
567
  ],
567
- 'suspend' => [
568
+ Sisimai::Eb::ReQUIT => [
568
569
  # Exchange Online ---------------------------------------------------------------------
569
570
  # - The recipient address that you're attempting to contact isn't valid.
570
571
  # - Verify the recipient's email address, and try again.
@@ -575,7 +576,7 @@ module Sisimai
575
576
  # Previous versions of Exchange Server ------------------------------------------------
576
577
  ['5.2.1', 0, 0, 'mailbox cannot be accessed'],
577
578
  ],
578
- 'syntaxerror' => [
579
+ Sisimai::Eb::ReCOMM => [
579
580
  # Exchange Server 2019 ----------------------------------------------------------------
580
581
  # - Receive connectors that are used for internal mail flow are missing the required
581
582
  # Exchange Server authentication mechanism. For more information about authentication
@@ -588,7 +589,7 @@ module Sisimai
588
589
  # be EHLO or HELO.
589
590
  ['5.5.2', 0, 0, 'send hello first'],
590
591
  ],
591
- 'systemerror' => [
592
+ Sisimai::Eb::RePROC => [
592
593
  # Exchange Server 2019 ----------------------------------------------------------------
593
594
  # - You've configured a custom Receive connector in the Transport (Hub) service on a
594
595
  # Mailbox server that listens on port 25. Typically, custom Receive connectors that
@@ -655,7 +656,7 @@ module Sisimai
655
656
  # (in reply to MAIL FROM command))
656
657
  ['4.7.700', 0, 0, 'pfa agent busy, please try again.'],
657
658
  ],
658
- 'systemfull' => [
659
+ Sisimai::Eb::ReDISK => [
659
660
  # Exchange Server 2019 ----------------------------------------------------------------
660
661
  # - Free disk space is low (for example, the disk that holds the queue database doesn't
661
662
  # have the required amount of free space). For more information, see Understanding
@@ -666,7 +667,7 @@ module Sisimai
666
667
  # machines.
667
668
  ['4.3.1', 0, 0, 'insufficient system resources'],
668
669
  ],
669
- 'userunknown' => [
670
+ Sisimai::Eb::ReUSER => [
670
671
  # Exchange Server 2019 ----------------------------------------------------------------
671
672
  # - The recipient's email address is incorrect (the recipient doesn't exist in the des-
672
673
  # tination messaging system). Verify the recipient's email address. You recreated a
@@ -731,51 +732,51 @@ module Sisimai
731
732
  ErrorCodes = {
732
733
  # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed.
733
734
  # Reason for rate limitation is related to IP/domain reputation.
734
- "RP-001" => ["421", "badreputation"],
735
+ "RP-001" => ["421", Sisimai::Eb::ReFAMA],
735
736
 
736
737
  # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed
737
738
  # on this connection. Reason for rate limitation is related to IP/domain reputation.
738
- "RP-002" => ["421", "badreputation"],
739
+ "RP-002" => ["421", Sisimai::Eb::ReFAMA],
739
740
 
740
741
  # The mail server IP connecting to Outlook.com server has exceeded the connection limit
741
742
  # allowed. Reason for limitation is related to IP/domain reputation.
742
- "RP-003" => ["421", "badreputation"],
743
+ "RP-003" => ["421", Sisimai::Eb::ReFAMA],
743
744
 
744
745
  # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
745
746
  # to content with spam-like characteristics or IP/domain reputation.
746
- "SC-001" => ["550", "badreputation"],
747
+ "SC-001" => ["550", Sisimai::Eb::ReFAMA],
747
748
 
748
749
  # Mail rejected by Outlook.com for policy reasons. The mail server IP connecting to
749
750
  # Outlook.com has exhibited namespace mining behavior.
750
- "SC-002" => ["550", "policyviolation"],
751
+ "SC-002" => ["550", Sisimai::Eb::ReWONT],
751
752
 
752
753
  # Mail rejected by Outlook.com for policy reasons. Your IP address appears to be an
753
754
  # open proxy/relay.
754
- "SC-003" => ["550", "blocked"],
755
+ "SC-003" => ["550", Sisimai::Eb::ReBLOC],
755
756
 
756
757
  # Mail rejected by Outlook.com for policy reasons. A block has been placed against your
757
758
  # IP address because we have received complaints concerning mail coming from that IP
758
759
  # address. We recommend enrolling in our Junk Email Reporting Program (JMRP), a free
759
760
  # program intended to help senders remove unwanted recipients from their email list
760
- "SC-004" => ["550", "blocked"],
761
+ "SC-004" => ["550", Sisimai::Eb::ReBLOC],
761
762
 
762
763
  # Mail rejected by Outlook.com for policy reasons. We generally do not accept email
763
764
  # from dynamic IP's as they are not typically used to deliver unauthenticated SMTP email
764
765
  # to an Internet mail server. (Spamhaus)
765
- "DY-001" => ["550", "blocked"],
766
+ "DY-001" => ["550", Sisimai::Eb::ReBLOC],
766
767
 
767
768
  # Mail rejected by Outlook.com for policy reasons. The likely cause is a compromised or
768
769
  # virus infected server/personal computer.
769
- "DY-002" => ["550", "virusdetected"],
770
+ "DY-002" => ["550", Sisimai::Eb::ReEXEC],
770
771
 
771
772
  # Mail rejected by Outlook.com for policy reasons. If you are not an email/network admin
772
773
  # please contact your Email/Internet Service Provider for help. For more information
773
774
  # about this block and to request removal please go to: Spamhaus.
774
- "OU-001" => ["550", "blocked"],
775
+ "OU-001" => ["550", Sisimai::Eb::ReBLOC],
775
776
 
776
777
  # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
777
778
  # to content with spam-like characteristics or IP/domain reputation.
778
- "OU-002" => ["550", "badreputation"],
779
+ "OU-002" => ["550", Sisimai::Eb::ReFAMA],
779
780
  }.freeze
780
781
 
781
782
  # Detect bounce reason from Exchange Server 2019 or older and Exchange Online