sisimai 4.25.4 → 4.25.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sisimai might be problematic. Click here for more details.

Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/ChangeLog.md +50 -0
  4. data/README-JA.md +10 -37
  5. data/README.md +10 -37
  6. data/lib/sisimai.rb +15 -64
  7. data/lib/sisimai/address.rb +13 -17
  8. data/lib/sisimai/arf.rb +4 -4
  9. data/lib/sisimai/data.rb +3 -5
  10. data/lib/sisimai/lhost.rb +0 -14
  11. data/lib/sisimai/lhost/activehunter.rb +31 -55
  12. data/lib/sisimai/lhost/amavis.rb +41 -66
  13. data/lib/sisimai/lhost/amazonses.rb +189 -235
  14. data/lib/sisimai/lhost/amazonworkmail.rb +48 -71
  15. data/lib/sisimai/lhost/aol.rb +49 -75
  16. data/lib/sisimai/lhost/apachejames.rb +60 -83
  17. data/lib/sisimai/lhost/bigfoot.rb +61 -85
  18. data/lib/sisimai/lhost/biglobe.rb +40 -62
  19. data/lib/sisimai/lhost/courier.rb +60 -82
  20. data/lib/sisimai/lhost/domino.rb +50 -76
  21. data/lib/sisimai/lhost/einsundeins.rb +57 -55
  22. data/lib/sisimai/lhost/exchange2003.rb +79 -101
  23. data/lib/sisimai/lhost/exchange2007.rb +66 -74
  24. data/lib/sisimai/lhost/exim.rb +119 -142
  25. data/lib/sisimai/lhost/ezweb.rb +53 -73
  26. data/lib/sisimai/lhost/facebook.rb +49 -75
  27. data/lib/sisimai/lhost/fml.rb +25 -50
  28. data/lib/sisimai/lhost/gmx.rb +55 -79
  29. data/lib/sisimai/lhost/google.rb +39 -66
  30. data/lib/sisimai/lhost/gsuite.rb +74 -94
  31. data/lib/sisimai/lhost/imailserver.rb +34 -67
  32. data/lib/sisimai/lhost/interscanmss.rb +33 -67
  33. data/lib/sisimai/lhost/kddi.rb +30 -52
  34. data/lib/sisimai/lhost/mailfoundry.rb +35 -57
  35. data/lib/sisimai/lhost/mailmarshalsmtp.rb +66 -89
  36. data/lib/sisimai/lhost/mailru.rb +51 -76
  37. data/lib/sisimai/lhost/mcafee.rb +53 -79
  38. data/lib/sisimai/lhost/messagelabs.rb +49 -75
  39. data/lib/sisimai/lhost/messagingserver.rb +91 -113
  40. data/lib/sisimai/lhost/mfilter.rb +50 -70
  41. data/lib/sisimai/lhost/mxlogic.rb +38 -63
  42. data/lib/sisimai/lhost/notes.rb +53 -82
  43. data/lib/sisimai/lhost/office365.rb +64 -81
  44. data/lib/sisimai/lhost/opensmtpd.rb +30 -52
  45. data/lib/sisimai/lhost/outlook.rb +49 -75
  46. data/lib/sisimai/lhost/postfix.rb +116 -117
  47. data/lib/sisimai/lhost/qmail.rb +33 -55
  48. data/lib/sisimai/lhost/receivingses.rb +49 -75
  49. data/lib/sisimai/lhost/sendgrid.rb +68 -203
  50. data/lib/sisimai/lhost/sendmail.rb +101 -125
  51. data/lib/sisimai/lhost/surfcontrol.rb +53 -79
  52. data/lib/sisimai/lhost/userdefined.rb +15 -35
  53. data/lib/sisimai/lhost/v5sendmail.rb +59 -89
  54. data/lib/sisimai/lhost/verizon.rb +75 -124
  55. data/lib/sisimai/lhost/x1.rb +30 -54
  56. data/lib/sisimai/lhost/x2.rb +28 -52
  57. data/lib/sisimai/lhost/x3.rb +44 -68
  58. data/lib/sisimai/lhost/x4.rb +34 -58
  59. data/lib/sisimai/lhost/x5.rb +42 -70
  60. data/lib/sisimai/lhost/yahoo.rb +44 -68
  61. data/lib/sisimai/lhost/yandex.rb +59 -85
  62. data/lib/sisimai/lhost/zoho.rb +54 -78
  63. data/lib/sisimai/mail.rb +5 -9
  64. data/lib/sisimai/mail/maildir.rb +10 -14
  65. data/lib/sisimai/mail/mbox.rb +8 -12
  66. data/lib/sisimai/mail/memory.rb +5 -9
  67. data/lib/sisimai/mail/stdin.rb +7 -11
  68. data/lib/sisimai/mda.rb +2 -2
  69. data/lib/sisimai/message.rb +51 -154
  70. data/lib/sisimai/mime.rb +2 -2
  71. data/lib/sisimai/order.rb +2 -27
  72. data/lib/sisimai/reason.rb +3 -5
  73. data/lib/sisimai/rfc1894.rb +1 -1
  74. data/lib/sisimai/rfc3464.rb +29 -29
  75. data/lib/sisimai/rfc3834.rb +7 -6
  76. data/lib/sisimai/rfc5322.rb +20 -31
  77. data/lib/sisimai/rhost/franceptt.rb +120 -24
  78. data/lib/sisimai/rhost/iua.rb +1 -1
  79. data/lib/sisimai/smtp/error.rb +7 -7
  80. data/lib/sisimai/version.rb +1 -1
  81. data/set-of-emails/maildir/bsd/email-einsundeins-03.eml +66 -0
  82. data/set-of-emails/maildir/bsd/email-exchange2007-05.eml +1469 -0
  83. data/set-of-emails/maildir/bsd/email-exchange2007-06.eml +764 -0
  84. data/set-of-emails/maildir/bsd/email-postfix-64.eml +96 -0
  85. data/set-of-emails/maildir/bsd/rfc3834-03.eml +26 -0
  86. data/set-of-emails/maildir/bsd/rhost-franceptt-04.eml +66 -0
  87. data/set-of-emails/maildir/bsd/rhost-franceptt-05.eml +96 -0
  88. data/set-of-emails/maildir/bsd/rhost-franceptt-06.eml +100 -0
  89. data/set-of-emails/maildir/bsd/rhost-franceptt-07.eml +97 -0
  90. data/set-of-emails/maildir/bsd/rhost-franceptt-08.eml +78 -0
  91. data/set-of-emails/maildir/bsd/rhost-franceptt-10.eml +79 -0
  92. data/set-of-emails/maildir/bsd/rhost-franceptt-11.eml +96 -0
  93. metadata +14 -9
  94. data/lib/sisimai/bite.rb +0 -42
  95. data/lib/sisimai/bite/email.rb +0 -18
  96. data/lib/sisimai/bite/json.rb +0 -16
  97. data/lib/sisimai/message/email.rb +0 -26
  98. data/lib/sisimai/message/json.rb +0 -24
  99. data/lib/sisimai/order/email.rb +0 -20
  100. data/lib/sisimai/order/json.rb +0 -16
@@ -134,9 +134,9 @@ module Sisimai
134
134
  encodename = nil
135
135
  ctencoding = nil
136
136
  mimeinside = false
137
- hasdivided = argv1.split("\n")
137
+ textslices = argv1.split("\n")
138
138
 
139
- while e = hasdivided.shift do
139
+ while e = textslices.shift do
140
140
  # This is a multi-part message in MIME format. Your mail reader does not
141
141
  # understand MIME message format.
142
142
  # --=_gy7C4Gpes0RP4V5Bs9cK4o2Us2ZT57b-3OLnRN+4klS8dTmQ
@@ -79,12 +79,6 @@ module Sisimai
79
79
  'Sisimai::Lhost::SurfControl',
80
80
  ].freeze
81
81
 
82
- OrderJ1 = [
83
- # These modules support JSON structure
84
- 'Sisimai::Lhost::AmazonSES',
85
- 'Sisimai::Lhost::SendGrid',
86
- ].freeze
87
-
88
82
  # This variable don't hold MTA name which have one or more MTA specific
89
83
  # header such as X-AWS-Outgoing, X-Yandex-Uniq.
90
84
  Pattern = {
@@ -183,7 +177,7 @@ module Sisimai
183
177
  # @return [Hash] Pattern table for the group
184
178
  def by(group = '')
185
179
  return {} if group.empty?
186
- return Pattern[group] if Pattern.key?(group)
180
+ return Pattern[group] if Pattern[group]
187
181
  return {}
188
182
  end
189
183
  Subject = Sisimai::Order.by('subject').freeze
@@ -216,7 +210,7 @@ module Sisimai
216
210
 
217
211
  Module.const_get(e).headerlist.each do |v|
218
212
  # Get header name which required each MTA module
219
- next if Skips.key?(v)
213
+ next if Skips[v]
220
214
  table[v] ||= []
221
215
  table[v] << e
222
216
  end
@@ -224,25 +218,6 @@ module Sisimai
224
218
  return table
225
219
  end
226
220
 
227
- # @abstract Make default order of MTA(JSON) modules to be loaded
228
- # @return [Array] Default order list of MTA(JSON) modules
229
- # @until v4.25.5
230
- def forjson; return OrderJ1; end
231
-
232
- # @abstract Print warnings about an obsoleted method. This method will be
233
- # removed at the future release of Sisimai
234
- # @until v4.25.6
235
- def warn(whois = '', useit = nil)
236
- label = ' ***warning:'
237
- methodname = caller[0][/`.*'/][1..-2]
238
- messageset = sprintf("%s %s.%s is marked as obsoleted", label, whois, methodname)
239
-
240
- useit ||= methodname
241
- messageset << sprintf(" and will be removed at %s.", Sisimai::Lhost.removedat)
242
- messageset << sprintf(" Use %s.%s instead.\n", self.name, useit) if useit != 'gone'
243
- Kernel.warn messageset
244
- end
245
-
246
221
  end
247
222
  end
248
223
  end
@@ -52,16 +52,14 @@ module Sisimai
52
52
  return nil unless argvs
53
53
  return nil unless argvs.is_a? Sisimai::Data
54
54
 
55
- unless GetRetried.key?(argvs.reason)
55
+ unless GetRetried[argvs.reason]
56
56
  # Return reason text already decided except reason match with the
57
57
  # regular expression of retry() method.
58
58
  return argvs.reason unless argvs.reason.empty?
59
59
  end
60
+ return 'delivered' if argvs.deliverystatus.start_with?('2.')
60
61
 
61
- statuscode = argvs.deliverystatus || ''
62
62
  reasontext = ''
63
- return 'delivered' if statuscode.start_with?('2.')
64
-
65
63
  if argvs.diagnostictype == 'SMTP' || argvs.diagnostictype == ''
66
64
  # Diagnostic-Code: SMTP; ... or empty value
67
65
  ClassOrder[0].each do |e|
@@ -119,7 +117,7 @@ module Sisimai
119
117
  while true
120
118
  diagnostic = argvs.diagnosticcode.downcase || ''
121
119
  trytomatch = reasontext.empty? ? true : false
122
- trytomatch ||= true if GetRetried.key?(reasontext)
120
+ trytomatch ||= true if GetRetried[reasontext]
123
121
  trytomatch ||= true if argvs.diagnostictype != 'SMTP'
124
122
  throw :TRY_TO_MATCH unless trytomatch
125
123
 
@@ -127,7 +127,7 @@ module Sisimai
127
127
 
128
128
  # Correct invalid value in Action field:
129
129
  break unless group == 'list'
130
- break unless Correction[:action].key?(match[2])
130
+ break unless Correction[:action][match[2]]
131
131
  match[2] = Correction[:action][match[2]]
132
132
  end
133
133
  break
@@ -16,12 +16,15 @@ module Sisimai
16
16
  )
17
17
  |the[ ]original[ ]message[ ]was[ ]received[ ]at[ ]
18
18
  |this[ ]report[ ]relates[ ]to[ ]your[ ]message
19
- |your[ ]message[ ]was[ ]not[ ]delivered[ ]to[ ]the[ ]following[ ]recipients
19
+ |your[ ]message[ ](?:
20
+ could[ ]not[ ]be[ ]delivered
21
+ |was[ ]not[ ]delivered[ ]to[ ]the[ ]following[ ]recipients
22
+ )
20
23
  )
21
24
  }x,
22
25
  rfc822: %r{\A(?>
23
26
  content-type:[ ]*(?:message/rfc822|text/rfc822-headers)
24
- |return-path:[ ]*[<].+[>]\z
27
+ |return-path:[ ]*[<].+[>]
25
28
  )\z
26
29
  }x,
27
30
  error: %r/\A(?:[45]\d\d[ \t]+|[<][^@]+[@][^@]+[>]:?[ \t]+)/,
@@ -108,10 +111,10 @@ module Sisimai
108
111
  require 'sisimai/mda'
109
112
 
110
113
  dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
111
- hasdivided = mbody.scrub('?').split("\n")
112
- havepassed = ['']
114
+ bodyslices = mbody.scrub('?').split("\n")
115
+ readslices = ['']
113
116
  mdabounced = Sisimai::MDA.make(mhead, mbody)
114
- rfc822list = [] # (Array) Each line in message/rfc822 part string
117
+ rfc822text = '' # (String) message/rfc822 part text
115
118
  maybealias = nil # (String) Original-Recipient Field
116
119
  blanklines = 0 # (Integer) The number of blank lines
117
120
  readcursor = 0 # (Integer) Points the current cursor position
@@ -124,11 +127,11 @@ module Sisimai
124
127
  }
125
128
  v = nil
126
129
 
127
- while e = hasdivided.shift do
128
- # Save the current line for the next loop
129
- havepassed << e
130
+ while e = bodyslices.shift do
131
+ # Read error messages and delivery status lines from the head of the email
132
+ # to the previous line of the beginning of the original message.
133
+ readslices << e # Save the current line for the next loop
130
134
  d = e.downcase
131
- p = havepassed[-2]
132
135
 
133
136
  if readcursor == 0
134
137
  # Beginning of the bounce message or delivery status part
@@ -153,7 +156,7 @@ module Sisimai
153
156
  break if blanklines > 1
154
157
  next
155
158
  end
156
- rfc822list << e
159
+ rfc822text << e << "\n"
157
160
  else
158
161
  # Error message part
159
162
  next unless readcursor & Indicators[:deliverystatus] > 0
@@ -291,7 +294,7 @@ module Sisimai
291
294
  # Diagnostic-Code: 554 ...
292
295
  v['diagnosis'] = cv[1]
293
296
 
294
- elsif p.start_with?('Diagnostic-Code:') && cv = e.match(/\A[ \t]+(.+)\z/)
297
+ elsif readslices[-2].start_with?('Diagnostic-Code:') && cv = e.match(/\A[ \t]+(.+)\z/)
295
298
  # Continued line of the value of Diagnostic-Code header
296
299
  v['diagnosis'] << ' ' << cv[1]
297
300
  e = 'Diagnostic-Code: ' << e
@@ -378,8 +381,8 @@ module Sisimai
378
381
  break unless match > 0
379
382
 
380
383
  b = dscontents[-1]
381
- hasdivided = mbody.split("\n")
382
- while e = hasdivided.shift do
384
+ bodyslices = mbody.split("\n")
385
+ while e = bodyslices.shift do
383
386
  # Get the recipient's email address and error messages.
384
387
  break if e.start_with?('__END_OF_EMAIL_MESSAGE__')
385
388
  d = e.downcase
@@ -418,15 +421,11 @@ module Sisimai
418
421
  end
419
422
  return nil unless itisbounce
420
423
 
421
- unless recipients > 0
422
- # Try to get a recipient address from email headers
423
- rfc822list.each do |e|
424
- # Check To: header in the original message
425
- next unless cv = e.match(/\ATo:\s*(.+)\z/)
426
- r = Sisimai::Address.find(cv[1], true) || []
427
- next if r.empty?
424
+ if recipients == 0 && cv = rfc822text.match(/^To:[ ]*(.+)/)
425
+ # Try to get a recipient address from "To:" header of the original message
426
+ if r = Sisimai::Address.find(cv[1], true)
427
+ # Found a recipient address
428
428
  dscontents << Sisimai::Lhost.DELIVERYSTATUS if dscontents.size == recipients
429
-
430
429
  b = dscontents[-1]
431
430
  b['recipient'] = r[0][:address]
432
431
  b['agent'] = Sisimai::RFC3464.smtpagent + '::Fallback'
@@ -439,14 +438,16 @@ module Sisimai
439
438
  # Set default values if each value is empty.
440
439
  connheader.each_key { |a| e[a] ||= connheader[a] || '' }
441
440
 
442
- if e.key?('alterrors') && !e['alterrors'].empty?
441
+ if e['alterrors']
443
442
  # Copy alternative error message
444
- e['diagnosis'] ||= e['alterrors']
445
- if e['diagnosis'].start_with?('-') || e['diagnosis'].end_with?('__')
446
- # Override the value of diagnostic code message
447
- e['diagnosis'] = e['alterrors'] unless e['alterrors'].empty?
443
+ unless e['alterrors'].empty?
444
+ e['diagnosis'] ||= e['alterrors']
445
+ if e['diagnosis'].start_with?('-') || e['diagnosis'].end_with?('__')
446
+ # Override the value of diagnostic code message
447
+ e['diagnosis'] = e['alterrors']
448
+ end
449
+ e.delete('alterrors')
448
450
  end
449
- e.delete('alterrors')
450
451
  end
451
452
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis']) || ''
452
453
 
@@ -469,8 +470,7 @@ module Sisimai
469
470
  e.each_key { |a| e[a] ||= '' }
470
471
  end
471
472
 
472
- rfc822part = Sisimai::RFC5322.weedout(rfc822list)
473
- return { 'ds' => dscontents, 'rfc822' => rfc822part }
473
+ return { 'ds' => dscontents, 'rfc822' => rfc822text }
474
474
  end
475
475
 
476
476
  end
@@ -10,6 +10,7 @@ module Sisimai
10
10
  'auto-submitted' => %r/\Aauto-(?:generated|replied|notified)/,
11
11
  # https://msdn.microsoft.com/en-us/library/ee219609(v=exchg.80).aspx
12
12
  'x-auto-response-suppress' => %r/(?:oof|autoreply)/,
13
+ 'x-apple-action' => %r/\Avacation\z/,
13
14
  'precedence' => %r/\Aauto_reply\z/,
14
15
  'subject' => %r/\A(?>
15
16
  auto:
@@ -39,7 +40,7 @@ module Sisimai
39
40
 
40
41
  def description; 'Detector for auto replied message'; end
41
42
  def smtpagent; 'RFC3834'; end
42
- def headerlist; return %w[auto-submitted precedence x-auto-response-suppress]; end
43
+ def headerlist; return %w[auto-submitted precedence x-auto-response-suppress x-apple-action]; end
43
44
 
44
45
  # Detect auto reply message as RFC3834
45
46
  # @param [Hash] mhead Message header of a bounce email
@@ -59,7 +60,7 @@ module Sisimai
59
60
  # DETECT_EXCLUSION_MESSAGE
60
61
  Excludings.each_key do |e|
61
62
  # Exclude message from root@
62
- next unless mhead.key?(e)
63
+ next unless mhead[e]
63
64
  next unless mhead[e]
64
65
  next unless mhead[e].downcase =~ Excludings[e]
65
66
  leave = 1
@@ -70,7 +71,7 @@ module Sisimai
70
71
  # DETECT_AUTO_REPLY_MESSAGE
71
72
  AutoReply1.each_key do |e|
72
73
  # RFC3834 Auto-Submitted and other headers
73
- next unless mhead.key?(e)
74
+ next unless mhead[e]
74
75
  next unless mhead[e]
75
76
  next unless mhead[e].downcase =~ AutoReply1[e]
76
77
  match += 1
@@ -80,7 +81,7 @@ module Sisimai
80
81
 
81
82
  require 'sisimai/lhost'
82
83
  dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
83
- hasdivided = mbody.scrub('?').split("\n")
84
+ bodyslices = mbody.scrub('?').split("\n")
84
85
  rfc822part = '' # (String) message/rfc822-headers part
85
86
  recipients = 0 # (Integer) The number of 'Final-Recipient' header
86
87
  maxmsgline = 5 # (Integer) Max message length(lines)
@@ -92,7 +93,7 @@ module Sisimai
92
93
  # RECIPIENT_ADDRESS
93
94
  %w[from return-path].each do |e|
94
95
  # Try to get the address of the recipient
95
- next unless mhead.key?(e)
96
+ next unless mhead[e]
96
97
  next unless mhead[e]
97
98
  v['recipient'] = mhead[e]
98
99
  break
@@ -113,7 +114,7 @@ module Sisimai
113
114
  end
114
115
 
115
116
  # BODY_PARSER: Get vacation message
116
- while e = hasdivided.shift do
117
+ while e = bodyslices.shift do
117
118
  # Read the first 5 lines except a blank line
118
119
  countuntil += 1 if e =~ MarkingsOf[:boundary]
119
120
 
@@ -57,7 +57,7 @@ module Sisimai
57
57
  # @return [Array,Hash] RFC822 Header list
58
58
  def HEADERFIELDS(group = '')
59
59
  return HeaderIndex if group.empty?
60
- return HeaderTable[group] if HeaderTable.key?(group)
60
+ return HeaderTable[group] if HeaderTable[group]
61
61
  return HeaderTable
62
62
  end
63
63
 
@@ -177,37 +177,26 @@ module Sisimai
177
177
  return hosts
178
178
  end
179
179
 
180
- # Weed out rfc822/message header fields excepct necessary fields
181
- # @param [Array] argv1 each line divided message/rc822 part
182
- # @return [String] Selected fields
183
- def weedout(argv1)
184
- return nil unless argv1.is_a?(Array)
185
-
186
- rfc822next = { from: false, to: false, subject: false }
187
- rfc822part = '' # (String) message/rfc822-headers part
188
- previousfn = '' # (String) Previous field name
189
-
190
- while e = argv1.shift do
191
- # After "message/rfc822"
192
- if e.start_with?(' ', "\t")
193
- # Continued line from the previous line
194
- next if rfc822next[previousfn]
195
- rfc822part << e + "\n" if LongHeaders.key?(previousfn)
196
- else
197
- # Get required headers only
198
- (lhs, rhs) = e.split(/:[ ]*/, 2)
199
- next unless lhs
200
- lhs.downcase!
201
-
202
- previousfn = ''
203
- next unless HeaderIndex.key?(lhs)
204
-
205
- previousfn = lhs
206
- rfc822part << e + "\n"
207
- end
180
+ # Split given entire message body into error message lines and the original
181
+ # message part only include email headers
182
+ # @param [String] mbody Entire message body
183
+ # @param [Regexp] regex Regular expression of the message/rfc822 or the
184
+ # beginning of the original message part
185
+ # @return [Array] [Error message lines, The original message]
186
+ # @since v4.25.5
187
+ def fillet(mbody = '', regex)
188
+ return nil if mbody.empty?
189
+ return nil unless regex
190
+
191
+ v = mbody.split(regex, 2)
192
+ v[1] ||= ''
193
+
194
+ unless v[1].empty?
195
+ v[1].sub(/\A[\r\n\s]+/, '')
196
+ v[1].sub(/\n\n.+\z/m, '')
197
+ v[1] << "\n" unless v[1].end_with?("\n")
208
198
  end
209
-
210
- return rfc822part
199
+ return v
211
200
  end
212
201
 
213
202
  end
@@ -8,28 +8,124 @@ module Sisimai
8
8
  class << self
9
9
  # Imported from p5-Sisimail/lib/Sisimai/Rhost/FrancePTT.pm
10
10
  ErrorCodes = {
11
- '103' => 'blocked', # Service refuse. Veuillez essayer plus tard.
12
- '104' => 'toomanyconn', # Too many connections, slow down. LPN105_104
13
- '105' => nil, # Veuillez essayer plus tard.
14
- '109' => nil, # Veuillez essayer plus tard. LPN003_109
15
- '201' => nil, # Veuillez essayer plus tard. OFR004_201
16
- '305' => 'securityerror', # 550 5.7.0 Code d'authentification invalide OFR_305
17
- '401' => 'blocked', # 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
18
- '402' => 'securityerror', # 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
19
- '403' => 'rejected', # 5.0.1 Emetteur invalide. Invalid Sender.
20
- '405' => 'rejected', # 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
21
- '415' => 'rejected', # Emetteur invalide. Invalid Sender. OFR_415
22
- '416' => 'userunknown', # 550 5.1.1 Adresse d au moins un destinataire invalide. Invalid recipient. LPN416
23
- '417' => 'mailboxfull', # 552 5.1.1 Boite du destinataire pleine. Recipient overquota.
24
- '418' => 'userunknown', # Adresse d au moins un destinataire invalide
25
- '420' => 'suspend', # Boite du destinataire archivee. Archived recipient.
26
- '421' => 'rejected', # 5.5.3 Mail from not owned by user. LPN105_421.
27
- '423' => nil, # Service refused, please try later. LPN105_423
28
- '424' => nil, # Veuillez essayer plus tard. LPN105_424
29
- '506' => 'spamdetected', # Mail rejete. Mail rejected. OFR_506 [506]
30
- '510' => 'blocked', # Veuillez essayer plus tard. service refused, please try later. LPN004_510
31
- '513' => nil, # Mail rejete. Mail rejected. OUK_513
32
- '514' => 'mesgtoobig', # Taille limite du message atteinte
11
+ # 550 5.7.1 Service unavailable; client [X.X.X.X] blocked using Spamhaus
12
+ # Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
13
+ # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
14
+ # The emails sent to the mail host Laposte.net were blocked by our services.
15
+ # To regularize your situation please click on the link below and follow the procedure
16
+ # https://www.spamhaus.org/lookup/ LPNAAA_101 (in reply to RCPT TO command))
17
+ '101' => 'blocked',
18
+
19
+ # 550 mwinf5c04 ME Adresse IP source bloquee pour incident de spam.
20
+ # Client host blocked for spamming issues. OFR006_102 Ref
21
+ #
22
+ # refused to talk to me: 550 5.5.0 Les emails envoyes vers la messagerie Laposte.net ont ete bloques par nos services.
23
+ # Afin de regulariser votre situation, nous vous invitons a cliquer sur le lien ci-dessous et a suivre la procedure.
24
+ # The emails sent to the mail host Laposte.net were blocked by our services.
25
+ # To regularize your situation please click on the link below and follow the procedure
26
+ # https://senderscore.org/blacklistlookup/ LPN007_102
27
+ '102' => 'blocked',
28
+
29
+ # refused to talk to me: 550 mwinf5c10 ME Service refuse. Veuillez essayer plus tard.
30
+ # Service refused, please try later. OFR006_103 X.X.X.X [103]
31
+ '103' => 'blocked',
32
+
33
+ # refused to talk to me: 421 mwinf5c79 ME Trop de connexions, veuillez verifier votre configuration.
34
+ # Too many connections, slow down. OFR005_104 [104]
35
+ # Too many connections, slow down. LPN105_104
36
+ '104' => 'toomanyconn',
37
+
38
+ # Veuillez essayer plus tard.
39
+ '105' => nil,
40
+
41
+ # refused to talk to me: 421 4.2.1 Service refuse. Veuillez essayer plus tard.
42
+ # Service refused, please try later. LPN006_107)
43
+ '107' => nil,
44
+
45
+ # refused to talk to me: 550 5.5.0 Service refuse. Veuillez essayer plus tard.
46
+ # service refused, please try later. LPN001_108
47
+ '108' => nil,
48
+
49
+ # Veuillez essayer plus tard. LPN003_109
50
+ '109' => nil,
51
+
52
+ # Veuillez essayer plus tard. OFR004_201
53
+ '201' => nil,
54
+
55
+ # 550 5.7.0 Code d'authentification invalide OFR_305
56
+ '305' => 'securityerror',
57
+
58
+ # 550 5.5.0 SPF: *** is not allowed to send mail. LPN004_401
59
+ '401' => 'blocked',
60
+
61
+ # 550 5.5.0 Authentification requise. Authentication Required. LPN105_402
62
+ '402' => 'securityerror',
63
+
64
+ # 5.0.1 Emetteur invalide. Invalid Sender.
65
+ '403' => 'rejected',
66
+
67
+ # 5.0.1 Emetteur invalide. Invalid Sender. LPN105_405
68
+ # 501 5.1.0 Emetteur invalide. Invalid Sender. OFR004_405 [405] (in reply to MAIL FROM command))
69
+ '405' => 'rejected',
70
+
71
+ # Emetteur invalide. Invalid Sender. OFR_415
72
+ '415' => 'rejected',
73
+
74
+ # 550 5.1.1 Adresse d au moins un destinataire invalide.
75
+ # Invalid recipient. LPN416 (in reply to RCPT TO command)
76
+ # Invalid recipient. OFR_416 [416] (in reply to RCPT TO command)
77
+ '416' => 'userunknown',
78
+
79
+ # 552 5.1.1 Boite du destinataire pleine.
80
+ # Recipient overquota. OFR_417 [417] (in reply to RCPT TO command))
81
+ '417' => 'mailboxfull',
82
+
83
+ # Adresse d au moins un destinataire invalide
84
+ '418' => 'userunknown',
85
+
86
+ # 550 5.5.0 Boite du destinataire archivee.
87
+ # Archived recipient. LPN007_420 (in reply to RCPT TO command)
88
+ '420' => 'suspend',
89
+
90
+ # 5.5.3 Mail from not owned by user. LPN105_421.
91
+ '421' => 'rejected',
92
+
93
+ # Service refused, please try later. LPN105_423
94
+ '423' => nil,
95
+
96
+ # Veuillez essayer plus tard. LPN105_424
97
+ '424' => nil,
98
+
99
+ # 550 5.5.0 Le compte du destinataire est bloque. The recipient account isblocked. LPN007_426 (in reply to RCPT TO command)
100
+ '426' => 'suspend',
101
+
102
+ # 421 4.2.0 Service refuse. Veuillez essayer plus tard.
103
+ # Service refused, please try later. OFR005_505 [505] (in reply to end of DATA command)
104
+ #
105
+ # 421 4.2.1 Service refuse. Veuillez essayer plus tard.
106
+ # Service refused, please try later. LPN007_505 (in reply to end of DATA command)
107
+ '505' => 'systemerror',
108
+
109
+ # Mail rejete. Mail rejected. OFR_506 [506]
110
+ '506' => 'spamdetected',
111
+
112
+ # 550 5.5.0 Service refuse. Veuillez essayer plus tard.
113
+ # service refused, please try later. LPN005_510 (in reply to end of DATA command)
114
+ '510' => 'blocked',
115
+
116
+ # Mail rejete. Mail rejected. OUK_513
117
+ '513' => nil,
118
+
119
+ # Taille limite du message atteinte
120
+ '514' => 'mesgtoobig',
121
+
122
+ # 571 5.7.1 Message refused, DMARC verification Failed.
123
+ # Message refuse, verification DMARC en echec LPN007_517
124
+ '517' => 'policyviolation',
125
+
126
+ # 421 mwinf5c77 ME Service refuse. Veuillez essayer plus tard.
127
+ # Service refused, please try later. OFR_999 [999]
128
+ '999' => 'blocked',
33
129
  }.freeze
34
130
 
35
131
  # Detect bounce reason from Oranage or La Poste
@@ -41,8 +137,8 @@ module Sisimai
41
137
  statusmesg = argvs.diagnosticcode
42
138
  reasontext = ''
43
139
 
44
- if cv = statusmesg.match(/\b(LPN|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/)
45
- # OUK_513, LPN105-104, OFR102-104
140
+ if cv = statusmesg.match(/\b(LPN|LPNAAA|OFR|OUK)(_[0-9]{3}|[0-9]{3}[-_][0-9]{3})\b/i)
141
+ # OUK_513, LPN105-104, OFR102-104, ofr_506
46
142
  v = sprintf("%03d", (cv[1] + cv[2])[-3, 3])
47
143
  reasontext = ErrorCodes[v] || 'undefined'
48
144
  end