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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/ChangeLog.md +50 -0
- data/README-JA.md +10 -37
- data/README.md +10 -37
- data/lib/sisimai.rb +15 -64
- data/lib/sisimai/address.rb +13 -17
- data/lib/sisimai/arf.rb +4 -4
- data/lib/sisimai/data.rb +3 -5
- data/lib/sisimai/lhost.rb +0 -14
- data/lib/sisimai/lhost/activehunter.rb +31 -55
- data/lib/sisimai/lhost/amavis.rb +41 -66
- data/lib/sisimai/lhost/amazonses.rb +189 -235
- data/lib/sisimai/lhost/amazonworkmail.rb +48 -71
- data/lib/sisimai/lhost/aol.rb +49 -75
- data/lib/sisimai/lhost/apachejames.rb +60 -83
- data/lib/sisimai/lhost/bigfoot.rb +61 -85
- data/lib/sisimai/lhost/biglobe.rb +40 -62
- data/lib/sisimai/lhost/courier.rb +60 -82
- data/lib/sisimai/lhost/domino.rb +50 -76
- data/lib/sisimai/lhost/einsundeins.rb +57 -55
- data/lib/sisimai/lhost/exchange2003.rb +79 -101
- data/lib/sisimai/lhost/exchange2007.rb +66 -74
- data/lib/sisimai/lhost/exim.rb +119 -142
- data/lib/sisimai/lhost/ezweb.rb +53 -73
- data/lib/sisimai/lhost/facebook.rb +49 -75
- data/lib/sisimai/lhost/fml.rb +25 -50
- data/lib/sisimai/lhost/gmx.rb +55 -79
- data/lib/sisimai/lhost/google.rb +39 -66
- data/lib/sisimai/lhost/gsuite.rb +74 -94
- data/lib/sisimai/lhost/imailserver.rb +34 -67
- data/lib/sisimai/lhost/interscanmss.rb +33 -67
- data/lib/sisimai/lhost/kddi.rb +30 -52
- data/lib/sisimai/lhost/mailfoundry.rb +35 -57
- data/lib/sisimai/lhost/mailmarshalsmtp.rb +66 -89
- data/lib/sisimai/lhost/mailru.rb +51 -76
- data/lib/sisimai/lhost/mcafee.rb +53 -79
- data/lib/sisimai/lhost/messagelabs.rb +49 -75
- data/lib/sisimai/lhost/messagingserver.rb +91 -113
- data/lib/sisimai/lhost/mfilter.rb +50 -70
- data/lib/sisimai/lhost/mxlogic.rb +38 -63
- data/lib/sisimai/lhost/notes.rb +53 -82
- data/lib/sisimai/lhost/office365.rb +64 -81
- data/lib/sisimai/lhost/opensmtpd.rb +30 -52
- data/lib/sisimai/lhost/outlook.rb +49 -75
- data/lib/sisimai/lhost/postfix.rb +116 -117
- data/lib/sisimai/lhost/qmail.rb +33 -55
- data/lib/sisimai/lhost/receivingses.rb +49 -75
- data/lib/sisimai/lhost/sendgrid.rb +68 -203
- data/lib/sisimai/lhost/sendmail.rb +101 -125
- data/lib/sisimai/lhost/surfcontrol.rb +53 -79
- data/lib/sisimai/lhost/userdefined.rb +15 -35
- data/lib/sisimai/lhost/v5sendmail.rb +59 -89
- data/lib/sisimai/lhost/verizon.rb +75 -124
- data/lib/sisimai/lhost/x1.rb +30 -54
- data/lib/sisimai/lhost/x2.rb +28 -52
- data/lib/sisimai/lhost/x3.rb +44 -68
- data/lib/sisimai/lhost/x4.rb +34 -58
- data/lib/sisimai/lhost/x5.rb +42 -70
- data/lib/sisimai/lhost/yahoo.rb +44 -68
- data/lib/sisimai/lhost/yandex.rb +59 -85
- data/lib/sisimai/lhost/zoho.rb +54 -78
- data/lib/sisimai/mail.rb +5 -9
- data/lib/sisimai/mail/maildir.rb +10 -14
- data/lib/sisimai/mail/mbox.rb +8 -12
- data/lib/sisimai/mail/memory.rb +5 -9
- data/lib/sisimai/mail/stdin.rb +7 -11
- data/lib/sisimai/mda.rb +2 -2
- data/lib/sisimai/message.rb +51 -154
- data/lib/sisimai/mime.rb +2 -2
- data/lib/sisimai/order.rb +2 -27
- data/lib/sisimai/reason.rb +3 -5
- data/lib/sisimai/rfc1894.rb +1 -1
- data/lib/sisimai/rfc3464.rb +29 -29
- data/lib/sisimai/rfc3834.rb +7 -6
- data/lib/sisimai/rfc5322.rb +20 -31
- data/lib/sisimai/rhost/franceptt.rb +120 -24
- data/lib/sisimai/rhost/iua.rb +1 -1
- data/lib/sisimai/smtp/error.rb +7 -7
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/maildir/bsd/email-einsundeins-03.eml +66 -0
- data/set-of-emails/maildir/bsd/email-exchange2007-05.eml +1469 -0
- data/set-of-emails/maildir/bsd/email-exchange2007-06.eml +764 -0
- data/set-of-emails/maildir/bsd/email-postfix-64.eml +96 -0
- data/set-of-emails/maildir/bsd/rfc3834-03.eml +26 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-04.eml +66 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-05.eml +96 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-06.eml +100 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-07.eml +97 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-08.eml +78 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-10.eml +79 -0
- data/set-of-emails/maildir/bsd/rhost-franceptt-11.eml +96 -0
- metadata +14 -9
- data/lib/sisimai/bite.rb +0 -42
- data/lib/sisimai/bite/email.rb +0 -18
- data/lib/sisimai/bite/json.rb +0 -16
- data/lib/sisimai/message/email.rb +0 -26
- data/lib/sisimai/message/json.rb +0 -24
- data/lib/sisimai/order/email.rb +0 -20
- data/lib/sisimai/order/json.rb +0 -16
data/lib/sisimai/mime.rb
CHANGED
@@ -134,9 +134,9 @@ module Sisimai
|
|
134
134
|
encodename = nil
|
135
135
|
ctencoding = nil
|
136
136
|
mimeinside = false
|
137
|
-
|
137
|
+
textslices = argv1.split("\n")
|
138
138
|
|
139
|
-
while e =
|
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
|
data/lib/sisimai/order.rb
CHANGED
@@ -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
|
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
|
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
|
data/lib/sisimai/reason.rb
CHANGED
@@ -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
|
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
|
120
|
+
trytomatch ||= true if GetRetried[reasontext]
|
123
121
|
trytomatch ||= true if argvs.diagnostictype != 'SMTP'
|
124
122
|
throw :TRY_TO_MATCH unless trytomatch
|
125
123
|
|
data/lib/sisimai/rfc1894.rb
CHANGED
@@ -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]
|
130
|
+
break unless Correction[:action][match[2]]
|
131
131
|
match[2] = Correction[:action][match[2]]
|
132
132
|
end
|
133
133
|
break
|
data/lib/sisimai/rfc3464.rb
CHANGED
@@ -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[ ]
|
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:[ ]*[<].+[>]
|
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
|
-
|
112
|
-
|
114
|
+
bodyslices = mbody.scrub('?').split("\n")
|
115
|
+
readslices = ['']
|
113
116
|
mdabounced = Sisimai::MDA.make(mhead, mbody)
|
114
|
-
|
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 =
|
128
|
-
#
|
129
|
-
|
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
|
-
|
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
|
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
|
-
|
382
|
-
while e =
|
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
|
-
|
422
|
-
# Try to get a recipient address from
|
423
|
-
|
424
|
-
#
|
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
|
441
|
+
if e['alterrors']
|
443
442
|
# Copy alternative error message
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
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
|
-
|
473
|
-
return { 'ds' => dscontents, 'rfc822' => rfc822part }
|
473
|
+
return { 'ds' => dscontents, 'rfc822' => rfc822text }
|
474
474
|
end
|
475
475
|
|
476
476
|
end
|
data/lib/sisimai/rfc3834.rb
CHANGED
@@ -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
|
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
|
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
|
-
|
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
|
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 =
|
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
|
|
data/lib/sisimai/rfc5322.rb
CHANGED
@@ -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
|
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
|
-
#
|
181
|
-
#
|
182
|
-
# @
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
'
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
'
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
'
|
32
|
-
|
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
|