sisimai 5.4.1-java → 5.6.0-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 (150) 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 +56 -0
  5. data/LICENSE +1 -1
  6. data/Makefile +2 -4
  7. data/README-JA.md +29 -23
  8. data/README.md +30 -24
  9. data/lib/sisimai/address.rb +92 -44
  10. data/lib/sisimai/arf.rb +7 -8
  11. data/lib/sisimai/datetime.rb +2 -2
  12. data/lib/sisimai/fact/json.rb +1 -2
  13. data/lib/sisimai/fact/yaml.rb +1 -2
  14. data/lib/sisimai/fact.rb +76 -36
  15. data/lib/sisimai/lda.rb +2 -2
  16. data/lib/sisimai/lhost/activehunter.rb +4 -5
  17. data/lib/sisimai/lhost/amazonses.rb +4 -5
  18. data/lib/sisimai/lhost/apachejames.rb +2 -2
  19. data/lib/sisimai/lhost/biglobe.rb +6 -6
  20. data/lib/sisimai/lhost/courier.rb +7 -7
  21. data/lib/sisimai/lhost/domino.rb +6 -6
  22. data/lib/sisimai/lhost/dragonfly.rb +5 -5
  23. data/lib/sisimai/lhost/einsundeins.rb +5 -5
  24. data/lib/sisimai/lhost/exchange2003.rb +7 -7
  25. data/lib/sisimai/lhost/exchange2007.rb +5 -5
  26. data/lib/sisimai/lhost/exim.rb +13 -15
  27. data/lib/sisimai/lhost/ezweb.rb +3 -2
  28. data/lib/sisimai/lhost/fml.rb +9 -9
  29. data/lib/sisimai/lhost/gmail.rb +9 -9
  30. data/lib/sisimai/lhost/gmx.rb +3 -3
  31. data/lib/sisimai/lhost/googlegroups.rb +6 -7
  32. data/lib/sisimai/lhost/googleworkspace.rb +5 -6
  33. data/lib/sisimai/lhost/imailserver.rb +4 -4
  34. data/lib/sisimai/lhost/kddi.rb +4 -4
  35. data/lib/sisimai/lhost/mailfoundry.rb +3 -3
  36. data/lib/sisimai/lhost/{mailmarshalsmtp.rb → mailmarshal.rb} +5 -5
  37. data/lib/sisimai/lhost/messagingserver.rb +8 -8
  38. data/lib/sisimai/lhost/mfilter.rb +8 -4
  39. data/lib/sisimai/lhost/mimecast.rb +105 -0
  40. data/lib/sisimai/lhost/notes.rb +5 -5
  41. data/lib/sisimai/lhost/opensmtpd.rb +5 -5
  42. data/lib/sisimai/lhost/postfix.rb +38 -32
  43. data/lib/sisimai/lhost/qmail.rb +11 -11
  44. data/lib/sisimai/lhost/sendmail.rb +13 -13
  45. data/lib/sisimai/lhost/{interscanmss.rb → trendmicro.rb} +8 -9
  46. data/lib/sisimai/lhost/v5sendmail.rb +7 -7
  47. data/lib/sisimai/lhost/verizon.rb +3 -3
  48. data/lib/sisimai/lhost/x1.rb +7 -4
  49. data/lib/sisimai/lhost/x2.rb +40 -12
  50. data/lib/sisimai/lhost/x3.rb +3 -3
  51. data/lib/sisimai/lhost/x6.rb +2 -2
  52. data/lib/sisimai/lhost/zoho.rb +5 -5
  53. data/lib/sisimai/lhost.rb +18 -17
  54. data/lib/sisimai/mail/maildir.rb +4 -4
  55. data/lib/sisimai/mail/mbox.rb +4 -4
  56. data/lib/sisimai/mail/memory.rb +1 -1
  57. data/lib/sisimai/mail/stdin.rb +2 -2
  58. data/lib/sisimai/message.rb +36 -34
  59. data/lib/sisimai/order.rb +5 -4
  60. data/lib/sisimai/reason/authfailure.rb +10 -14
  61. data/lib/sisimai/reason/badreputation.rb +8 -8
  62. data/lib/sisimai/reason/blocked.rb +58 -83
  63. data/lib/sisimai/reason/contenterror.rb +15 -10
  64. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +23 -26
  65. data/lib/sisimai/reason/expired.rb +17 -24
  66. data/lib/sisimai/reason/failedstarttls.rb +1 -1
  67. data/lib/sisimai/reason/filtered.rb +14 -18
  68. data/lib/sisimai/reason/hasmoved.rb +3 -2
  69. data/lib/sisimai/reason/hostunknown.rb +18 -21
  70. data/lib/sisimai/reason/mailboxfull.rb +28 -50
  71. data/lib/sisimai/reason/mailererror.rb +1 -1
  72. data/lib/sisimai/reason/networkerror.rb +17 -17
  73. data/lib/sisimai/reason/norelaying.rb +20 -20
  74. data/lib/sisimai/reason/notaccept.rb +7 -10
  75. data/lib/sisimai/reason/notcompliantrfc.rb +6 -10
  76. data/lib/sisimai/reason/policyviolation.rb +12 -28
  77. data/lib/sisimai/reason/ratelimited.rb +62 -0
  78. data/lib/sisimai/reason/rejected.rb +46 -58
  79. data/lib/sisimai/reason/requireptr.rb +14 -26
  80. data/lib/sisimai/reason/securityerror.rb +14 -20
  81. data/lib/sisimai/reason/spamdetected.rb +52 -102
  82. data/lib/sisimai/reason/suspend.rb +27 -24
  83. data/lib/sisimai/reason/systemerror.rb +20 -24
  84. data/lib/sisimai/reason/systemfull.rb +2 -2
  85. data/lib/sisimai/reason/userunknown.rb +82 -114
  86. data/lib/sisimai/reason/vacation.rb +1 -1
  87. data/lib/sisimai/reason/virusdetected.rb +7 -9
  88. data/lib/sisimai/reason.rb +26 -26
  89. data/lib/sisimai/rfc1123.rb +58 -18
  90. data/lib/sisimai/rfc1894.rb +6 -8
  91. data/lib/sisimai/rfc2045.rb +25 -13
  92. data/lib/sisimai/rfc3464/thirdparty.rb +2 -3
  93. data/lib/sisimai/rfc3464.rb +6 -6
  94. data/lib/sisimai/rfc3834.rb +18 -8
  95. data/lib/sisimai/rfc5322.rb +9 -9
  96. data/lib/sisimai/rfc791.rb +2 -2
  97. data/lib/sisimai/rhost/aol.rb +4 -1
  98. data/lib/sisimai/rhost/apple.rb +15 -11
  99. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  100. data/lib/sisimai/rhost/cox.rb +31 -25
  101. data/lib/sisimai/rhost/facebook.rb +24 -18
  102. data/lib/sisimai/rhost/franceptt.rb +92 -38
  103. data/lib/sisimai/rhost/godaddy.rb +34 -7
  104. data/lib/sisimai/rhost/google.rb +69 -70
  105. data/lib/sisimai/rhost/gsuite.rb +1 -1
  106. data/lib/sisimai/rhost/iua.rb +1 -1
  107. data/lib/sisimai/rhost/kddi.rb +1 -1
  108. data/lib/sisimai/rhost/messagelabs.rb +160 -2
  109. data/lib/sisimai/rhost/microsoft.rb +154 -107
  110. data/lib/sisimai/rhost/mimecast.rb +64 -55
  111. data/lib/sisimai/rhost/nttdocomo.rb +70 -90
  112. data/lib/sisimai/rhost/outlook.rb +1 -1
  113. data/lib/sisimai/rhost/spectrum.rb +8 -8
  114. data/lib/sisimai/rhost/tencent.rb +12 -13
  115. data/lib/sisimai/rhost/yahooinc.rb +9 -10
  116. data/lib/sisimai/rhost/zoho.rb +72 -0
  117. data/lib/sisimai/rhost.rb +4 -3
  118. data/lib/sisimai/smtp/command.rb +4 -2
  119. data/lib/sisimai/smtp/reply.rb +11 -4
  120. data/lib/sisimai/smtp/status.rb +67 -98
  121. data/lib/sisimai/smtp/transcript.rb +3 -3
  122. data/lib/sisimai/string.rb +4 -23
  123. data/lib/sisimai/version.rb +1 -1
  124. data/lib/sisimai.rb +1 -1
  125. data/set-of-emails/maildir/bsd/lhost-exim-56.eml +40 -40
  126. data/set-of-emails/maildir/bsd/lhost-mfilter-05.eml +41 -0
  127. data/set-of-emails/maildir/bsd/lhost-mimecast-01.eml +46 -0
  128. data/set-of-emails/maildir/bsd/lhost-mimecast-02.eml +59 -0
  129. data/set-of-emails/maildir/bsd/lhost-postfix-79.eml +81 -0
  130. data/set-of-emails/maildir/bsd/lhost-postfix-80.eml +84 -0
  131. data/set-of-emails/maildir/bsd/lhost-x1-03.eml +26 -0
  132. data/set-of-emails/maildir/bsd/lhost-x1-04.eml +45 -0
  133. data/set-of-emails/maildir/bsd/lhost-x2-07.eml +30 -0
  134. data/set-of-emails/maildir/bsd/rfc3464-66.eml +170 -0
  135. data/set-of-emails/maildir/bsd/rfc3834-06.eml +59 -0
  136. data/set-of-emails/maildir/bsd/rhost-zoho-01.eml +88 -0
  137. data/set-of-emails/maildir/bsd/rhost-zoho-02.eml +86 -0
  138. data/set-of-emails/maildir/bsd/rhost-zoho-03.eml +87 -0
  139. data/set-of-emails/maildir/bsd/rhost-zoho-04.eml +86 -0
  140. data/set-of-emails/maildir/not/rb-issue-368-bug.eml +39 -0
  141. data/sisimai-java.gemspec +1 -1
  142. data/sisimai.gemspec +1 -1
  143. metadata +28 -13
  144. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  145. data/lib/sisimai/reason/speeding.rb +0 -47
  146. data/lib/sisimai/reason/toomanyconn.rb +0 -59
  147. /data/set-of-emails/maildir/bsd/{lhost-mailmarshalsmtp-02.eml → lhost-mailmarshal-02.eml} +0 -0
  148. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-01.eml → lhost-trendmicro-01.eml} +0 -0
  149. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-02.eml → lhost-trendmicro-02.eml} +0 -0
  150. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-03.eml → lhost-trendmicro-03.eml} +0 -0
@@ -131,12 +131,21 @@ module Sisimai
131
131
  ['5.4.11', 0, 0, 'agent generated message depth exceeded'],
132
132
  ['5.5.6', 0, 0, 'invalid message content'],
133
133
  ],
134
- 'exceedlimit' => [
134
+ 'emailtoolarge' => [
135
135
  # Exchange Server 2019 ----------------------------------------------------------------
136
136
  # - The message is too large. Send the message again without any attachments, or confi-
137
137
  # gure a larger message size limit for the recipient. For more information, see Re-
138
138
  # cipient limits.
139
139
  ['5.2.3', 0, 0, 'resolver.rst.recipsizelimit; message too large for this recipient'],
140
+
141
+ # - The message is too large. This error can be generated by the source or destination
142
+ # messaging system. Send the message again without any attachments, or configure a
143
+ # larger message size limit. For more information, see Message size and recipient
144
+ # limits in Exchange Server.
145
+ ['5.3.4', 0, 0, 'message size exceeds fixed maximum message size'],
146
+
147
+ # Previous versions of Exchange Server ------------------------------------------------
148
+ ['5.3.4', 0, 0, 'message too big for system'],
140
149
  ],
141
150
  'expired' => [
142
151
  # Exchange Server 2019 ----------------------------------------------------------------
@@ -205,9 +214,9 @@ module Sisimai
205
214
  # - A valid X.509 certificate that isn't expired must be presented. X.509 certificates
206
215
  # must be renewed after their expiration, commonly annually.
207
216
  ['5.7.51', 0, 0, 'restrictdomainstoipaddresses or restrictdomainstocertificate'],
208
- ['4.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
209
- ['5.7.321', 0, 0, 'starttls-not-supported: destination mail server must support tls to receive mail'],
210
- ['5.7.322', 0, 0, "certificate-expired: destination mail server's certificate is expired"],
217
+ ['4.7.321', 0, 0, 'starttls-not-supported:'],
218
+ ['5.7.321', 0, 0, 'starttls-not-supported:'],
219
+ ['5.7.322', 0, 0, "certificate-expired:"],
211
220
 
212
221
  # - Records are DNSSEC authentic, but one or multiple of these scenarios occurred:
213
222
  # - The destination mail server's certificate doesn't match with what is expected per
@@ -219,13 +228,13 @@ module Sisimai
219
228
  # validity of recipient address and determine if the destination server is configured
220
229
  # correctly to receive messages.
221
230
  # - For more information about DANE, see: https://datatracker.ietf.org/doc/html/rfc7671
222
- ['4.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
223
- ['5.7.323', 0, 0, 'tlsa-invalid: The domain failed dane validation'],
231
+ ['4.7.323', 0, 0, 'tlsa-invalid:'],
232
+ ['5.7.323', 0, 0, 'tlsa-invalid:'],
224
233
 
225
234
  # - The destination domain indicated it was DNSSEC-authentic, but Exchange Online was
226
235
  # not able to verify it as DNSSEC-authentic.
227
- ['4.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
228
- ['5.7.324', 0, 0, 'dnssec-invalid: destination domain returned invalid dnssec records'],
236
+ ['4.7.324', 0, 0, 'dnssec-invalid:'],
237
+ ['5.7.324', 0, 0, 'dnssec-invalid:'],
229
238
 
230
239
  # - This happens when the presented certificate identities (CN and SAN) of a destina-
231
240
  # tion SMTP target host don't match any of the domains or MX host.
@@ -233,8 +242,8 @@ module Sisimai
233
242
  # validity of recipient address and determine if the destination server is configured
234
243
  # correctly to receive messages. For more information, see How SMTP DNS-based Authen-
235
244
  # tication of Named Entities (DANE) works to secure email communications.
236
- ['4.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
237
- ['5.7.325', 0, 0, 'certificate-host-mismatch: remote certificate must have a common name or subject alternative name matching the hostname (dane)'],
245
+ ['4.7.325', 0, 0, 'certificate-host-mismatch:'],
246
+ ['5.7.325', 0, 0, 'certificate-host-mismatch:'],
238
247
  ],
239
248
  'mailboxfull' => [
240
249
  # Exchange Server 2019 ----------------------------------------------------------------
@@ -243,17 +252,6 @@ module Sisimai
243
252
  # figure storage quotas for a mailbox.
244
253
  ['5.2.2', 0, 0, 'mailbox full'],
245
254
  ],
246
- 'mesgtoobig' => [
247
- # Exchange Server 2019 ----------------------------------------------------------------
248
- # - The message is too large. This error can be generated by the source or destination
249
- # messaging system. Send the message again without any attachments, or configure a
250
- # larger message size limit. For more information, see Message size and recipient
251
- # limits in Exchange Server.
252
- ['5.3.4', 0, 0, 'message size exceeds fixed maximum message size'],
253
-
254
- # Previous versions of Exchange Server ------------------------------------------------
255
- ['5.3.4', 0, 0, 'message too big for system'],
256
- ],
257
255
  'networkerror' => [
258
256
  # Exchange Server 2019 ----------------------------------------------------------------
259
257
  # - There's a DNS or network adapter configuration issue on the Exchange server. Verify
@@ -372,6 +370,78 @@ module Sisimai
372
370
  # Mail flow rule actions in Exchange Server.
373
371
  ['5.7.', 900, 999, 'delivery not authorized, message refused'],
374
372
  ],
373
+ 'ratelimited' => [
374
+ # Exchange Server 2019 ----------------------------------------------------------------
375
+ # - The combined total of recipients on the To, Cc, and Bcc lines of the message ex-
376
+ # ceeds the total number of recipients allowed in a single message for the organiza-
377
+ # tion, Receive connector, or sender. For more information, see Message size and re-
378
+ # cipient limits in Exchange Server.
379
+ ['5.5.3', 0, 0, 'too many recipients'],
380
+
381
+ # Exchange Online ---------------------------------------------------------------------
382
+ # - The recipient mailbox's ability to accept messages is being throttled because it's
383
+ # receiving too many messages too quickly. This is done so a single recipient's mail
384
+ # processing doesn't unfairly impact other recipients sharing the same mailbox data-
385
+ # base.
386
+ ['4.3.2', 0, 0, 'storedrv.deliver; recipient thread limit exceeded'],
387
+
388
+ # - The message has more than 200 SMTP envelope recipients from the same domain.
389
+ # - An envelope recipient is the original, unexpanded recipient that's used in the RCPT
390
+ # TO command to transmit the message between SMTP servers. When this error is return-
391
+ # ed by Microsoft 365 or Office 365, the sending server must break up the number of
392
+ # envelope recipients into smaller chunks (chunking) and resend the message.
393
+ ['4.5.3', 0, 0, 'too many recipients'],
394
+
395
+ # - The sender has exceeded the recipient rate limit as described in Sending limits.
396
+ # - This could indicate the account has been compromised and is being used to send
397
+ # spam.
398
+ ['5.1.90', 0, 0, "reached your daily limit for message recipients"],
399
+
400
+ # - The sender has exceeded the recipient rate limit or the message rate limit as de-
401
+ # scribed in Sending limits.
402
+ # - This could indicate the account has been compromised and is being used to send
403
+ # spam.
404
+ ['5.2.2', 0, 0, 'submission quota exceeded'],
405
+
406
+ # - The sender has exceeded the maximum number of messages they're allowed to send per
407
+ # hour to a specific recipient in Exchange Online.
408
+ # - The automated mailer or sender should try again later, and reduce the number of
409
+ # messages they send per hour to a specific recipient. This limit helps protect
410
+ # Microsoft 365 or Office 365 users from rapidly filling their inboxes with a large
411
+ # number of messages from errant automated notification systems or other single-send-
412
+ # er mail storms.
413
+ ['5.2.121', 0, 0, "recipient's per hour message receive limit"],
414
+
415
+ # - The Microsoft 365 or Office 365 recipient has exceeded the number of messages they
416
+ # can receive per hour from all senders.
417
+ # - The automated mailer or sender should try again later, and reduce the number of
418
+ # messages they send per hour to a specific recipient. This limit helps protect
419
+ # Microsoft 365 and Office 365 users from rapidly filling their inboxes with a large
420
+ # number of messages from errant automated notification systems or other mail storms.
421
+ ['5.2.122', 0, 0, "recipient's per hour message receive limit"],
422
+
423
+ # - Access denied, [$SenderIPAddress] has exceeded permitted limits within $range range
424
+ # - The sender's IPv6 range has attempted to send too many messages in too short a time
425
+ # period.
426
+ ['5.7.508', 0, 0, 'has exceeded permitted limits within'],
427
+
428
+ # - The majority of traffic from this tenant has been detected as suspicious and has
429
+ # resulted in a ban on sending ability for the tenant.
430
+ # - Ensure that any compromises or open relays have been resolved, and then contact
431
+ # support through your regular channel. For more information, see Fix email delivery
432
+ # issues for error codes 5.7.700 through 5.7.750 in Exchange Online.
433
+ ['5.7.', 700, 749, 'tenant has exceeded threshold'],
434
+ ['5.7.', 700, 749, 'traffic not accepted from this ip'],
435
+
436
+ # - 451 4.7.652 The mail server [192.0.2.251] has exceeded the maximum number of
437
+ # connections. (S3115) [Name=Protocol Filter Agent][AGT=PFA][MxId=11BA9B3FA168ABBF]
438
+ # [BN3PEPF0000B370.namprd21.prod.outlook.com 2025-02-20T14:30:32.425Z 08DD4D9FD5AFF45C]
439
+ # (in reply to MAIL FROM command))
440
+ ["4.7.652", 0, 0, "has exceeded the maximum number of connections"],
441
+
442
+ # Previous versions of Exchange Server ------------------------------------------------
443
+ ['5.2.122', 0, 0, 'the recipient has exceeded their limit for'],
444
+ ],
375
445
  'rejected' => [
376
446
  # Exchange Server 2019 ----------------------------------------------------------------
377
447
  # - There's a problem with the sender's email address. Verify the sender's email ad-
@@ -490,55 +560,6 @@ module Sisimai
490
560
  # sender exceptions for content filtering.
491
561
  ['5.2.1', 0, 0, 'content filter agent quarantined this message'],
492
562
  ],
493
- 'speeding' => [
494
- # Exchange Online ---------------------------------------------------------------------
495
- # - The recipient mailbox's ability to accept messages is being throttled because it's
496
- # receiving too many messages too quickly. This is done so a single recipient's mail
497
- # processing doesn't unfairly impact other recipients sharing the same mailbox data-
498
- # base.
499
- ['4.3.2', 0, 0, 'storedrv.deliver; recipient thread limit exceeded'],
500
-
501
- # - The sender has exceeded the recipient rate limit as described in Sending limits.
502
- # - This could indicate the account has been compromised and is being used to send
503
- # spam.
504
- ['5.1.90', 0, 0, "your message can't be sent because you've reached your daily limit for message recipients"],
505
-
506
- # - The sender has exceeded the recipient rate limit or the message rate limit as de-
507
- # scribed in Sending limits.
508
- # - This could indicate the account has been compromised and is being used to send
509
- # spam.
510
- ['5.2.2', 0, 0, 'submission quota exceeded'],
511
-
512
- # - The sender has exceeded the maximum number of messages they're allowed to send per
513
- # hour to a specific recipient in Exchange Online.
514
- # - The automated mailer or sender should try again later, and reduce the number of
515
- # messages they send per hour to a specific recipient. This limit helps protect
516
- # Microsoft 365 or Office 365 users from rapidly filling their inboxes with a large
517
- # number of messages from errant automated notification systems or other single-send-
518
- # er mail storms.
519
- ['5.2.121', 0, 0, "recipient's per hour message receive limit from specific sender exceeded"],
520
-
521
- # - The Microsoft 365 or Office 365 recipient has exceeded the number of messages they
522
- # can receive per hour from all senders.
523
- # - The automated mailer or sender should try again later, and reduce the number of
524
- # messages they send per hour to a specific recipient. This limit helps protect
525
- # Microsoft 365 and Office 365 users from rapidly filling their inboxes with a large
526
- # number of messages from errant automated notification systems or other mail storms.
527
- ['5.2.122', 0, 0, "recipient's per hour message receive limit exceeded"],
528
-
529
- # - Access denied, [$SenderIPAddress] has exceeded permitted limits within $range range
530
- # - The sender's IPv6 range has attempted to send too many messages in too short a time
531
- # period.
532
- ['5.7.508', 0, 0, 'has exceeded permitted limits within'],
533
-
534
- # - The majority of traffic from this tenant has been detected as suspicious and has
535
- # resulted in a ban on sending ability for the tenant.
536
- # - Ensure that any compromises or open relays have been resolved, and then contact
537
- # support through your regular channel. For more information, see Fix email delivery
538
- # issues for error codes 5.7.700 through 5.7.750 in Exchange Online.
539
- ['5.7.', 700, 749, 'access denied, tenant has exceeded threshold'],
540
- ['5.7.', 700, 749, 'access denied, traffic not accepted from this ip'],
541
- ],
542
563
  'suspend' => [
543
564
  # Exchange Online ---------------------------------------------------------------------
544
565
  # - The recipient address that you're attempting to contact isn't valid.
@@ -595,7 +616,7 @@ module Sisimai
595
616
  # is disabled. For this scenario to work, the organization's Office 365 administrator
596
617
  # should either enable Journaling Archive or change the journaling rule to journal
597
618
  # messages to a different location.
598
- ['5.3.190', 0, 0, 'journaling on-premises messages to microsoft 365 or office 365 not supported when journaling archive is disabled'],
619
+ ['5.3.190', 0, 0, 'when journaling archive is disabled'],
599
620
 
600
621
  # Previous versions of Exchange Server ------------------------------------------------
601
622
  ['5.0.0', 0, 0, 'helo / ehlo requires domain address'],
@@ -641,31 +662,6 @@ module Sisimai
641
662
  # machines.
642
663
  ['4.3.1', 0, 0, 'insufficient system resources'],
643
664
  ],
644
- 'toomanyconn' => [
645
- # Exchange Server 2019 ----------------------------------------------------------------
646
- # - The combined total of recipients on the To, Cc, and Bcc lines of the message ex-
647
- # ceeds the total number of recipients allowed in a single message for the organiza-
648
- # tion, Receive connector, or sender. For more information, see Message size and re-
649
- # cipient limits in Exchange Server.
650
- ['5.5.3', 0, 0, 'too many recipients'],
651
-
652
- # Exchange Online ---------------------------------------------------------------------
653
- # - The message has more than 200 SMTP envelope recipients from the same domain.
654
- # - An envelope recipient is the original, unexpanded recipient that's used in the RCPT
655
- # TO command to transmit the message between SMTP servers. When this error is return-
656
- # ed by Microsoft 365 or Office 365, the sending server must break up the number of
657
- # envelope recipients into smaller chunks (chunking) and resend the message.
658
- ['4.5.3', 0, 0, 'too many recipients'],
659
-
660
- # - 451 4.7.652 The mail server [192.0.2.251] has exceeded the maximum number of
661
- # connections. (S3115) [Name=Protocol Filter Agent][AGT=PFA][MxId=11BA9B3FA168ABBF]
662
- # [BN3PEPF0000B370.namprd21.prod.outlook.com 2025-02-20T14:30:32.425Z 08DD4D9FD5AFF45C]
663
- # (in reply to MAIL FROM command))
664
- ["4.7.652", 0, 0, "has exceeded the maximum number of connections"],
665
-
666
- # Previous versions of Exchange Server ------------------------------------------------
667
- ['5.2.122', 0, 0, 'the recipient has exceeded their limit for'],
668
- ],
669
665
  'userunknown' => [
670
666
  # Exchange Server 2019 ----------------------------------------------------------------
671
667
  # - The recipient's email address is incorrect (the recipient doesn't exist in the des-
@@ -728,6 +724,55 @@ module Sisimai
728
724
  ['5.1.2', 0, 0, 'invalid x.400 address'],
729
725
  ],
730
726
  }.freeze
727
+ ErrorCodes = {
728
+ # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed.
729
+ # Reason for rate limitation is related to IP/domain reputation.
730
+ "RP-001" => ["421", "badreputation"],
731
+
732
+ # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed
733
+ # on this connection. Reason for rate limitation is related to IP/domain reputation.
734
+ "RP-002" => ["421", "badreputation"],
735
+
736
+ # The mail server IP connecting to Outlook.com server has exceeded the connection limit
737
+ # allowed. Reason for limitation is related to IP/domain reputation.
738
+ "RP-003" => ["421", "badreputation"],
739
+
740
+ # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
741
+ # to content with spam-like characteristics or IP/domain reputation.
742
+ "SC-001" => ["550", "badreputation"],
743
+
744
+ # Mail rejected by Outlook.com for policy reasons. The mail server IP connecting to
745
+ # Outlook.com has exhibited namespace mining behavior.
746
+ "SC-002" => ["550", "policyviolation"],
747
+
748
+ # Mail rejected by Outlook.com for policy reasons. Your IP address appears to be an
749
+ # open proxy/relay.
750
+ "SC-003" => ["550", "blocked"],
751
+
752
+ # Mail rejected by Outlook.com for policy reasons. A block has been placed against your
753
+ # IP address because we have received complaints concerning mail coming from that IP
754
+ # address. We recommend enrolling in our Junk Email Reporting Program (JMRP), a free
755
+ # program intended to help senders remove unwanted recipients from their email list
756
+ "SC-004" => ["550", "blocked"],
757
+
758
+ # Mail rejected by Outlook.com for policy reasons. We generally do not accept email
759
+ # from dynamic IP's as they are not typically used to deliver unauthenticated SMTP email
760
+ # to an Internet mail server. (Spamhaus)
761
+ "DY-001" => ["550", "blocked"],
762
+
763
+ # Mail rejected by Outlook.com for policy reasons. The likely cause is a compromised or
764
+ # virus infected server/personal computer.
765
+ "DY-002" => ["550", "virusdetected"],
766
+
767
+ # Mail rejected by Outlook.com for policy reasons. If you are not an email/network admin
768
+ # please contact your Email/Internet Service Provider for help. For more information
769
+ # about this block and to request removal please go to: Spamhaus.
770
+ "OU-001" => ["550", "blocked"],
771
+
772
+ # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
773
+ # to content with spam-like characteristics or IP/domain reputation.
774
+ "OU-002" => ["550", "badreputation"],
775
+ }.freeze
731
776
 
732
777
  # Detect bounce reason from Exchange Server 2019 or older and Exchange Online
733
778
  # @param [Sisimai::Fact] argvs Decoded email object
@@ -735,12 +780,11 @@ module Sisimai
735
780
  # @since v4.17.2
736
781
  def find(argvs)
737
782
  return '' if argvs['deliverystatus'].empty?
738
- return '' unless Sisimai::SMTP::Status.test(argvs['deliverystatus'])
783
+ return '' if Sisimai::SMTP::Status.test(argvs['deliverystatus']) == false
739
784
 
740
785
  statuscode = argvs['deliverystatus']
741
786
  issuedcode = argvs['diagnosticcode'].downcase
742
787
  thirddigit = statuscode.split('.')[-1].to_i
743
- reasontext = ''
744
788
 
745
789
  MessagesOf.each_key do |e|
746
790
  # Each key is a reason name
@@ -748,22 +792,25 @@ module Sisimai
748
792
  # ["status-code", min, max, "error message"]
749
793
  if f[1] == f[2]
750
794
  # This error code have no range
751
- next unless statuscode == f[0]
795
+ next if statuscode != f[0]
752
796
  else
753
797
  # This error code has a range
754
- next unless statuscode.start_with?(f[0])
755
- next if thirddigit < f[1]
756
- next if thirddigit > f[2]
798
+ next if statuscode.start_with?(f[0]) == false
799
+ next if thirddigit < f[1] || thirddigit > f[2]
757
800
  end
758
801
 
759
- next unless issuedcode.include?(f[3])
760
- reasontext = e
761
- break
802
+ return e if issuedcode.include?(f[3])
762
803
  end
763
- break unless reasontext.empty?
764
804
  end
765
805
 
766
- return reasontext
806
+ ErrorCodes.each_key do |e|
807
+ # The key name is an error code described at Outlook.com Postmaster/Troubleshooting
808
+ # https://substrate.office.com/ip-domain-management-snds/postmaster/troubleshooting
809
+ next if argvs['diagnosticcode'].include?(e) == false
810
+ return ErrorCodes[e][1] if argvs['replycode'] == ErrorCodes[e][0]
811
+ end
812
+
813
+ return ""
767
814
  end
768
815
 
769
816
  end
@@ -6,8 +6,8 @@ module Sisimai
6
6
  module Mimecast
7
7
  class << self
8
8
  MessagesOf = {
9
- # https://community.mimecast.com/s/article/Mimecast-SMTP-Error-Codes-842605754
10
- # https://community.mimecast.com/s/article/email-security-cloud-gateway-mimecast-smtp-error-codes
9
+ # - https://community.mimecast.com/s/article/email-security-cloud-gateway-mimecast-smtp-error-codes
10
+ # - https://mimecastsupport.zendesk.com/hc/en-us/articles/34000709564691-Policies-Mimecast-SMTP-Error-Codes
11
11
  'authfailure' => [
12
12
  # - The inbound message has been rejected because the originated IP address isn't list-
13
13
  # ed in the published SPF records for the sending domain.
@@ -46,6 +46,8 @@ module Sisimai
46
46
  [550, 'local ct ip reputation - (reject)'],
47
47
  ],
48
48
  'blocked' => [
49
+ # - Sender address blocked.
50
+ # A Blocked Senders Policy has blocked the sender's IP address.
49
51
  # - The sender's IP address has been blocked by a Blocked Senders Policy.
50
52
  # - Remove the entry from the policy.
51
53
  [421, 'sender address blocked'],
@@ -67,6 +69,15 @@ module Sisimai
67
69
  # the associated IP address from the RBL.
68
70
  #[550, '< details of RBL >'], NEED AN ACTUAL ERROR MESSAGE STRING
69
71
  ],
72
+ 'emailtoolarge' => [
73
+ # - The email size either exceeds an Email Size Limit policy or is larger than the
74
+ # Mimecast service limit. The default is 100 MB for the Legacy MTA, and 200 MB for
75
+ # "the Latest MTA".
76
+ # - Resend the message ensuring it's smaller than the limitation set. The transmission
77
+ # and content-encoding can add significantly to the total message size (e.g. a mes-
78
+ # sage with a 70 MB attachment, can have an overall size larger than 100 MB).
79
+ [554, 'maximum email size exceeded'],
80
+ ],
70
81
  'expired' => [
71
82
  # - Journal messages past the expiration
72
83
  # - Attempts are being made to journal mail past the set expiry threshold.
@@ -74,9 +85,17 @@ module Sisimai
74
85
  # if rejected, causing the journal queue to grow.
75
86
  # - Check to confirm there are no significant time discrepancies on the mail server.
76
87
  # Discontinue journaling old messages past the expiry threshold.
77
- [550, 'Journal messages past the expiration'],
88
+ [550, 'journal messages past the expiration'],
78
89
  ],
79
90
  'failedstarttls' => [
91
+ # - SMTP inbound TLS has been enabled but no SSL certificate (or no valid certificate)
92
+ # has been selected to be used.
93
+ # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
94
+ # Alternatively, ensure the certificates on the mail server haven't expired.
95
+ # If using a proxy server, ensure it isn't intercepting the traffic and modifying
96
+ # encryption parameters.
97
+ ["454", "tls not available due to temporary reason"],
98
+
80
99
  # - This email has been sent using SMTP, but TLS is required by policy.
81
100
  # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
82
101
  # Alternatively, ensure the certificates on the mail server haven't expired. If using
@@ -102,15 +121,6 @@ module Sisimai
102
121
  # - Check you DNS has the required umbrella accounts listed as comma-separated values.
103
122
  [554, 'configuration is invalid for this certificate'],
104
123
  ],
105
- 'mesgtoobig' => [
106
- # - The email size either exceeds an Email Size Limit policy or is larger than the
107
- # Mimecast service limit. The default is 100 MB for the Legacy MTA, and 200 MB for
108
- # "the Latest MTA".
109
- # - Resend the message ensuring it's smaller than the limitation set. The transmission
110
- # and content-encoding can add significantly to the total message size (e.g. a mes-
111
- # sage with a 70 MB attachment, can have an overall size larger than 100 MB).
112
- [554, 'maximum email size exceeded'],
113
- ],
114
124
  'networkerror' => [
115
125
  # - The recipients' domains have MX records configured incorrectly
116
126
  # - Check and remove any MX records that point to hostnames with outbound references.
@@ -171,6 +181,31 @@ module Sisimai
171
181
  [554, 'host network not allowed'],
172
182
  [554, 'host network, not allowed'],
173
183
  ],
184
+ 'ratelimited' => [
185
+ # - There are too many concurrent inbound connections for the account. The default is 20.
186
+ # - The IP address is automatically removed from the block list after five minutes.
187
+ # Continued invalid connections result in the IP being readded to the block list. En-
188
+ # sure you don't route outbound or journal messages to Mimecast from an IP address
189
+ # that hasn't been authorized to do so.
190
+ [451, 'account service is temporarily unavailable'],
191
+
192
+ # - The sending server issues more than 100 RCPT TO entries. By default, Mimecast only
193
+ # accepts 100 RCPT TO entries per message body (DATA). The error triggers the sending
194
+ # mail server to provide the DATA for the first 100 recipients before it provides the
195
+ # next batch of RCPT TO entries.
196
+ # - Most mail servers respect the transient error and treat it as a "truncation request".
197
+ # If your mail server, firewall, or on-site solution doesn't respect the error, you
198
+ # must ensure that no more than 100 recipients are submitted.
199
+ # Note:
200
+ # Solutions like SMTP Fix-Up / MailGuard and ESMTP inspection on Cisco Pix and
201
+ # ASA Firewalls are known not to respect the transient error. We advise you to
202
+ # disable this functionality.
203
+ [452, 'too many recipients'],
204
+
205
+ # - There are too many concurrent outbound connections for the account.
206
+ # - Send the messages in smaller chunks to recipients.
207
+ [550, 'exceeding outbound thread limit'],
208
+ ],
174
209
  'rejected' => [
175
210
  # - The sender's email address or domain has triggered a Blocked Senders Policy or
176
211
  # there's an SPF hard rejection.
@@ -199,6 +234,19 @@ module Sisimai
199
234
  [550, 'submitter failed to disabled'],
200
235
  [550, 'submitter failed to authenticate'],
201
236
  ],
237
+ 'spamdetected' => [
238
+ # - A signature was detected that could either be a virus, or a spam score over the
239
+ # maximum threshold. The spam score isn't available in the Administration Console. If
240
+ # you aren't a Mimecast customer but have emails rejected with this error code, con-
241
+ # tact the recipient to adjust their configuration and permit your address. If unsuc-
242
+ # cessful, your IT department can submit a request to review these email rejections
243
+ # via our Sender Feedback form.
244
+ # - Anti-virus checks cannot be bypassed. Contact the sender to see if they can stop
245
+ # these messages from being blocked. Anti-spam checks can be bypassed using a Per-
246
+ # mitted Senders or Auto Allow policy. Rejected emails can be viewed in your Outbound
247
+ # Activity and searching for the required email address.
248
+ [554, 'email rejected due to security policies'],
249
+ ],
202
250
  'systemerror' => [
203
251
  # - The Mimecast server is under maximum load.
204
252
  # - No action is required from the end-user. The message will retry 30 times and when
@@ -222,31 +270,6 @@ module Sisimai
222
270
  # - Contact Mimecast Support.
223
271
  [451, 'unable to process an email at this time'],
224
272
  ],
225
- 'toomanyconn' => [
226
- # - There are too many concurrent inbound connections for the account. The default is 20.
227
- # - The IP address is automatically removed from the block list after five minutes.
228
- # Continued invalid connections result in the IP being readded to the block list. En-
229
- # sure you don't route outbound or journal messages to Mimecast from an IP address
230
- # that hasn't been authorized to do so.
231
- [451, 'account service is temporarily unavailable'],
232
-
233
- # - The sending server issues more than 100 RCPT TO entries. By default, Mimecast only
234
- # accepts 100 RCPT TO entries per message body (DATA). The error triggers the sending
235
- # mail server to provide the DATA for the first 100 recipients before it provides the
236
- # next batch of RCPT TO entries.
237
- # - Most mail servers respect the transient error and treat it as a "truncation request".
238
- # If your mail server, firewall, or on-site solution doesn't respect the error, you
239
- # must ensure that no more than 100 recipients are submitted.
240
- # Note:
241
- # Solutions like SMTP Fix-Up / MailGuard and ESMTP inspection on Cisco Pix and
242
- # ASA Firewalls are known not to respect the transient error. We advise you to
243
- # disable this functionality.
244
- [452, 'too many recipients'],
245
-
246
- # - There are too many concurrent outbound connections for the account.
247
- # - Send the messages in smaller chunks to recipients.
248
- [550, 'exceeding outbound thread limit'],
249
- ],
250
273
  'userunknown' => [
251
274
  # - The email address isn't a valid SMTP address.
252
275
  # - The sender must resend the message to a valid internal email address.
@@ -264,27 +287,14 @@ module Sisimai
264
287
  # - The sender must resend the message to a valid internal recipient address.
265
288
  [550, 'invalid recipient'],
266
289
  ],
267
- 'virusdetected' => [
268
- # - A signature was detected that could either be a virus, or a spam score over the
269
- # maximum threshold. The spam score isn't available in the Administration Console. If
270
- # you aren't a Mimecast customer but have emails rejected with this error code, con-
271
- # tact the recipient to adjust their configuration and permit your address. If unsuc-
272
- # cessful, your IT department can submit a request to review these email rejections
273
- # via our Sender Feedback form.
274
- # - Anti-virus checks cannot be bypassed. Contact the sender to see if they can stop
275
- # these messages from being blocked. Anti-spam checks can be bypassed using a Per-
276
- # mitted Senders or Auto Allow policy. Rejected emails can be viewed in your Outbound
277
- # Activity and searching for the required email address.
278
- [554, 'email rejected due to security policies'],
279
- ],
280
290
  }.freeze
281
291
 
282
292
  # Detect bounce reason from Mimecast
283
293
  # @param [Sisimai::Fact] argvs Decoded email object
284
294
  # @return [String] The bounce reason for mimecast.com
285
295
  def find(argvs)
286
- return argvs['reason'] unless argvs['reason'].empty?
287
- return '' unless Sisimai::SMTP::Reply.test(argvs['replycode'])
296
+ return argvs['reason'] if argvs['reason'].empty? == false
297
+ return '' if Sisimai::SMTP::Reply.test(argvs['replycode']) == false
288
298
 
289
299
  issuedcode = argvs['diagnosticcode'].downcase || ''
290
300
  esmtpreply = argvs['replycode'].to_i
@@ -294,12 +304,11 @@ module Sisimai
294
304
  # Try to match the error message with message patterns defined in "MessagesOf"
295
305
  MessagesOf[e].each do |f|
296
306
  # Find an error reason
297
- next unless esmtpreply == f[0]
298
- next unless issuedcode.include?(f[1])
307
+ next if esmtpreply != f[0] || issuedcode.include?(f[1]) == false
299
308
  reasontext = e
300
309
  break
301
310
  end
302
- break unless reasontext.empty?
311
+ break if reasontext.empty? == false
303
312
  end
304
313
 
305
314
  return reasontext