sisimai 5.4.1-java → 5.5.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 (146) 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 +35 -0
  5. data/Makefile +2 -4
  6. data/README-JA.md +23 -20
  7. data/README.md +23 -20
  8. data/lib/sisimai/address.rb +92 -44
  9. data/lib/sisimai/arf.rb +7 -8
  10. data/lib/sisimai/datetime.rb +2 -2
  11. data/lib/sisimai/fact/json.rb +1 -2
  12. data/lib/sisimai/fact/yaml.rb +1 -2
  13. data/lib/sisimai/fact.rb +60 -35
  14. data/lib/sisimai/lda.rb +2 -2
  15. data/lib/sisimai/lhost/activehunter.rb +4 -5
  16. data/lib/sisimai/lhost/amazonses.rb +3 -4
  17. data/lib/sisimai/lhost/apachejames.rb +2 -2
  18. data/lib/sisimai/lhost/biglobe.rb +6 -6
  19. data/lib/sisimai/lhost/courier.rb +7 -7
  20. data/lib/sisimai/lhost/domino.rb +6 -6
  21. data/lib/sisimai/lhost/dragonfly.rb +5 -5
  22. data/lib/sisimai/lhost/einsundeins.rb +4 -4
  23. data/lib/sisimai/lhost/exchange2003.rb +7 -7
  24. data/lib/sisimai/lhost/exchange2007.rb +3 -3
  25. data/lib/sisimai/lhost/exim.rb +7 -7
  26. data/lib/sisimai/lhost/ezweb.rb +3 -2
  27. data/lib/sisimai/lhost/fml.rb +9 -9
  28. data/lib/sisimai/lhost/gmail.rb +9 -9
  29. data/lib/sisimai/lhost/gmx.rb +3 -3
  30. data/lib/sisimai/lhost/googlegroups.rb +6 -7
  31. data/lib/sisimai/lhost/googleworkspace.rb +5 -6
  32. data/lib/sisimai/lhost/imailserver.rb +4 -4
  33. data/lib/sisimai/lhost/kddi.rb +4 -4
  34. data/lib/sisimai/lhost/mailfoundry.rb +3 -3
  35. data/lib/sisimai/lhost/{mailmarshalsmtp.rb → mailmarshal.rb} +5 -5
  36. data/lib/sisimai/lhost/messagingserver.rb +8 -8
  37. data/lib/sisimai/lhost/mfilter.rb +8 -4
  38. data/lib/sisimai/lhost/mimecast.rb +105 -0
  39. data/lib/sisimai/lhost/notes.rb +5 -5
  40. data/lib/sisimai/lhost/opensmtpd.rb +5 -5
  41. data/lib/sisimai/lhost/postfix.rb +38 -32
  42. data/lib/sisimai/lhost/qmail.rb +6 -6
  43. data/lib/sisimai/lhost/sendmail.rb +13 -13
  44. data/lib/sisimai/lhost/{interscanmss.rb → trendmicro.rb} +8 -9
  45. data/lib/sisimai/lhost/v5sendmail.rb +7 -7
  46. data/lib/sisimai/lhost/verizon.rb +3 -3
  47. data/lib/sisimai/lhost/x1.rb +7 -4
  48. data/lib/sisimai/lhost/x2.rb +40 -12
  49. data/lib/sisimai/lhost/x3.rb +3 -3
  50. data/lib/sisimai/lhost/x6.rb +2 -2
  51. data/lib/sisimai/lhost/zoho.rb +5 -5
  52. data/lib/sisimai/lhost.rb +18 -17
  53. data/lib/sisimai/mail/maildir.rb +4 -4
  54. data/lib/sisimai/mail/mbox.rb +4 -4
  55. data/lib/sisimai/mail/memory.rb +1 -1
  56. data/lib/sisimai/mail/stdin.rb +2 -2
  57. data/lib/sisimai/message.rb +34 -34
  58. data/lib/sisimai/order.rb +5 -4
  59. data/lib/sisimai/reason/authfailure.rb +1 -1
  60. data/lib/sisimai/reason/badreputation.rb +1 -1
  61. data/lib/sisimai/reason/blocked.rb +2 -1
  62. data/lib/sisimai/reason/contenterror.rb +1 -2
  63. data/lib/sisimai/reason/exceedlimit.rb +1 -1
  64. data/lib/sisimai/reason/expired.rb +1 -1
  65. data/lib/sisimai/reason/failedstarttls.rb +1 -1
  66. data/lib/sisimai/reason/filtered.rb +1 -1
  67. data/lib/sisimai/reason/hasmoved.rb +1 -1
  68. data/lib/sisimai/reason/hostunknown.rb +2 -2
  69. data/lib/sisimai/reason/mailboxfull.rb +1 -1
  70. data/lib/sisimai/reason/mailererror.rb +1 -1
  71. data/lib/sisimai/reason/mesgtoobig.rb +1 -1
  72. data/lib/sisimai/reason/networkerror.rb +1 -1
  73. data/lib/sisimai/reason/norelaying.rb +2 -2
  74. data/lib/sisimai/reason/notaccept.rb +2 -3
  75. data/lib/sisimai/reason/notcompliantrfc.rb +1 -1
  76. data/lib/sisimai/reason/policyviolation.rb +2 -4
  77. data/lib/sisimai/reason/rejected.rb +5 -3
  78. data/lib/sisimai/reason/requireptr.rb +1 -1
  79. data/lib/sisimai/reason/securityerror.rb +1 -1
  80. data/lib/sisimai/reason/spamdetected.rb +1 -1
  81. data/lib/sisimai/reason/speeding.rb +1 -1
  82. data/lib/sisimai/reason/suspend.rb +2 -1
  83. data/lib/sisimai/reason/systemerror.rb +1 -1
  84. data/lib/sisimai/reason/systemfull.rb +1 -1
  85. data/lib/sisimai/reason/toomanyconn.rb +1 -1
  86. data/lib/sisimai/reason/userunknown.rb +4 -3
  87. data/lib/sisimai/reason/vacation.rb +1 -1
  88. data/lib/sisimai/reason/virusdetected.rb +1 -1
  89. data/lib/sisimai/reason.rb +12 -12
  90. data/lib/sisimai/rfc1123.rb +58 -18
  91. data/lib/sisimai/rfc1894.rb +6 -8
  92. data/lib/sisimai/rfc2045.rb +25 -13
  93. data/lib/sisimai/rfc3464/thirdparty.rb +2 -3
  94. data/lib/sisimai/rfc3464.rb +6 -6
  95. data/lib/sisimai/rfc3834.rb +18 -8
  96. data/lib/sisimai/rfc5322.rb +9 -9
  97. data/lib/sisimai/rfc791.rb +2 -2
  98. data/lib/sisimai/rhost/aol.rb +4 -1
  99. data/lib/sisimai/rhost/apple.rb +11 -7
  100. data/lib/sisimai/rhost/cox.rb +9 -5
  101. data/lib/sisimai/rhost/facebook.rb +9 -3
  102. data/lib/sisimai/rhost/franceptt.rb +86 -37
  103. data/lib/sisimai/rhost/godaddy.rb +10 -1
  104. data/lib/sisimai/rhost/google.rb +6 -6
  105. data/lib/sisimai/rhost/gsuite.rb +1 -1
  106. data/lib/sisimai/rhost/kddi.rb +1 -1
  107. data/lib/sisimai/rhost/messagelabs.rb +160 -2
  108. data/lib/sisimai/rhost/microsoft.rb +77 -26
  109. data/lib/sisimai/rhost/mimecast.rb +30 -21
  110. data/lib/sisimai/rhost/nttdocomo.rb +69 -89
  111. data/lib/sisimai/rhost/outlook.rb +1 -1
  112. data/lib/sisimai/rhost/spectrum.rb +1 -1
  113. data/lib/sisimai/rhost/tencent.rb +5 -4
  114. data/lib/sisimai/rhost/yahooinc.rb +2 -2
  115. data/lib/sisimai/rhost/zoho.rb +72 -0
  116. data/lib/sisimai/rhost.rb +4 -3
  117. data/lib/sisimai/smtp/command.rb +2 -2
  118. data/lib/sisimai/smtp/reply.rb +11 -4
  119. data/lib/sisimai/smtp/status.rb +17 -8
  120. data/lib/sisimai/smtp/transcript.rb +3 -3
  121. data/lib/sisimai/string.rb +6 -10
  122. data/lib/sisimai/version.rb +1 -1
  123. data/lib/sisimai.rb +1 -1
  124. data/set-of-emails/maildir/bsd/lhost-exim-56.eml +40 -40
  125. data/set-of-emails/maildir/bsd/lhost-mfilter-05.eml +41 -0
  126. data/set-of-emails/maildir/bsd/lhost-mimecast-01.eml +46 -0
  127. data/set-of-emails/maildir/bsd/lhost-mimecast-02.eml +59 -0
  128. data/set-of-emails/maildir/bsd/lhost-postfix-79.eml +81 -0
  129. data/set-of-emails/maildir/bsd/lhost-postfix-80.eml +84 -0
  130. data/set-of-emails/maildir/bsd/lhost-x1-03.eml +26 -0
  131. data/set-of-emails/maildir/bsd/lhost-x1-04.eml +45 -0
  132. data/set-of-emails/maildir/bsd/lhost-x2-07.eml +30 -0
  133. data/set-of-emails/maildir/bsd/rfc3464-66.eml +170 -0
  134. data/set-of-emails/maildir/bsd/rfc3834-06.eml +59 -0
  135. data/set-of-emails/maildir/bsd/rhost-zoho-01.eml +88 -0
  136. data/set-of-emails/maildir/bsd/rhost-zoho-02.eml +86 -0
  137. data/set-of-emails/maildir/bsd/rhost-zoho-03.eml +87 -0
  138. data/set-of-emails/maildir/bsd/rhost-zoho-04.eml +86 -0
  139. data/set-of-emails/maildir/not/rb-issue-368-bug.eml +39 -0
  140. data/sisimai-java.gemspec +1 -1
  141. data/sisimai.gemspec +1 -1
  142. metadata +26 -9
  143. /data/set-of-emails/maildir/bsd/{lhost-mailmarshalsmtp-02.eml → lhost-mailmarshal-02.eml} +0 -0
  144. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-01.eml → lhost-trendmicro-01.eml} +0 -0
  145. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-02.eml → lhost-trendmicro-02.eml} +0 -0
  146. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-03.eml → lhost-trendmicro-03.eml} +0 -0
@@ -6,8 +6,166 @@ module Sisimai
6
6
  module MessageLabs
7
7
  class << self
8
8
  MessagesOf = {
9
+ "authfailure" => [
10
+ # - 553 DMARC domain authentication fail
11
+ # - https://knowledge.broadcom.com/external/article/175407
12
+ # An email has failed delivery and the reason provided in Track and Trace is due
13
+ # to SPF Record. 553-SPF (Sender Policy Framework) domain authentication fail.
14
+ "domain authentication fail",
15
+ ],
16
+ "badreputation" => [
17
+ # - https://knowledge.broadcom.com/external/article/164955
18
+ # "501 Connection rejected by policy [7.7]" 20805, please visit www.messagelabs.com/support
19
+ # for more details about this error message.
20
+ # My IP has a negative reputation with Symantec. To check the reputation of a
21
+ # specific IP address, go to https://ipremoval.sms.symantec.com/.
22
+ # - https://knowledge.broadcom.com/external/article/384503
23
+ # Users are receiving a non-delivery receipt (NDR) when sending an email to a
24
+ # Symantec Email Security.cloud customer:
25
+ "Connection rejected by policy",
26
+ ],
27
+ "blocked" => [
28
+ # - https://knowledge.broadcom.com/external/article/165165
29
+ # You are sending an email to a domain protected by the Symantec Email Security.Cloud
30
+ # service and are receiving a non delivery receipt (NDR) stating the email delivery failed.
31
+ # 553-mail rejected because your IP is in the PBL. See http://www.spamhaus.org/pbl
32
+ # - Sorry, your IP address has been blocked
33
+ # * This error message indicates that your public IP address has been put on a
34
+ # block list by the Spamhaus PBL block list. To resolve this issue, request to
35
+ # have your IP removed at http://www.spamhaus.org/pbl/.
36
+ # * The delisting process is normally quicker than an hour. Once an hour has passed
37
+ # try to resend your email.
38
+ # * If the problem persists, contact the recipient by other means (e.g. phone)
39
+ # and request that your email address is added to their Email Security.cloud
40
+ # approved sender's list.
41
+ # - Sorry, your email address (addr) has been blocked
42
+ # * Check with your administrator or ISP that your mail server is not in open relay.
43
+ # Search “Open Relay Test” for an independent testing tool. If your mail server
44
+ # is an open relay, please fix the open relay, wait 24 hours, and then try to
45
+ # resend your email.
46
+ # * Check with your administrator or ISP that your IP address is not on any spam
47
+ # block lists. Search “email blacklist check” to check using an independent tool.
48
+ # If your IP address is on any block lists, please request for removal, wait 24
49
+ # hours, and then try to resend your email.
50
+ # If the problem persists, contact the recipient by other means (e.g. phone) for
51
+ # further assistance.
52
+ # - Sorry, your IP address (ip-addr) has been blocked
53
+ "mail rejected because your IP is in the PBL",
54
+ "your IP address has been ",
55
+ "your IP address (ip-addr) has been blocked",
56
+ "your email address (addr) has been blocked",
57
+ ],
58
+ "contenterror" => [
59
+ # - 553 Stray linefeeds in message (#5.6.2)
60
+ # This error message happens because we strictly enforce the Internet Message Format
61
+ # standard RFC 5322 (and its predecessor RFC 2822) which state, "CR and LF MUST
62
+ # only occur together as CRLF; they MUST NOT appear independently in the body.
63
+ "Stray linefeeds in message",
64
+ ],
65
+ "failedstarttls" => [
66
+ # - https://knowledge.broadcom.com/external/article/162152
67
+ # You are sending to a domain protected by the Symantec Email Security.cloud
68
+ # service, or you are a customer subscribed to Symantec Email Security.cloud
69
+ # sending outbound through the service. The Email Security.cloud server responds
70
+ # to the SMTP RCPT TO: command with "451 TLS/SSLv3 Connection required. (#4.7.1)".
71
+ # - 451 TLS/SSLv3 Connection required. (#4.7.1)
72
+ # - Within the ClientNet portal, the Email Track and Trace tool shows "Not Delivered"
73
+ # in the Delivered column and "Boundary Encryption" in the "Service" column.
74
+ "TLS/SSLv3 Connection required",
75
+ ],
76
+ "norelaying" => [
77
+ # - https://knowledge.broadcom.com/external/article/162137
78
+ # You received a Non-Delivery Report (NDR) for email sent through the Symantec
79
+ # Email Security.cloud infrastructure, with the message "You are trying to use
80
+ # me [server-X.tower-x.messagelabs.com] as a relay, but I have not been configured
81
+ # to let you [IP, address] do this."
82
+ " as a relay, ",
83
+ ],
84
+ "notcompliantrfc" => [
85
+ # - The format of your message did not comply with RFC 2822.
86
+ # - Contact your IT administrator or ISP.
87
+ # - If the problem persists, contact the recipient by other means (e.g. phone).
88
+ #
89
+ # - 550 [XX.XX.XX.XX] has detected that this message is not RFC 5322
90
+ # * Ensure that the message complied to RFC 5322.
91
+ "550 Requested action aborted [4]",
92
+ "has detected that this message is not RFC 5322",
93
+ ],
94
+ "rejected" => [
95
+ # - 550 sender envelope domain not allowed for sender IP address (#5.1.8)
96
+ # This error occurs when a sender attempts to send an email and any one of the
97
+ # following are true:
98
+ # * The sending domain has not been registered under My Domains or Third-Party Domains.
99
+ # * The sending domain is inactive.
100
+ # * The sending IP is not in Outbound Routes.
101
+ # - 553 Sorry, your domain has been blocked
102
+ # The error message indicates that your IP address is on the recipient’s private
103
+ # block list. Contact the recipient and request that your email address is added
104
+ # to their Email Security.cloud approved sender's list.
105
+ # - 553 Sorry, your email address has been blocked
106
+ # The error message indicates that your domain is on the recipient’s private block
107
+ # list. Contact the recipient by other means (e.g. phone) and request that your
108
+ # email address is added to their Email Security.cloud approved senders list.
109
+ # - https://knowledge.broadcom.com/external/article/162232
110
+ # You have received an email notification from Symantec Email Security.cloud:
111
+ # * An individual end user account is either sending spam through Symantec Email
112
+ # Security.cloud or is receiving a bounceback error message indicating they are
113
+ # on the "badmailfrom" list.
114
+ # * The error message received is: "553 sorry, your envelope sender is in my
115
+ # badmailfrom list. Please visit www.symanteccloud.com/troubleshooting for more
116
+ # details about this error message and instructions to resolve this issue. (#5.7.1)."
117
+ # - https://knowledge.broadcom.com/external/article/173082
118
+ # Emails from a sender are blocked by the Anti-Spam service stating that they are
119
+ # in your company's blacklist.
120
+ # * 553-Sorry, your email address has been blacklisted
121
+ # * 553-Sorry, your domain has been blacklisted
122
+ # * 553-Sorry, your IP address has been blacklisted
123
+ "sender envelope domain not allowed for sender IP address",
124
+ "your domain has been blocked",
125
+ "your email address has been blocked",
126
+ "your envelope sender is in my badmailfrom list",
127
+ "your email address has been blacklisted",
128
+ "your domain has been blacklisted",
129
+ ],
9
130
  "securityerror" => ["Please turn on SMTP Authentication in your mail client"],
10
- "userunknown" => ["542 ", " Rejected", "No such user"],
131
+ "spamdetected" => [
132
+ # - https://knowledge.broadcom.com/external/article/173867
133
+ # Legitimate email, either outbound or inbound, is incorrectly flagged as spam
134
+ # (false positive) by Email Security.cloud. This email may have the following errors:
135
+ # * 553 - Message Filtered
136
+ # * filtered by Outbound scanning.
137
+ "Message Filtered",
138
+ "filtered by Outbound scanning",
139
+ ],
140
+ "toomanyconn" => [
141
+ # - https://knowledge.broadcom.com/external/article/385809
142
+ # Email Security Cloud is attempting to deliver the email and recipient MTA is
143
+ # responding "452 Too many recipients received this hour".
144
+ # - https://knowledge.broadcom.com/external/article/164767
145
+ # This error can occur when sending outbound or inbound emails through Email
146
+ # Security.Cloud. A non-delivery receipt (NDR) stating delivery contains a message
147
+ # that the intended recipient has failed with error:
148
+ # "460 too many messages (#4.3.0)"
149
+ "Too many recipients received this hour",
150
+ "too many messages",
151
+ ],
152
+ "userunknown" => [
153
+ # - https://knowledge.broadcom.com/external/article/165163
154
+ # When sending email to a user on the Symantec Email Security.cloud service, the
155
+ # message is rejected. The sender receives a non-delivery email with a 500 series
156
+ # error code indicating that the recipient is invalid.
157
+ # <username@example.com>: 550-Invalid recipient <username@example.com> 550 (#5.1.1)
158
+ # - 553 Recipient mailbox is not allowed
159
+ # The error message indicates that you have sent an email to an invalid address
160
+ # in the recipient’s domain. Double-check the email address for any spelling errors.
161
+ # - https://knowledge.broadcom.com/external/article/175710
162
+ # This error indicates that you have sent an email to an invalid address to the
163
+ # recipient’s domain. "Recipient mailbox is not allowed"
164
+ "No such user",
165
+ "Invalid recipient",
166
+ "mailbox is not allowed",
167
+ "Recipient mailbox is not allowed",
168
+ ],
11
169
  }.freeze
12
170
 
13
171
  # Detect bounce reason from Email Security (formerly MessageLabs.com)
@@ -22,7 +180,7 @@ module Sisimai
22
180
 
23
181
  MessagesOf.each_key do |e|
24
182
  # Try to match the error message with message patterns defined in $MessagesOf
25
- next unless MessagesOf[e].any? { |a| issuedcode.include?(a) }
183
+ next if MessagesOf[e].none? { |a| issuedcode.include?(a) }
26
184
  reasontext = e
27
185
  break
28
186
  end
@@ -205,9 +205,9 @@ module Sisimai
205
205
  # - A valid X.509 certificate that isn't expired must be presented. X.509 certificates
206
206
  # must be renewed after their expiration, commonly annually.
207
207
  ['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"],
208
+ ['4.7.321', 0, 0, 'starttls-not-supported:'],
209
+ ['5.7.321', 0, 0, 'starttls-not-supported:'],
210
+ ['5.7.322', 0, 0, "certificate-expired:"],
211
211
 
212
212
  # - Records are DNSSEC authentic, but one or multiple of these scenarios occurred:
213
213
  # - The destination mail server's certificate doesn't match with what is expected per
@@ -219,13 +219,13 @@ module Sisimai
219
219
  # validity of recipient address and determine if the destination server is configured
220
220
  # correctly to receive messages.
221
221
  # - 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'],
222
+ ['4.7.323', 0, 0, 'tlsa-invalid:'],
223
+ ['5.7.323', 0, 0, 'tlsa-invalid:'],
224
224
 
225
225
  # - The destination domain indicated it was DNSSEC-authentic, but Exchange Online was
226
226
  # 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'],
227
+ ['4.7.324', 0, 0, 'dnssec-invalid:'],
228
+ ['5.7.324', 0, 0, 'dnssec-invalid:'],
229
229
 
230
230
  # - This happens when the presented certificate identities (CN and SAN) of a destina-
231
231
  # tion SMTP target host don't match any of the domains or MX host.
@@ -233,8 +233,8 @@ module Sisimai
233
233
  # validity of recipient address and determine if the destination server is configured
234
234
  # correctly to receive messages. For more information, see How SMTP DNS-based Authen-
235
235
  # 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)'],
236
+ ['4.7.325', 0, 0, 'certificate-host-mismatch:'],
237
+ ['5.7.325', 0, 0, 'certificate-host-mismatch:'],
238
238
  ],
239
239
  'mailboxfull' => [
240
240
  # Exchange Server 2019 ----------------------------------------------------------------
@@ -501,7 +501,7 @@ module Sisimai
501
501
  # - The sender has exceeded the recipient rate limit as described in Sending limits.
502
502
  # - This could indicate the account has been compromised and is being used to send
503
503
  # spam.
504
- ['5.1.90', 0, 0, "your message can't be sent because you've reached your daily limit for message recipients"],
504
+ ['5.1.90', 0, 0, "reached your daily limit for message recipients"],
505
505
 
506
506
  # - The sender has exceeded the recipient rate limit or the message rate limit as de-
507
507
  # scribed in Sending limits.
@@ -516,7 +516,7 @@ module Sisimai
516
516
  # Microsoft 365 or Office 365 users from rapidly filling their inboxes with a large
517
517
  # number of messages from errant automated notification systems or other single-send-
518
518
  # er mail storms.
519
- ['5.2.121', 0, 0, "recipient's per hour message receive limit from specific sender exceeded"],
519
+ ['5.2.121', 0, 0, "recipient's per hour message receive limit"],
520
520
 
521
521
  # - The Microsoft 365 or Office 365 recipient has exceeded the number of messages they
522
522
  # can receive per hour from all senders.
@@ -524,7 +524,7 @@ module Sisimai
524
524
  # messages they send per hour to a specific recipient. This limit helps protect
525
525
  # Microsoft 365 and Office 365 users from rapidly filling their inboxes with a large
526
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"],
527
+ ['5.2.122', 0, 0, "recipient's per hour message receive limit"],
528
528
 
529
529
  # - Access denied, [$SenderIPAddress] has exceeded permitted limits within $range range
530
530
  # - The sender's IPv6 range has attempted to send too many messages in too short a time
@@ -536,8 +536,8 @@ module Sisimai
536
536
  # - Ensure that any compromises or open relays have been resolved, and then contact
537
537
  # support through your regular channel. For more information, see Fix email delivery
538
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'],
539
+ ['5.7.', 700, 749, 'tenant has exceeded threshold'],
540
+ ['5.7.', 700, 749, 'traffic not accepted from this ip'],
541
541
  ],
542
542
  'suspend' => [
543
543
  # Exchange Online ---------------------------------------------------------------------
@@ -595,7 +595,7 @@ module Sisimai
595
595
  # is disabled. For this scenario to work, the organization's Office 365 administrator
596
596
  # should either enable Journaling Archive or change the journaling rule to journal
597
597
  # 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'],
598
+ ['5.3.190', 0, 0, 'when journaling archive is disabled'],
599
599
 
600
600
  # Previous versions of Exchange Server ------------------------------------------------
601
601
  ['5.0.0', 0, 0, 'helo / ehlo requires domain address'],
@@ -728,6 +728,55 @@ module Sisimai
728
728
  ['5.1.2', 0, 0, 'invalid x.400 address'],
729
729
  ],
730
730
  }.freeze
731
+ ErrorCodes = {
732
+ # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed.
733
+ # Reason for rate limitation is related to IP/domain reputation.
734
+ "RP-001" => ["421", "badreputation"],
735
+
736
+ # The mail server IP connecting to Outlook.com server has exceeded the rate limit allowed
737
+ # on this connection. Reason for rate limitation is related to IP/domain reputation.
738
+ "RP-002" => ["421", "badreputation"],
739
+
740
+ # The mail server IP connecting to Outlook.com server has exceeded the connection limit
741
+ # allowed. Reason for limitation is related to IP/domain reputation.
742
+ "RP-003" => ["421", "badreputation"],
743
+
744
+ # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
745
+ # to content with spam-like characteristics or IP/domain reputation.
746
+ "SC-001" => ["550", "badreputation"],
747
+
748
+ # Mail rejected by Outlook.com for policy reasons. The mail server IP connecting to
749
+ # Outlook.com has exhibited namespace mining behavior.
750
+ "SC-002" => ["550", "policyviolation"],
751
+
752
+ # Mail rejected by Outlook.com for policy reasons. Your IP address appears to be an
753
+ # open proxy/relay.
754
+ "SC-003" => ["550", "blocked"],
755
+
756
+ # Mail rejected by Outlook.com for policy reasons. A block has been placed against your
757
+ # IP address because we have received complaints concerning mail coming from that IP
758
+ # address. We recommend enrolling in our Junk Email Reporting Program (JMRP), a free
759
+ # program intended to help senders remove unwanted recipients from their email list
760
+ "SC-004" => ["550", "blocked"],
761
+
762
+ # Mail rejected by Outlook.com for policy reasons. We generally do not accept email
763
+ # from dynamic IP's as they are not typically used to deliver unauthenticated SMTP email
764
+ # to an Internet mail server. (Spamhaus)
765
+ "DY-001" => ["550", "blocked"],
766
+
767
+ # Mail rejected by Outlook.com for policy reasons. The likely cause is a compromised or
768
+ # virus infected server/personal computer.
769
+ "DY-002" => ["550", "virusdetected"],
770
+
771
+ # Mail rejected by Outlook.com for policy reasons. If you are not an email/network admin
772
+ # please contact your Email/Internet Service Provider for help. For more information
773
+ # about this block and to request removal please go to: Spamhaus.
774
+ "OU-001" => ["550", "blocked"],
775
+
776
+ # Mail rejected by Outlook.com for policy reasons. Reasons for rejection may be related
777
+ # to content with spam-like characteristics or IP/domain reputation.
778
+ "OU-002" => ["550", "badreputation"],
779
+ }.freeze
731
780
 
732
781
  # Detect bounce reason from Exchange Server 2019 or older and Exchange Online
733
782
  # @param [Sisimai::Fact] argvs Decoded email object
@@ -735,12 +784,11 @@ module Sisimai
735
784
  # @since v4.17.2
736
785
  def find(argvs)
737
786
  return '' if argvs['deliverystatus'].empty?
738
- return '' unless Sisimai::SMTP::Status.test(argvs['deliverystatus'])
787
+ return '' if Sisimai::SMTP::Status.test(argvs['deliverystatus']) == false
739
788
 
740
789
  statuscode = argvs['deliverystatus']
741
790
  issuedcode = argvs['diagnosticcode'].downcase
742
791
  thirddigit = statuscode.split('.')[-1].to_i
743
- reasontext = ''
744
792
 
745
793
  MessagesOf.each_key do |e|
746
794
  # Each key is a reason name
@@ -748,22 +796,25 @@ module Sisimai
748
796
  # ["status-code", min, max, "error message"]
749
797
  if f[1] == f[2]
750
798
  # This error code have no range
751
- next unless statuscode == f[0]
799
+ next if statuscode != f[0]
752
800
  else
753
801
  # 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]
802
+ next if statuscode.start_with?(f[0]) == false
803
+ next if thirddigit < f[1] || thirddigit > f[2]
757
804
  end
758
805
 
759
- next unless issuedcode.include?(f[3])
760
- reasontext = e
761
- break
806
+ return e if issuedcode.include?(f[3])
762
807
  end
763
- break unless reasontext.empty?
764
808
  end
765
809
 
766
- return reasontext
810
+ ErrorCodes.each_key do |e|
811
+ # The key name is an error code described at Outlook.com Postmaster/Troubleshooting
812
+ # https://substrate.office.com/ip-domain-management-snds/postmaster/troubleshooting
813
+ next if argvs['diagnosticcode'].include?(e) == false
814
+ return ErrorCodes[e][1] if argvs['replycode'] == ErrorCodes[e][0]
815
+ end
816
+
817
+ return ""
767
818
  end
768
819
 
769
820
  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'],
@@ -74,9 +76,17 @@ module Sisimai
74
76
  # if rejected, causing the journal queue to grow.
75
77
  # - Check to confirm there are no significant time discrepancies on the mail server.
76
78
  # Discontinue journaling old messages past the expiry threshold.
77
- [550, 'Journal messages past the expiration'],
79
+ [550, 'journal messages past the expiration'],
78
80
  ],
79
81
  'failedstarttls' => [
82
+ # - SMTP inbound TLS has been enabled but no SSL certificate (or no valid certificate)
83
+ # has been selected to be used.
84
+ # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
85
+ # Alternatively, ensure the certificates on the mail server haven't expired.
86
+ # If using a proxy server, ensure it isn't intercepting the traffic and modifying
87
+ # encryption parameters.
88
+ ["454", "tls not available due to temporary reason"],
89
+
80
90
  # - This email has been sent using SMTP, but TLS is required by policy.
81
91
  # - Delete or change the Secure Receipt or Secure Delivery policy enforcing TLS.
82
92
  # Alternatively, ensure the certificates on the mail server haven't expired. If using
@@ -199,6 +209,19 @@ module Sisimai
199
209
  [550, 'submitter failed to disabled'],
200
210
  [550, 'submitter failed to authenticate'],
201
211
  ],
212
+ 'spamdetected' => [
213
+ # - A signature was detected that could either be a virus, or a spam score over the
214
+ # maximum threshold. The spam score isn't available in the Administration Console. If
215
+ # you aren't a Mimecast customer but have emails rejected with this error code, con-
216
+ # tact the recipient to adjust their configuration and permit your address. If unsuc-
217
+ # cessful, your IT department can submit a request to review these email rejections
218
+ # via our Sender Feedback form.
219
+ # - Anti-virus checks cannot be bypassed. Contact the sender to see if they can stop
220
+ # these messages from being blocked. Anti-spam checks can be bypassed using a Per-
221
+ # mitted Senders or Auto Allow policy. Rejected emails can be viewed in your Outbound
222
+ # Activity and searching for the required email address.
223
+ [554, 'email rejected due to security policies'],
224
+ ],
202
225
  'systemerror' => [
203
226
  # - The Mimecast server is under maximum load.
204
227
  # - No action is required from the end-user. The message will retry 30 times and when
@@ -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