sisimai 4.17.0 → 4.17.1
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/Changes +7 -0
- data/lib/sisimai/mail/maildir.rb +5 -5
- data/lib/sisimai/mta/exim.rb +15 -4
- data/lib/sisimai/reason/blocked.rb +1 -0
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/maildir/bsd/exim-29.eml +58 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a42edca9932389c588b9cbc2208c8531a7722e65
|
4
|
+
data.tar.gz: 62273ce1977ea42bf91e1069aadd1d3a07ba6ae3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ce829b47122fd9cd02bf950f7ec9d6566b87b61d09c4bd3744d69831972fcbb242a460cea5648f8efe7c7ddd18370c0615540284089d4767eb65e3487a3bb0d
|
7
|
+
data.tar.gz: bcede47e3c589b2ec43254bda629f4524d95f6131264ce6684eab47729f5a5f00abc37764c6fca84b42edbdcd2fbeb40e91d05ec51acb28e867d1d6523d72041
|
data/Changes
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
Revision history for Ruby version of Sisimai
|
2
2
|
|
3
|
+
4.17.1 Wed, 30 Mar 2016 14:00:22 +0900 (JST)
|
4
|
+
- Ported codes from https://github.com/sisimai/p5-Sisimai/pull/180 to fix
|
5
|
+
issue https://github.com/sisimai/p5-Sisimai/issues/179 a variable in lib/
|
6
|
+
sisimai/mta/exim.rb is not quoted before passing to %r// operator.
|
7
|
+
- Fixed serious bug in Sisimai::Mail::Maildir#read method reported at issue
|
8
|
+
#55 and #56 by pull-request #57. Thanks to @taku1201.
|
9
|
+
|
3
10
|
4.17.0 Wed, 16 Mar 2016 12:22:44 +0900 (JST)
|
4
11
|
- Implement new reason "syntaxerror". Sisimai will set "syntaxerror" to the
|
5
12
|
raeson when the value of "replycode" begins with "50" such as 502, 503,
|
data/lib/sisimai/mail/maildir.rb
CHANGED
@@ -12,7 +12,7 @@ module Sisimai
|
|
12
12
|
:path, # [String] Path to each file
|
13
13
|
:file, # [String] Each file name of a mail in the Maildir/
|
14
14
|
:inodes, # [Array] i-node List of files in the Maildir/
|
15
|
-
:
|
15
|
+
:count, # [Integer] The number of file has read
|
16
16
|
:handle, # [IO::Dir] Directory handle
|
17
17
|
]
|
18
18
|
@@roaccessors.each { |e| attr_reader e }
|
@@ -30,15 +30,15 @@ module Sisimai
|
|
30
30
|
@size = Dir.entries(argv1).size
|
31
31
|
@dir = argv1
|
32
32
|
@file = nil
|
33
|
-
@offset = 0
|
34
33
|
@inodes = {}
|
34
|
+
@count = 0
|
35
35
|
@handle = Dir.open(argv1)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Maildir reader, works as a iterator.
|
39
39
|
# @return [String] Contents of file in Maildir/
|
40
40
|
def read
|
41
|
-
return nil unless self.
|
41
|
+
return nil unless self.count < self.size
|
42
42
|
|
43
43
|
seekhandle = self.handle
|
44
44
|
readbuffer = ''
|
@@ -46,7 +46,6 @@ module Sisimai
|
|
46
46
|
begin
|
47
47
|
while r = seekhandle.read do
|
48
48
|
# Read each file in the directory
|
49
|
-
self.offset = seekhandle.pos
|
50
49
|
next if r == '.' || r == '..'
|
51
50
|
|
52
51
|
emailindir = sprintf('%s/%s', self.dir, r)
|
@@ -70,7 +69,8 @@ module Sisimai
|
|
70
69
|
break
|
71
70
|
end
|
72
71
|
|
73
|
-
|
72
|
+
self.count += 1
|
73
|
+
seekhandle.close unless self.count < self.size
|
74
74
|
end
|
75
75
|
|
76
76
|
return readbuffer
|
data/lib/sisimai/mta/exim.rb
CHANGED
@@ -63,6 +63,7 @@ module Sisimai
|
|
63
63
|
|The[ ].+[ ]router[ ]encountered[ ]the[ ]following[ ]error[(]s[)]:
|
64
64
|
)
|
65
65
|
}x,
|
66
|
+
:deliverystatus => %r|\AContent-type: message/delivery-status|,
|
66
67
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
67
68
|
}
|
68
69
|
|
@@ -165,6 +166,9 @@ module Sisimai
|
|
165
166
|
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
166
167
|
localhost0 = '' # (String) Local MTA
|
167
168
|
boundary00 = '' # (String) Boundary string
|
169
|
+
havepassed = {
|
170
|
+
:deliverystatus => 0
|
171
|
+
}
|
168
172
|
v = nil
|
169
173
|
|
170
174
|
if mhead['content-type']
|
@@ -280,8 +284,12 @@ module Sisimai
|
|
280
284
|
|
281
285
|
else
|
282
286
|
# Error message ?
|
283
|
-
|
284
|
-
|
287
|
+
if havepassed[:deliverystatus] == 0
|
288
|
+
# Content-type: message/delivery-status
|
289
|
+
havepassed[:deliverystatus] = 1 if e =~ Re1[:deliverystatus]
|
290
|
+
v['alterrors'] ||= ''
|
291
|
+
v['alterrors'] += e + ' ' if e =~ /\A[ ]+/
|
292
|
+
end
|
285
293
|
end
|
286
294
|
else
|
287
295
|
if dscontents.size == recipients
|
@@ -368,7 +376,7 @@ module Sisimai
|
|
368
376
|
e['diagnosis'] = dscontents[0]['diagnosis'] || ''
|
369
377
|
e['spec'] ||= dscontents[0]['spec']
|
370
378
|
|
371
|
-
if dscontents[0]['alterrors']
|
379
|
+
if dscontents[0]['alterrors'] && dscontents[0]['alterrors'].size > 0
|
372
380
|
# The value of "alterrors" is also copied
|
373
381
|
e['alterrors'] = dscontents[0]['alterrors']
|
374
382
|
end
|
@@ -377,7 +385,10 @@ module Sisimai
|
|
377
385
|
|
378
386
|
if e['alterrors'] && e['alterrors'].size > 0
|
379
387
|
# Copy alternative error message
|
380
|
-
e['diagnosis']
|
388
|
+
if e['diagnosis'].nil? || e['diagnosis'].empty?
|
389
|
+
e['diagnosis'] ||= e['alterrors']
|
390
|
+
end
|
391
|
+
|
381
392
|
if e['diagnosis'] =~ /\A[-]+/ || e['diagnosis'] =~ /__\z/
|
382
393
|
# Override the value of diagnostic code message
|
383
394
|
e['diagnosis'] = e['alterrors'] if e['alterrors'].size > 0
|
@@ -56,6 +56,7 @@ module Sisimai
|
|
56
56
|
that[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts
|
57
57
|
|your[ ]remotehost[ ]looks[ ]suspiciously[ ]like[ ]spammer
|
58
58
|
)
|
59
|
+
|SPF[ ]record
|
59
60
|
|the[ ](?:email|domain|ip).+[ ]is[ ]blacklisted
|
60
61
|
|unresolvable[ ]relay[ ]host[ ]name
|
61
62
|
|your[ ](?:
|
data/lib/sisimai/version.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
From MAILER-DAEMON Tue Mar 02 09:44:33 1999
|
2
|
+
Received: from EXIMUSER by example.co.jp with local (Exim 4.00)
|
3
|
+
id FFFFFF-222222-00
|
4
|
+
for lmn@example.co.jp; Tue, 2 Mar 1999 09:44:33 +0000
|
5
|
+
X-Failed-Recipients: kijitora@example.co.jp
|
6
|
+
Auto-Submitted: auto-replied
|
7
|
+
From: Mail Delivery System <Mailer-Daemon@example.co.jp>
|
8
|
+
To: lmn@example.co.jp
|
9
|
+
Content-Type: multipart/report; report-type=delivery-status; boundary=NNNNNNNNNN-eximdsn-MMMMMMMMMM
|
10
|
+
MIME-Version: 1.0
|
11
|
+
Subject: Mail delivery failed
|
12
|
+
Message-Id: <EFFFFFF-222222-00@example.co.jp>
|
13
|
+
Date: Tue, 2 Mar 1999 09:44:33 +0000
|
14
|
+
|
15
|
+
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
|
16
|
+
Content-type: text/plain; charset=us-ascii
|
17
|
+
|
18
|
+
This message was created automatically by mail delivery software.
|
19
|
+
|
20
|
+
A message sent by
|
21
|
+
|
22
|
+
<shironeko@example.org>
|
23
|
+
|
24
|
+
could not be delivered to one or more of its recipients. The following
|
25
|
+
address(es) failed:
|
26
|
+
|
27
|
+
kijitora@example.co.jp
|
28
|
+
host 192.0.2.22 [192.0.2.22]
|
29
|
+
SMTP error from remote mail server after MAIL FROM:<shironeko@example.org>:
|
30
|
+
550 Bad SPF records for [example.org:192.0.2.2], see http://spf.pobox.com/
|
31
|
+
|
32
|
+
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
|
33
|
+
Content-type: message/delivery-status
|
34
|
+
|
35
|
+
Reporting-MTA: dns; example.co.jp
|
36
|
+
|
37
|
+
Action: failed
|
38
|
+
Final-Recipient: rfc822;kijitora@example.co.jp
|
39
|
+
Status: 5.0.0
|
40
|
+
Remote-MTA: dns; 192.0.2.22
|
41
|
+
Diagnostic-Code: smtp; 550 Bad SPF records for
|
42
|
+
[example.org:192.0.2.2], see http://spf.pobox.com/
|
43
|
+
|
44
|
+
--NNNNNNNNNN-eximdsn-MMMMMMMMMM
|
45
|
+
Content-type: message/rfc822
|
46
|
+
|
47
|
+
Return-path: <shironeko@example.org>
|
48
|
+
Received: from CALLER by example.co.jp with local (Exim 4.00)
|
49
|
+
(envelope-from <shironeko@example.org>)
|
50
|
+
id EEEEEE-222222-00; Tue, 2 Mar 1999 09:44:33 +0000
|
51
|
+
Message-Id: <EEEEEEE-222222-00@example.co.jp>
|
52
|
+
From: shironeko@example.org
|
53
|
+
Date: Tue, 2 Mar 1999 09:44:33 +0000
|
54
|
+
|
55
|
+
Nyaaan
|
56
|
+
|
57
|
+
--NNNNNNNNNN-eximdsn-MMMMMMMMMM--
|
58
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sisimai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.17.
|
4
|
+
version: 4.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azumakuniyuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -268,6 +268,7 @@ files:
|
|
268
268
|
- set-of-emails/maildir/bsd/exim-26.eml
|
269
269
|
- set-of-emails/maildir/bsd/exim-27.eml
|
270
270
|
- set-of-emails/maildir/bsd/exim-28.eml
|
271
|
+
- set-of-emails/maildir/bsd/exim-29.eml
|
271
272
|
- set-of-emails/maildir/bsd/google-apps-01.eml
|
272
273
|
- set-of-emails/maildir/bsd/imailserver-01.eml
|
273
274
|
- set-of-emails/maildir/bsd/imailserver-02.eml
|
@@ -687,9 +688,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
687
688
|
version: '0'
|
688
689
|
requirements: []
|
689
690
|
rubyforge_project:
|
690
|
-
rubygems_version: 2.
|
691
|
+
rubygems_version: 2.6.2
|
691
692
|
signing_key:
|
692
693
|
specification_version: 4
|
693
694
|
summary: Mail Analyzing Interface
|
694
695
|
test_files: []
|
695
|
-
has_rdoc:
|