sisimai 5.5.0 → 5.7.0

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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake-test.yml +0 -4
  3. data/ChangeLog.md +53 -0
  4. data/LICENSE +1 -1
  5. data/README-JA.md +26 -20
  6. data/README.md +30 -25
  7. data/lib/sisimai/address.rb +8 -31
  8. data/lib/sisimai/arf.rb +3 -5
  9. data/lib/sisimai/fact.rb +26 -36
  10. data/lib/sisimai/lhost/activehunter.rb +0 -2
  11. data/lib/sisimai/lhost/amazonses.rb +7 -9
  12. data/lib/sisimai/lhost/apachejames.rb +0 -1
  13. data/lib/sisimai/lhost/biglobe.rb +0 -16
  14. data/lib/sisimai/lhost/courier.rb +5 -4
  15. data/lib/sisimai/lhost/deutschetelekom.rb +120 -0
  16. data/lib/sisimai/lhost/domino.rb +0 -3
  17. data/lib/sisimai/lhost/dragonfly.rb +0 -27
  18. data/lib/sisimai/lhost/einsundeins.rb +1 -10
  19. data/lib/sisimai/lhost/exchange2003.rb +4 -4
  20. data/lib/sisimai/lhost/exchange2007.rb +5 -6
  21. data/lib/sisimai/lhost/exim.rb +35 -85
  22. data/lib/sisimai/lhost/ezweb.rb +12 -49
  23. data/lib/sisimai/lhost/fml.rb +4 -29
  24. data/lib/sisimai/lhost/gmail.rb +0 -23
  25. data/lib/sisimai/lhost/gmx.rb +7 -24
  26. data/lib/sisimai/lhost/googlegroups.rb +3 -3
  27. data/lib/sisimai/lhost/googleworkspace.rb +0 -4
  28. data/lib/sisimai/lhost/imailserver.rb +3 -9
  29. data/lib/sisimai/lhost/kddi.rb +6 -20
  30. data/lib/sisimai/lhost/mailfoundry.rb +0 -2
  31. data/lib/sisimai/lhost/mailmarshal.rb +1 -3
  32. data/lib/sisimai/lhost/messagingserver.rb +4 -15
  33. data/lib/sisimai/lhost/mfilter.rb +0 -1
  34. data/lib/sisimai/lhost/mimecast.rb +0 -1
  35. data/lib/sisimai/lhost/notes.rb +1 -2
  36. data/lib/sisimai/lhost/opensmtpd.rb +0 -40
  37. data/lib/sisimai/lhost/postfix.rb +10 -11
  38. data/lib/sisimai/lhost/qmail.rb +14 -81
  39. data/lib/sisimai/lhost/sendmail.rb +4 -4
  40. data/lib/sisimai/lhost/trendmicro.rb +3 -3
  41. data/lib/sisimai/lhost/v5sendmail.rb +0 -1
  42. data/lib/sisimai/lhost/verizon.rb +1 -2
  43. data/lib/sisimai/lhost/x1.rb +1 -2
  44. data/lib/sisimai/lhost/x2.rb +0 -2
  45. data/lib/sisimai/lhost/x3.rb +4 -9
  46. data/lib/sisimai/lhost/x6.rb +0 -1
  47. data/lib/sisimai/lhost/zoho.rb +0 -12
  48. data/lib/sisimai/lhost.rb +38 -19
  49. data/lib/sisimai/message.rb +3 -1
  50. data/lib/sisimai/order.rb +4 -1
  51. data/lib/sisimai/reason/authfailure.rb +9 -13
  52. data/lib/sisimai/reason/badreputation.rb +7 -7
  53. data/lib/sisimai/reason/blocked.rb +57 -83
  54. data/lib/sisimai/reason/contenterror.rb +16 -8
  55. data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +22 -25
  56. data/lib/sisimai/reason/expired.rb +27 -23
  57. data/lib/sisimai/reason/filtered.rb +13 -17
  58. data/lib/sisimai/reason/hasmoved.rb +2 -1
  59. data/lib/sisimai/reason/hostunknown.rb +25 -19
  60. data/lib/sisimai/reason/mailboxfull.rb +28 -49
  61. data/lib/sisimai/reason/networkerror.rb +28 -16
  62. data/lib/sisimai/reason/norelaying.rb +21 -20
  63. data/lib/sisimai/reason/notaccept.rb +13 -8
  64. data/lib/sisimai/reason/notcompliantrfc.rb +6 -9
  65. data/lib/sisimai/reason/policyviolation.rb +17 -26
  66. data/lib/sisimai/reason/ratelimited.rb +62 -0
  67. data/lib/sisimai/reason/rejected.rb +51 -59
  68. data/lib/sisimai/reason/requireptr.rb +13 -25
  69. data/lib/sisimai/reason/securityerror.rb +14 -19
  70. data/lib/sisimai/reason/spamdetected.rb +51 -101
  71. data/lib/sisimai/reason/suspend.rb +30 -24
  72. data/lib/sisimai/reason/syntaxerror.rb +1 -8
  73. data/lib/sisimai/reason/systemerror.rb +37 -23
  74. data/lib/sisimai/reason/systemfull.rb +1 -1
  75. data/lib/sisimai/reason/userunknown.rb +81 -112
  76. data/lib/sisimai/reason/virusdetected.rb +6 -8
  77. data/lib/sisimai/reason.rb +15 -15
  78. data/lib/sisimai/rfc1123.rb +1 -1
  79. data/lib/sisimai/rfc1894.rb +7 -6
  80. data/lib/sisimai/rfc2045.rb +2 -2
  81. data/lib/sisimai/rfc3464/thirdparty.rb +1 -1
  82. data/lib/sisimai/rfc3464.rb +10 -14
  83. data/lib/sisimai/rfc3834.rb +3 -4
  84. data/lib/sisimai/rfc791.rb +3 -38
  85. data/lib/sisimai/rhost/apple.rb +5 -5
  86. data/lib/sisimai/rhost/cloudflare.rb +2 -0
  87. data/lib/sisimai/rhost/cox.rb +22 -20
  88. data/lib/sisimai/rhost/facebook.rb +16 -16
  89. data/lib/sisimai/rhost/franceptt.rb +8 -3
  90. data/lib/sisimai/rhost/godaddy.rb +33 -15
  91. data/lib/sisimai/rhost/google.rb +63 -64
  92. data/lib/sisimai/rhost/iua.rb +1 -1
  93. data/lib/sisimai/rhost/messagelabs.rb +12 -12
  94. data/lib/sisimai/rhost/microsoft.rb +86 -86
  95. data/lib/sisimai/rhost/mimecast.rb +34 -34
  96. data/lib/sisimai/rhost/nttdocomo.rb +2 -2
  97. data/lib/sisimai/rhost/spectrum.rb +7 -7
  98. data/lib/sisimai/rhost/tencent.rb +9 -11
  99. data/lib/sisimai/rhost/yahooinc.rb +7 -8
  100. data/lib/sisimai/rhost.rb +1 -1
  101. data/lib/sisimai/smtp/command.rb +2 -0
  102. data/lib/sisimai/smtp/status.rb +73 -109
  103. data/lib/sisimai/string.rb +0 -27
  104. data/lib/sisimai/version.rb +1 -1
  105. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-01.eml +66 -0
  106. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-02.eml +68 -0
  107. data/set-of-emails/maildir/bsd/lhost-deutschetelekom-03.eml +50 -0
  108. data/set-of-emails/should-not-crash/p5-664-iomart-mail-filter.eml +258 -0
  109. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/.gitkeep +0 -0
  110. metadata +10 -6
  111. data/lib/sisimai/reason/exceedlimit.rb +0 -47
  112. data/lib/sisimai/reason/speeding.rb +0 -47
  113. data/lib/sisimai/reason/toomanyconn.rb +0 -59
@@ -7,10 +7,10 @@ module Sisimai
7
7
  # @return [Array] Reason list
8
8
  def index
9
9
  return %w[
10
- AuthFailure BadReputation Blocked ContentError ExceedLimit Expired FailedSTARTTLS Filtered
11
- HasMoved HostUnknown MailboxFull MailerError MesgTooBig NetworkError NotAccept NotCompliantRFC
12
- OnHold Rejected NoRelaying Speeding SpamDetected VirusDetected PolicyViolation SecurityError
13
- Suspend RequirePTR SystemError SystemFull TooManyConn Suppressed UserUnknown SyntaxError
10
+ AuthFailure BadReputation Blocked ContentError EmailTooLarge Expired FailedSTARTTLS Filtered
11
+ HasMoved HostUnknown MailboxFull MailerError NetworkError NotAccept NotCompliantRFC RateLimited
12
+ OnHold Rejected NoRelaying SpamDetected VirusDetected PolicyViolation SecurityError Suspend
13
+ RequirePTR SystemError SystemFull Suppressed UserUnknown SyntaxError
14
14
  ]
15
15
  end
16
16
 
@@ -45,21 +45,21 @@ module Sisimai
45
45
  ModulePath = Sisimai::Reason.path
46
46
  GetRetried = Sisimai::Reason.retry
47
47
  ClassOrder = [
48
- %w[
49
- MailboxFull MesgTooBig ExceedLimit Suspend HasMoved NoRelaying AuthFailure UserUnknown
50
- Filtered RequirePTR NotCompliantRFC BadReputation ContentError Rejected HostUnknown
51
- SpamDetected Speeding TooManyConn Blocked
48
+ # 0. true() meethod in the following reasons are called from Reason->find()
49
+ %w[MailboxFull EmailTooLarge Suspend HasMoved NoRelaying AuthFailure UserUnknown Filtered RequirePTR
50
+ NotCompliantRFC BadReputation ContentError Rejected HostUnknown SpamDetected RateLimited Blocked
51
+ FailedSTARTTLS NotAccept VirusDetected PolicyViolation
52
52
  ],
53
+ # 1. match() method in the following reasons are called from Reason->find()
53
54
  %w[
54
- MailboxFull AuthFailure BadReputation Speeding SpamDetected VirusDetected PolicyViolation
55
- NoRelaying SystemError NetworkError Suspend ContentError SystemFull NotAccept Expired
56
- FailedSTARTTLS SecurityError Suppressed MailerError
55
+ MailboxFull SpamDetected VirusDetected NoRelaying SystemError NetworkError Suspend SystemFull
56
+ Suppressed MailerError SecurityError PolicyViolation SyntaxError Expired
57
57
  ],
58
58
  %w[
59
- MailboxFull MesgTooBig ExceedLimit Suspend UserUnknown Filtered Rejected HostUnknown
60
- SpamDetected Speeding TooManyConn Blocked SpamDetected AuthFailure FailedSTARTTLS
61
- SecurityError SystemError NetworkError Suspend Expired ContentError HasMoved SystemFull
62
- NotAccept MailerError NoRelaying Suppressed SyntaxError OnHold
59
+ MailboxFull EmailTooLarge Suspend UserUnknown Filtered Rejected HostUnknown SpamDetected
60
+ RateLimited Blocked SpamDetected AuthFailure FailedSTARTTLS SecurityError SystemError
61
+ NetworkError Suspend Expired ContentError HasMoved SystemFull NotAccept MailerError
62
+ NoRelaying Suppressed SyntaxError OnHold
63
63
  ]
64
64
  ]
65
65
 
@@ -125,7 +125,7 @@ module Sisimai
125
125
  sourcetext = sourcetext.gsub("[", " [").gsub("(", " (").gsub("<", " <") # Prefix a space character before each bracket
126
126
  sourcetext = sourcetext.gsub("]", "] ").gsub(")", ") ").gsub(">", "> ") # Suffix a space character behind each bracket
127
127
  sourcetext = sourcetext.gsub(":", ": ").gsub(";", "; ") # Suffix a space character behind : and ;
128
- sourcetext = Sisimai::String.sweep(sourcetext)
128
+ sourcetext = sourcetext.split.join(" ")
129
129
 
130
130
  catch :MAKELIST do
131
131
  Sandwiched.each do |e|
@@ -146,7 +146,7 @@ module Sisimai
146
146
  return nil if argv0.empty?
147
147
  label = Sisimai::RFC1894.label(argv0)
148
148
  group = FieldGroup[label] || ''
149
- parts = argv0.split(":", 2); parts[1] = parts[1].nil? ? "" : Sisimai::String.sweep(parts[1])
149
+ parts = argv0.split(":", 2); parts[1] = parts[1].nil? ? "" : parts[1].split.join(" ")
150
150
  return nil if group.empty? || CapturesOn[group].nil?
151
151
 
152
152
  # Try to match with each pattern of Per-Message field, Per-Recipient field
@@ -157,24 +157,25 @@ module Sisimai
157
157
  # - 4: Comment
158
158
  table = [label, "", "", group, ""]
159
159
 
160
- if group == 'addr' || group == 'code' || group == 'host'
160
+ case group
161
+ when "addr", "code", "host"
161
162
  # - Final-Recipient: RFC822; kijitora@nyaan.jp
162
163
  # - Diagnostic-Code: SMTP; 550 5.1.1 <kijitora@example.jp>... User Unknown
163
164
  # - Remote-MTA: DNS; mx.example.jp
164
165
  if parts[1].include?(";")
165
166
  # There is a valid sub type (including ";")
166
167
  v = parts[1].split(";", 2)
167
- table[1] = Sisimai::String.sweep(v[0]).upcase if v.size > 0
168
- table[2] = Sisimai::String.sweep(v[1]) if v.size > 1
168
+ table[1] = v[0].split.join(" ").upcase if v.size > 0
169
+ table[2] = v[1].split.join(" ") if v.size > 1
169
170
  else
170
171
  # There is no sub type like "Diagnostic-Code: 550 5.1.1 <kijitora@example.jp>..."
171
- table[2] = Sisimai::String.sweep(parts[1])
172
+ table[2] = parts[1]
172
173
  table[1] = SubtypeSet[group] || ""
173
174
  end
174
175
  table[2] = table[2].downcase if group == "host"
175
176
  table[2] = "" if table[2] =~ /\A\s+\z/
176
177
 
177
- elsif group == "list"
178
+ when "list"
178
179
  # Action: failed
179
180
  # Check that the value is an available value defined in "ActionList" or not.
180
181
  # When the value is invalid, convert to an available value defined in "Correction"
@@ -146,7 +146,7 @@ module Sisimai
146
146
  return nil if block.empty?
147
147
 
148
148
  (upperchunk, lowerchunk) = block.split("\n\n", 2)
149
- return ['', ''] if upperchunk.nil? || upperchunk.empty?
149
+ return ['', ''] if upperchunk.nil? || upperchunk.empty? || lowerchunk.nil?
150
150
  return ['', ''] if upperchunk.index('Content-Type').nil?
151
151
 
152
152
  headerpart = ['', ''] # ["text/plain; charset=iso-2022-jp; ...", "quoted-printable"]
@@ -263,7 +263,7 @@ module Sisimai
263
263
  # @return [String] Message body
264
264
  def makeflat(argv0 = '', argv1 = '')
265
265
  return "" if argv0.nil? || argv1.nil?
266
- return "" if argv0.index('multipart/') == false || argv0.index('boundary=') == false
266
+ return "" if argv0.downcase.index('multipart/') == false || argv0.downcase.index('boundary=') == false
267
267
 
268
268
  # Some bounce messages include lower-cased "content-type:" field such as the followings:
269
269
  # - content-type: message/delivery-status => Content-Type: message/delivery-status
@@ -71,7 +71,7 @@ module Sisimai
71
71
  fieldparts = argv1.split(":", 2)
72
72
  xfieldname = fieldparts[0].downcase
73
73
  xgroupname = FieldGroup[xfieldname]; return [] if xgroupname.nil?
74
- xfieldlist = ["", "", Sisimai::String.sweep(fieldparts[1]), xgroupname, "", "PowerMTA"]
74
+ xfieldlist = ["", "", fieldparts[1].split.join(" "), xgroupname, "", "PowerMTA"]
75
75
 
76
76
  # - 0: Field-Name
77
77
  # - 1: Sub Type: RFC822, DNS, X-Unix, and so on)
@@ -109,16 +109,12 @@ module Sisimai
109
109
  if isboundary.any? { |a| e == a } then goestonext = false; break; end
110
110
  if e.start_with?("Content-Type:")
111
111
  # Content-Type: field in multipart/*
112
- if e.include?("multipart/")
112
+ case
113
113
  # Content-Type: multipart/alternative; boundary=aa00220022222222ffeebb
114
114
  # Pick the boundary string and store it into "isboucdary"
115
- isboundary << Sisimai::RFC2045.boundary(e, 0)
116
- elsif e.include?("text/plain")
117
- # Content-Type: "text/plain"
118
- goestonext = false
119
- else
120
- # Other types: for example, text/html, image/jpg, and so on
121
- goestonext = true
115
+ when e.include?("multipart/") then isboundary << Sisimai::RFC2045.boundary(e, 0)
116
+ when e.include?("text/plain") then goestonext = false
117
+ else goestonext = true # Other types: for example, text/html, image/jpg, and so on
122
118
  end
123
119
  break
124
120
  end
@@ -145,7 +141,8 @@ module Sisimai
145
141
  next unless o = Sisimai::RFC1894.field(e)
146
142
  v = dscontents[-1]
147
143
 
148
- if o[3] == "addr"
144
+ case o[3]
145
+ when "addr"
149
146
  # Final-Recipient: rfc822; kijitora@example.jp
150
147
  # X-Actual-Recipient: rfc822; kijitora@example.co.jp
151
148
  if o[0] == "final-recipient"
@@ -165,7 +162,7 @@ module Sisimai
165
162
  # X-Actual-Recipient: rfc822; kijitora@example.co.jp
166
163
  v["alias"] = o[2]
167
164
  end
168
- elsif o[3] == "code"
165
+ when "code"
169
166
  # Diagnostic-Code: SMTP; 550 5.1.1 <userunknown@example.jp>... User Unknown
170
167
  v["spec"] = o[1]
171
168
  v["diagnosis"] = o[2]
@@ -212,7 +209,7 @@ module Sisimai
212
209
  # Diagnostic-Code: SMTP; 550-5.7.26 The MAIL FROM domain [email.example.jp]
213
210
  # has an SPF record with a hard fail
214
211
  next if e.start_with?(" ") == false
215
- v["diagnosis"] += " #{Sisimai::String.sweep(e)}"
212
+ v["diagnosis"] += " " + e
216
213
  end
217
214
  end
218
215
  end
@@ -232,7 +229,7 @@ module Sisimai
232
229
 
233
230
  if beforemesg != ""
234
231
  # Pick some values of $dscontents from the string before StartingOf[:message]
235
- beforemesg = Sisimai::String.sweep(beforemesg)
232
+ beforemesg = beforemesg.split.join(" ")
236
233
  alternates["command"] = Sisimai::SMTP::Command.find(beforemesg)
237
234
  alternates["replycode"] = Sisimai::SMTP::Reply.find(beforemesg, dscontents[0]["status"])
238
235
  alternates["status"] = Sisimai::SMTP::Status.find(beforemesg, alternates["replycode"])
@@ -242,7 +239,6 @@ module Sisimai
242
239
  dscontents.each do |e|
243
240
  # Set default values stored in "permessage" if each value in "dscontents" is empty.
244
241
  permessage.each_key { |a| e[a] ||= permessage[a] || '' }
245
- e["diagnosis"] = Sisimai::String.sweep(e["diagnosis"])
246
242
  lowercased = e["diagnosis"].downcase
247
243
 
248
244
  if recipients == 1
@@ -254,7 +250,7 @@ module Sisimai
254
250
  else
255
251
  # The value of e["diagnosis"] is not contained in $beforemesg
256
252
  # There may be an important error message in $beforemesg
257
- e["diagnosis"] = Sisimai::String.sweep(sprintf("%s %s", beforemesg, e["diagnosis"]))
253
+ e["diagnosis"] = sprintf("%s %s", beforemesg, e["diagnosis"])
258
254
  end
259
255
  end
260
256
  e["command"] = Sisimai::SMTP::Command.find(e["diagnosis"])
@@ -116,8 +116,7 @@ module Sisimai
116
116
  break if haveloaded >= maxmsgline
117
117
  end
118
118
  v['diagnosis'] ||= mhead['subject']
119
- v['diagnosis'] = Sisimai::String.sweep(v['diagnosis'])
120
- v['reason'] = 'vacation'
119
+ v['reason'] = 'vacation'
121
120
 
122
121
  cv = v['diagnosis'].downcase
123
122
  Suspending.each do |e|
@@ -127,8 +126,8 @@ module Sisimai
127
126
  break
128
127
  end
129
128
 
130
- v['date'] = mhead['date']
131
- v['status'] = ''
129
+ v['date'] = mhead['date']
130
+ v['status'] = ''
132
131
 
133
132
  if cv = lower['subject'].match(SubjectSet)
134
133
  # Get the Subject header from the original message
@@ -12,8 +12,7 @@ module Sisimai
12
12
 
13
13
  octet.each do |e|
14
14
  # Check each octet is between 0 and 255
15
- return false unless e =~ /\A[0-9]{1,3}\z/
16
- v = e.to_i
15
+ return false unless e =~ /\A[0-9]{1,3}\z/; v = e.to_i
17
16
  return false if v < 0 || v > 255
18
17
  end
19
18
  return true
@@ -27,42 +26,8 @@ module Sisimai
27
26
  return nil if argv0.to_s.empty?
28
27
  return [] if argv0.size < 7
29
28
 
30
- given = argv0.dup
31
- ipv4a = []
32
- %w|( ) [ ] ,|.each do |e|
33
- # Rewrite: "mx.example.jp[192.0.2.1]" => "mx.example.jp 192.0.2.1"
34
- p0 = given.index(e); next if p0.nil?
35
- given[p0, 1] = ' '
36
- end
37
-
38
- given.split(' ').each do |e|
39
- # Find string including an IPv4 address
40
- next if e.index('.').nil? # IPv4 address must include "." character
41
-
42
- lx = e.size; next if lx < 7 || lx > 17 # 0.0.0.0 = 7, [255.255.255.255] = 17
43
- cu = 0 # Cursor for seeking each octet of an IPv4 address
44
- as = '' # ASCII Code of each character
45
- eo = '' # Buffer of each octet of IPv4 Address
46
-
47
- while cu < lx
48
- # Check whether each character is a number or "." or not
49
- as = e[cu, 1].ord
50
- cu += 1
51
-
52
- if as < 48 || as > 57
53
- # The character is not a number(0-9)
54
- break if as != 46 # The character is not "."
55
- next if eo == '' # The current buffer is empty
56
- break if eo.to_i > 255 # The current buffer is greater than 255
57
- eo = ''
58
- next
59
- end
60
- eo += as.chr
61
- break if eo.to_i > 255
62
- end
63
- ipv4a << e if eo.size > 0 && eo.to_i < 256
64
- end
65
- return ipv4a
29
+ given = argv0.dup.tr('()[],', ' ').squeeze(' ')
30
+ return given.split(' ').select { |e| is_ipv4address(e) }
66
31
  end
67
32
 
68
33
  end
@@ -44,15 +44,15 @@ module Sisimai
44
44
  # Please visit https://support.apple.com/en-us/HT204137
45
45
  'due to local policy',
46
46
  ],
47
- 'rejected' => [
48
- # - 450 4.1.8 <kijitora@example.jp>: Sender address rejected: Domain not found
49
- 'sender address rejected',
50
- ],
51
- 'speeding' => [
47
+ 'ratelimited' => [
52
48
  # - 421 4.7.1 Messages to ****@icloud.com deferred due to excessive volume.
53
49
  # Try again later - https://support.apple.com/en-us/HT204137
54
50
  'due to excessive volume',
55
51
  ],
52
+ 'rejected' => [
53
+ # - 450 4.1.8 <kijitora@example.jp>: Sender address rejected: Domain not found
54
+ 'sender address rejected',
55
+ ],
56
56
  'suspend' => [
57
57
  # - https://support.apple.com/guide/icloud/stop-using-or-reactivate-addresses-mm3adb030cbf/icloud
58
58
  # - 550 5.1.1 <****@icloud.com>: inactive email address (in reply to RCPT TO command)
@@ -6,6 +6,8 @@ module Sisimai
6
6
  module Cloudflare
7
7
  class << self
8
8
  MessagesOf = {
9
+ # - 554 <YOUR_IP_ADDRESS> found on one or more RBLs (abusixip). Refer to
10
+ # https://developers.cloudflare.com/email-routing/postmaster/#spam-and-abusive-traffic/
9
11
  "blocked" => ["found on one or more DNSBLs"],
10
12
  "systemerror" => ["Upstream error"],
11
13
  }.freeze
@@ -37,13 +37,13 @@ module Sisimai
37
37
  # - There is a limit to the number of concurrent SMTP connections per IP address to
38
38
  # protect the systems against attack. Ensure that the sending email server is not
39
39
  # opening more than 10 concurrent connections to avoid reaching this limit.
40
- 'CXCNCT' => 'toomanyconn',
40
+ 'CXCNCT' => 'ratelimited',
41
41
 
42
42
  # CXMXRT
43
43
  # - The sender has sent email to too many recipients and needs to wait before sending
44
44
  # more email.
45
45
  # - The email sender has exceeded the maximum number of sent email allowed.
46
- 'CXMXRT' => 'toomanyconn',
46
+ 'CXMXRT' => 'ratelimited',
47
47
 
48
48
  # CDRBL
49
49
  # - The sending IP address has been temporarily blocked by Cox due to exhibiting spam-like
@@ -87,31 +87,18 @@ module Sisimai
87
87
  'cox too many bad commands from',
88
88
  'too many invalid recipients',
89
89
  ],
90
- 'requireptr' => [
91
- # - The reverse DNS check of the sending server IP address has failed.
92
- # - Cox requires that all connecting email servers contain valid reverse DNS PTR records.
93
- 'dns check failure - try again later',
94
- 'rejected - no rdns',
95
- ],
96
- 'policyviolation' => [
97
- # - The sending server has attempted to communicate too soon within the SMTP transaction
90
+ 'contenterror' => [
98
91
  # - The message has been rejected because it contains an attachment with one of the
99
92
  # following prohibited file types, which commonly contain viruses: .shb, .shs, .vbe,
100
93
  # .vbs, .wsc, .wsf, .wsh, .pif, .msc, .msi, .msp, .reg, .sct, .bat, .chm, .isp, .cpl,
101
94
  # .js, .jse, .scr, .exe.
102
- 'esmtp no data before greeting',
103
95
  'attachment extension is forbidden',
104
96
  ],
105
- 'rejected' => [
106
- # Cox requires that all sender domains resolve to a valid MX or A-record within DNS.
107
- 'sender rejected',
108
- ],
109
- 'systemerror' => [
110
- # - Our systems are experiencing an issue which is causing a temporary inability to
111
- # accept new email.
112
- 'esmtp server temporarily not available',
97
+ 'policyviolation' => [
98
+ # - The sending server has attempted to communicate too soon within the SMTP transaction
99
+ 'esmtp no data before greeting',
113
100
  ],
114
- 'toomanyconn' => [
101
+ 'ratelimited' => [
115
102
  # - The sending IP address has exceeded the five maximum concurrent connection limit.
116
103
  # - The SMTP connection has exceeded the 100 email message threshold and was disconnected.
117
104
  # - The sending IP address has exceeded one of these rate limits and has been temporarily
@@ -120,6 +107,21 @@ module Sisimai
120
107
  'requested action aborted: try again later',
121
108
  'message threshold exceeded',
122
109
  ],
110
+ 'rejected' => [
111
+ # Cox requires that all sender domains resolve to a valid MX or A-record within DNS.
112
+ 'sender rejected',
113
+ ],
114
+ 'requireptr' => [
115
+ # - The reverse DNS check of the sending server IP address has failed.
116
+ # - Cox requires that all connecting email servers contain valid reverse DNS PTR records.
117
+ 'dns check failure - try again later',
118
+ 'rejected - no rdns',
119
+ ],
120
+ 'systemerror' => [
121
+ # - Our systems are experiencing an issue which is causing a temporary inability to
122
+ # accept new email.
123
+ 'esmtp server temporarily not available',
124
+ ],
123
125
  'userunknown' => [
124
126
  # - The intended recipient is not a valid Cox Email account.
125
127
  'recipient rejected',
@@ -15,14 +15,18 @@ module Sisimai
15
15
  "POL-P1", # Your mail server's IP Address is listed on the Spamhaus PBL.
16
16
  "POL-P2", # Facebook will no longer accept mail from your mail server's IP Address.
17
17
  "POL-P3", # Facebook is not accepting messages from your mail server. This will persist for 4 to 8 hours.
18
- "POL-P4", # Facebook is not accepting messages from your mail server. This will persist for 24 to 48 hours.
19
- "POL-T1", # Facebook is not accepting messages from your mail server, but they may be retried later. This will persist for 1 to 2 hours.
20
- "POL-T2", # Facebook is not accepting messages from your mail server, but they may be retried later. This will persist for 4 to 8 hours.
21
- "POL-T3", # Facebook is not accepting messages from your mail server, but they may be retried later. This will persist for 24 to 48 hours.
18
+ "POL-P4", # ". This will persist for 24 to 48 hours.
19
+ "POL-T1", # ", but they may be retried later. This will persist for 1 to 2 hours.
20
+ "POL-T2", # ", but they may be retried later. This will persist for 4 to 8 hours.
21
+ "POL-T3", # ", but they may be retried later. This will persist for 24 to 48 hours.
22
22
  ],
23
23
  "contenterror" => [
24
24
  "MSG-P2", # The message contains an attachment type that Facebook does not accept.
25
25
  ],
26
+ "emailtoolarge" => [
27
+ "MSG-P1", # The message exceeds Facebook's maximum allowed size.
28
+ "INT-P2", # The message exceeds Facebook's maximum allowed size.
29
+ ],
26
30
  "filtered" => [
27
31
  "RCP-P2", # The attempted recipient's preferences prevent messages from being delivered.
28
32
  "RCP-P3", # The attempted recipient's privacy settings blocked the delivery.
@@ -30,16 +34,19 @@ module Sisimai
30
34
  "mailboxfull" => [
31
35
  "INT-P7", # The attempted recipient has exceeded their storage quota.
32
36
  ],
33
- "mesgtoobig" => [
34
- "MSG-P1", # The message exceeds Facebook's maximum allowed size.
35
- "INT-P2", # The message exceeds Facebook's maximum allowed size.
36
- ],
37
37
  "notcompliantrfc" => [
38
38
  "MSG-P3", # The message contains multiple instances of a header field that can only be present once.
39
39
  ],
40
40
  "policyviolation" => [
41
41
  "POL-P8", # The message does not comply with Facebook's abuse policies and will not be accepted.
42
42
  ],
43
+ "ratelimited" => [
44
+ "CON-T1", # Facebook's mail server currently has too many connections open to allow another one.
45
+ "CON-T2", # Your mail server currently has too many connections open to Facebook's mail servers.
46
+ "CON-T3", # Your mail server has opened too many new connections to Facebook's mail servers in a short period of time.
47
+ "CON-T4", # Your mail server has exceeded the maximum number of recipients for its current connection.
48
+ "MSG-T1", # The number of recipients on the message exceeds Facebook's allowed maximum.
49
+ ],
43
50
  "rejected" => [
44
51
  "DNS-P1", # Your SMTP MAIL FROM domain does not exist.
45
52
  "DNS-P2", # Your SMTP MAIL FROM domain does not have an MX record.
@@ -59,17 +66,10 @@ module Sisimai
59
66
  "RCP-T1", # The attempted recipient address is not currently available due to an internal system issue.
60
67
  "INT-Tx", # These codes indicate a temporary issue internal to Facebook's system.
61
68
  ],
62
- "toomanyconn" => [
63
- "CON-T1", # Facebook's mail server currently has too many connections open to allow another one.
64
- "CON-T2", # Your mail server currently has too many connections open to Facebook's mail servers.
65
- "CON-T3", # Your mail server has opened too many new connections to Facebook's mail servers in a short period of time.
66
- "CON-T4", # Your mail server has exceeded the maximum number of recipients for its current connection.
67
- "MSG-T1", # The number of recipients on the message exceeds Facebook's allowed maximum.
68
- ],
69
69
  "userunknown" => [
70
70
  "RCP-P1", # The attempted recipient address does not exist.
71
71
  "INT-P1", # The attempted recipient address does not exist.
72
- "INT-P3", # The attempted recpient group address does not exist.
72
+ "INT-P3", # The attempted recipient group address does not exist.
73
73
  "INT-P4", # The attempted recipient address does not exist.
74
74
  ],
75
75
  "virusdetected" => [
@@ -43,7 +43,7 @@ module Sisimai
43
43
  # - 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
44
44
  # - Too many connections, slow down. OFR005_104 [104]
45
45
  # - Too many connections, slow down. LPN105_104
46
- '104' => 'toomanyconn',
46
+ '104' => 'ratelimited',
47
47
 
48
48
  # - Your IP address is missing a DNS PTR record, it also called a rDNS (reverse DNS)
49
49
  # Please set up a valid DNS PTR record for your IP address that point to your domain,
@@ -56,7 +56,7 @@ module Sisimai
56
56
  # Please reduce the number of messages per connection, recommended value is 100
57
57
  # messages per connections
58
58
  # - Veuillez essayer plus tard. LPN003_109
59
- "109" => 'toomanyconn',
59
+ "109" => 'ratelimited',
60
60
 
61
61
  # - Invalid HELO/EHLO
62
62
  # Please set up a valid HELO/EHLO, it must be fully qualified domain name (FQDN) and
@@ -82,6 +82,11 @@ module Sisimai
82
82
  # - 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
83
83
  '405' => 'rejected',
84
84
 
85
+ # - Your Sender has been rejected
86
+ # Please contact Orange by using our contact form and select option
87
+ # "Un problème d'envoi d'emails vers les adresses Orange ou Wanadoo (deliverability issue)"
88
+ "406" => 'rejected',
89
+
85
90
  # - User doesn't exist here
86
91
  # Please remove this email address from your distribution list, it does not exist
87
92
  # - 550 5.1.1 Adresse d au moins un destinataire invalide.
@@ -144,7 +149,7 @@ module Sisimai
144
149
  # are trying to send
145
150
  # - 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard. Service refused, please try
146
151
  # later. OFR_999 [999]
147
- "99X" => 'toomanyconn',
152
+ "99X" => 'ratelimited',
148
153
 
149
154
  # Other undocumented or old error codes
150
155
  "105" => "", # Veuillez essayer plus tard.
@@ -69,19 +69,19 @@ module Sisimai
69
69
  # retry. IB605
70
70
  # - The message has attempted to mail too many recipients.
71
71
  # - Reduce the number of recipients and try again.
72
- 'IB605' => 'toomanyconn',
72
+ 'IB605' => 'ratelimited',
73
73
 
74
74
  # - 421 Connection refused, too many sessions from This IP. Lower the number of concurrent
75
75
  # sessions. IB007
76
76
  # - This IP address currently has too many sessions open.
77
77
  # - Check with your email provider to reduce the number of open sessions on your IP
78
78
  # address and then try again.
79
- 'IB007' => 'toomanyconn',
79
+ 'IB007' => 'ratelimited',
80
80
 
81
81
  # - 421 Server temporarily unavailable. Try again later. IB101
82
82
  # - The email queue is experiencing higher than normal email volume.
83
83
  # - Try again later.
84
- 'IB101' => 'speeding',
84
+ 'IB101' => 'ratelimited',
85
85
 
86
86
  # - 554 This IP has been temporarily blocked for attempting to send too many messages
87
87
  # containing content judged to be spam by the Internet community. IB110
@@ -112,16 +112,16 @@ module Sisimai
112
112
 
113
113
  # - 550 This IP has sent too many messages this hour. IB504
114
114
  # - This IP address has reached the maximum allowed messages for that hour.
115
- 'IB504' => 'speeding',
115
+ 'IB504' => 'ratelimited',
116
116
 
117
117
  # - 550 This message has exceeded the max number of messages per session. Open a new
118
118
  # session and try again. IB510
119
119
  # - This IP address has reached the maximum allowed messages for that session.
120
- 'IB510' => 'speeding',
120
+ 'IB510' => 'ratelimited',
121
121
 
122
122
  # - 550 This IP has sent too many to too many recipients this hour. IB607
123
123
  # - This IP address has reached the maximum allowed recipients for that hour.
124
- 'IB607' => 'speeding',
124
+ 'IB607' => 'ratelimited',
125
125
 
126
126
  # Remote block list (RBL) bounces
127
127
  # ---------------------------------------------------------------------------------------
@@ -143,6 +143,14 @@ module Sisimai
143
143
  'IB106' => 'blocked',
144
144
  }.freeze
145
145
  MessagesOf = {
146
+ 'authfailure' => [
147
+ # - 550 SPF Sender Invalid - envelope rejected
148
+ # - 550 5.7.9: This mail has been blocked because the sender is unauthenticated
149
+ # - 550-5.7.26 DKIM = did not pass
150
+ "spf sender invalid - envelope rejected",
151
+ "this mail has been blocked because the sender is unauthenticated",
152
+ "dkim = did not pass",
153
+ ],
146
154
  'blocked' => [
147
155
  # - 554 RBL Reject.
148
156
  # - This IP address was blocked from our internal RBL.
@@ -169,6 +177,25 @@ module Sisimai
169
177
  # make space for more email.
170
178
  'account storage limit',
171
179
  ],
180
+ 'norelaying' => [
181
+ # - 550 5.7.1: Relay access denied
182
+ "relay access denied",
183
+ ],
184
+ 'ratelimited' => [
185
+ # - 550 5.7.232 Your message can't be sent because your trial tenant has exceeded
186
+ # its daily limit for sending email to external recipients (tenant external recipient rate limit)
187
+ # - 550 5.7.233 - Your message can't be sent because your tenant exceeded its daily
188
+ # limit for sending email to external recipients (tenant external recipient rate limit)
189
+ "exceeded its daily limit",
190
+ ],
191
+ 'rejected' => [
192
+ # - 550 5.1.8 Access denied, bad outbound sender AS (42004)
193
+ "bad outbound sender as (42004)",
194
+ ],
195
+ 'securityerror' => [
196
+ # - 550 Please turn on SMTP Authentication in your mail client
197
+ "turn on smtp authentication in your mail client",
198
+ ],
172
199
  'spamdetected' => [
173
200
  # - 552 Message rejected for spam or virus content
174
201
  # - The email message contains a link, attachment, or pattern caught by our filters as spam.
@@ -188,15 +215,6 @@ module Sisimai
188
215
  # other. They need to correct their forwarding settings.
189
216
  'message is looping',
190
217
  ],
191
- 'toomanyconn' => [
192
- # - 550 5.7.232 Your message can't be sent because your trial tenant has exceeded
193
- # its daily limit for sending email to external recipients (tenant external
194
- # recipient rate limit)
195
- # - 550 5.7.233 - Your message can't be sent because your tenant exceeded its daily
196
- # limit for sending email to external recipients (tenant external recipient rate
197
- # limit)
198
- "exceeded its daily limit",
199
- ],
200
218
  'userunknown' => [
201
219
  # - 550 Recipient not found
202
220
  # - The recipient is not a valid email address.