sisimai 4.20.1 → 4.20.2

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -2
  3. data/Changes +11 -1
  4. data/README-JA.md +135 -202
  5. data/README.md +128 -192
  6. data/fig/sisimai-architecture.png +0 -0
  7. data/lib/sisimai.rb +5 -3
  8. data/lib/sisimai/arf.rb +2 -2
  9. data/lib/sisimai/ced/us/amazonses.rb +5 -5
  10. data/lib/sisimai/ced/us/sendgrid.rb +4 -4
  11. data/lib/sisimai/data.rb +1 -8
  12. data/lib/sisimai/data/json.rb +1 -1
  13. data/lib/sisimai/datetime.rb +1 -1
  14. data/lib/sisimai/mail/maildir.rb +3 -3
  15. data/lib/sisimai/mda.rb +2 -2
  16. data/lib/sisimai/message.rb +7 -3
  17. data/lib/sisimai/message/email.rb +8 -2
  18. data/lib/sisimai/mime.rb +2 -2
  19. data/lib/sisimai/msp/de/einsundeins.rb +2 -2
  20. data/lib/sisimai/msp/de/gmx.rb +2 -2
  21. data/lib/sisimai/msp/jp/biglobe.rb +2 -2
  22. data/lib/sisimai/msp/jp/ezweb.rb +2 -2
  23. data/lib/sisimai/msp/jp/kddi.rb +3 -3
  24. data/lib/sisimai/msp/ru/mailru.rb +3 -3
  25. data/lib/sisimai/msp/ru/yandex.rb +2 -2
  26. data/lib/sisimai/msp/uk/messagelabs.rb +2 -2
  27. data/lib/sisimai/msp/us/amazonses.rb +4 -5
  28. data/lib/sisimai/msp/us/amazonworkmail.rb +2 -2
  29. data/lib/sisimai/msp/us/aol.rb +2 -2
  30. data/lib/sisimai/msp/us/bigfoot.rb +3 -3
  31. data/lib/sisimai/msp/us/facebook.rb +2 -2
  32. data/lib/sisimai/msp/us/google.rb +2 -2
  33. data/lib/sisimai/msp/us/office365.rb +2 -3
  34. data/lib/sisimai/msp/us/outlook.rb +2 -2
  35. data/lib/sisimai/msp/us/receivingses.rb +2 -2
  36. data/lib/sisimai/msp/us/sendgrid.rb +2 -2
  37. data/lib/sisimai/msp/us/verizon.rb +3 -3
  38. data/lib/sisimai/msp/us/yahoo.rb +2 -2
  39. data/lib/sisimai/msp/us/zoho.rb +2 -2
  40. data/lib/sisimai/mta/activehunter.rb +2 -2
  41. data/lib/sisimai/mta/apachejames.rb +3 -3
  42. data/lib/sisimai/mta/courier.rb +3 -3
  43. data/lib/sisimai/mta/domino.rb +2 -2
  44. data/lib/sisimai/mta/exchange2003.rb +4 -4
  45. data/lib/sisimai/mta/exchange2007.rb +2 -2
  46. data/lib/sisimai/mta/exim.rb +8 -4
  47. data/lib/sisimai/mta/imailserver.rb +3 -3
  48. data/lib/sisimai/mta/interscanmss.rb +3 -3
  49. data/lib/sisimai/mta/mailfoundry.rb +2 -2
  50. data/lib/sisimai/mta/mailmarshalsmtp.rb +2 -2
  51. data/lib/sisimai/mta/mcafee.rb +2 -2
  52. data/lib/sisimai/mta/messagingserver.rb +3 -3
  53. data/lib/sisimai/mta/mfilter.rb +2 -2
  54. data/lib/sisimai/mta/mxlogic.rb +3 -3
  55. data/lib/sisimai/mta/notes.rb +3 -3
  56. data/lib/sisimai/mta/opensmtpd.rb +2 -2
  57. data/lib/sisimai/mta/postfix.rb +3 -3
  58. data/lib/sisimai/mta/qmail.rb +3 -3
  59. data/lib/sisimai/mta/sendmail.rb +2 -2
  60. data/lib/sisimai/mta/surfcontrol.rb +2 -2
  61. data/lib/sisimai/mta/userdefined.rb +3 -3
  62. data/lib/sisimai/mta/v5sendmail.rb +3 -3
  63. data/lib/sisimai/mta/x1.rb +2 -2
  64. data/lib/sisimai/mta/x2.rb +2 -2
  65. data/lib/sisimai/mta/x3.rb +2 -2
  66. data/lib/sisimai/mta/x4.rb +3 -3
  67. data/lib/sisimai/mta/x5.rb +3 -3
  68. data/lib/sisimai/reason/rejected.rb +1 -0
  69. data/lib/sisimai/reason/securityerror.rb +7 -2
  70. data/lib/sisimai/reason/toomanyconn.rb +4 -0
  71. data/lib/sisimai/rfc3464.rb +3 -3
  72. data/lib/sisimai/rfc3834.rb +2 -2
  73. data/lib/sisimai/rfc5322.rb +4 -4
  74. data/lib/sisimai/rhost.rb +0 -1
  75. data/lib/sisimai/rhost/exchangeonline.rb +2 -2
  76. data/lib/sisimai/smtp.rb +4 -4
  77. data/lib/sisimai/smtp/error.rb +7 -12
  78. data/lib/sisimai/smtp/reply.rb +1 -1
  79. data/lib/sisimai/string.rb +7 -7
  80. data/lib/sisimai/version.rb +1 -1
  81. data/set-of-emails/maildir/bsd/rfc3834-06.eml +56 -0
  82. metadata +5 -3
@@ -42,6 +42,7 @@ module Sisimai
42
42
  |error:[ ]no[ ]third-party[ ]dsns # SpamWall - block empty sender
43
43
  |fully[ ]qualified[ ]email[ ]address[ ]required # McAfee
44
44
  |invalid[ ]domain,[ ]see[ ][<]url:.+[>]
45
+ |Message[ ]rejected:[ ]Email[ ]address[ ]is[ ]not[ ]verified
45
46
  |mx[ ]records[ ]for[ ].+[ ]violate[ ]section[ ].+
46
47
  |name[ ]service[ ]error[ ]for[ ] # Malformed MX RR or host not found
47
48
  |Null[ ]Sender[ ]is[ ]not[ ]allowed
@@ -27,8 +27,12 @@ module Sisimai
27
27
  def match(argv1)
28
28
  return nil unless argv1
29
29
  regex = %r{(?>
30
- authentication[ ](?:
31
- failed;[ ]server[ ].+[ ]said: # Postfix
30
+ Account[ ]not[ ]subscribed[ ]to[ ]SES
31
+ |authentication[ ](?:
32
+ Credentials Invalid
33
+ |failure
34
+ |failed;[ ]server[ ].+[ ]said: # Postfix
35
+ |required
32
36
  |turned[ ]on[ ]in[ ]your[ ]email[ ]client
33
37
  )
34
38
  |\d+[ ]denied[ ]\[[a-z]+\][ ].+[(]Mode:[ ].+[)]
@@ -49,6 +53,7 @@ module Sisimai
49
53
  |sorry,[ ]you[ ]don'?t[ ]authenticate[ ]or[ ]the[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts
50
54
  |the[ ]message[ ]was[ ]rejected[ ]because[ ]it[ ]contains[ ]prohibited[ ]virus[ ]or[ ]spam[ ]content
51
55
  |TLS[ ]required[ ]but[ ]not[ ]supported # SendGrid
56
+ |User[ ].+[ ]is[ ]not[ ]authorized[ ]to[ ]perform[ ]ses:SendRawEmail[ ]on[ ]resource
52
57
  |you[ ]are[ ]not[ ]authorized[ ]to[ ]send[ ]mail,[ ]authentication[ ]is[ ]required
53
58
  |You[ ]have[ ]exceeded[ ]the[ ]the[ ]allowable[ ]number[ ]of[ ]posts[ ]without[ ]solving[ ]a[ ]captcha
54
59
  |verification[ ]failure
@@ -27,6 +27,10 @@ module Sisimai
27
27
  All[ ]available[ ]IPs[ ]are[ ]at[ ]maximum[ ]connection[ ]limit # SendGrid
28
28
  |connection[ ]rate[ ]limit[ ]exceeded
29
29
  |no[ ]IPs[ ]available[ ][-][ ].+[ ]exceeds[ ]per[-]domain[ ]connection[ ]limit[ ]for
30
+ |Throttling[ ]failure:[ ](?:
31
+ Daily[ ]message[ ]quota[ ]exceeded
32
+ |Maximum[ ]sending[ ]rate[ ]exceeded
33
+ )
30
34
  |Too[ ]many[ ](?:
31
35
  connections
32
36
  |connections[ ]from[ ]your[ ]host[.] # Microsoft
@@ -62,7 +62,7 @@ module Sisimai
62
62
  def scan(mhead, mbody)
63
63
  return nil unless mhead
64
64
  return nil unless mbody
65
- return nil if mhead.keys.size == 0
65
+ return nil if mhead.keys.size.zero?
66
66
  return nil if mbody.empty?
67
67
 
68
68
  require 'sisimai/mda'
@@ -88,7 +88,7 @@ module Sisimai
88
88
  havepassed << e
89
89
  p = havepassed[-2]
90
90
 
91
- if readcursor == 0
91
+ if readcursor.zero?
92
92
  # Beginning of the bounce message or delivery status part
93
93
  if e =~ Re1[:begin]
94
94
  readcursor |= Indicators[:deliverystatus]
@@ -395,7 +395,7 @@ module Sisimai
395
395
  break if e =~ Re1[:rfc822]
396
396
  break if e =~ re_stop
397
397
 
398
- next if e.size == 0
398
+ next if e.size.zero?
399
399
  next if e =~ re_skip
400
400
  next if e =~ /\A[*]/
401
401
 
@@ -52,8 +52,8 @@ module Sisimai
52
52
  def scan(mhead, mbody)
53
53
  return nil unless mhead
54
54
  return nil unless mbody
55
- return nil if mhead.keys.size == 0
56
- return nil if mbody.size == 0
55
+ return nil if mhead.keys.size.zero?
56
+ return nil if mbody.size.zero?
57
57
 
58
58
  leave = 0
59
59
  match = 0
@@ -112,7 +112,7 @@ module Sisimai
112
112
  |\A(?:mailer-daemon|postmaster)\z
113
113
  |[ ]?mailer-daemon[ ]
114
114
  )
115
- /xi;
115
+ /xi
116
116
  return true if email =~ re
117
117
  return false
118
118
  end
@@ -175,7 +175,7 @@ module Sisimai
175
175
  break
176
176
  end
177
177
 
178
- if hostname.length == 0
178
+ if hostname.length.zero?
179
179
  # 2. Use IP address as a remote host name
180
180
  addrlist.each do |e|
181
181
  # Skip if the address is a private address
@@ -216,10 +216,10 @@ module Sisimai
216
216
  lhs = cv[1].downcase
217
217
  previousfn = ''
218
218
  next unless HeaderIndex.key?(lhs)
219
-
219
+
220
220
  previousfn = lhs
221
221
  rfc822part += e + "\n"
222
-
222
+
223
223
  elsif e =~ /\A[ \t]+/
224
224
  # Continued line from the previous line
225
225
  next if rfc822next[previousfn]
data/lib/sisimai/rhost.rb CHANGED
@@ -47,7 +47,6 @@ module Sisimai
47
47
 
48
48
  remotehost = argvs.rhost.downcase
49
49
  rhostclass = ''
50
- reasontext = ''
51
50
  modulename = ''
52
51
 
53
52
  RhostClass.each_key do |e|
@@ -29,8 +29,8 @@ module Sisimai
29
29
  ],
30
30
  %r/\A4[.]4[.]2\z/ => [
31
31
  {
32
- :reason => 'blocked',
33
- :regexp => %r/Connection dropped/,
32
+ :reason => 'blocked',
33
+ :regexp => %r/Connection dropped/,
34
34
  },
35
35
  ],
36
36
  %r/\A4[.]7[.]26\z/ => [
data/lib/sisimai/smtp.rb CHANGED
@@ -9,10 +9,10 @@ module Sisimai
9
9
  # @return [Hash] SMTP command regular expressions
10
10
  def command
11
11
  return {
12
- :helo => %r/\b(?:HELO|EHLO)\b/,
13
- :mail => %r/\bMAIL F(?:ROM|rom)\b/,
14
- :rcpt => %r/\bRCPT T[Oo]\b/,
15
- :data => %r/\bDATA\b/,
12
+ :helo => %r/\b(?:HELO|EHLO)\b/,
13
+ :mail => %r/\bMAIL F(?:ROM|rom)\b/,
14
+ :rcpt => %r/\bRCPT T[Oo]\b/,
15
+ :data => %r/\bDATA\b/,
16
16
  }
17
17
  end
18
18
 
@@ -9,13 +9,13 @@ module Sisimai
9
9
  require 'sisimai/smtp/status'
10
10
 
11
11
  SoftOrHard = {
12
- :soft => [
13
- 'blocked', 'contenterror', 'exceedlimit', 'expired', 'filtered',
14
- 'mailboxfull', 'mailererror', 'mesgtoobig', 'networkerror', 'norelaying',
15
- 'rejected', 'securityerror', 'spamdetected', 'suspend', 'syntaxerror',
16
- 'systemerror', 'systemfull', 'toomanyconn',
17
- ],
18
- :hard => ['hasmoved', 'hostunknown', 'userunknown']
12
+ :soft => %w|
13
+ blocked contenterror exceedlimit expired filtered mailboxfull
14
+ mailererror mesgtoobig networkerror norelaying rejected suspend
15
+ securityerror spamdetected syntaxerror systemerror systemfull
16
+ toomanyconn
17
+ |,
18
+ :hard => %w|hasmoved hostunknown userunknown|
19
19
  }
20
20
 
21
21
  # Permanent error or not
@@ -28,10 +28,7 @@ module Sisimai
28
28
  return nil unless argv1
29
29
  return nil unless argv1.size > 0
30
30
 
31
- statuscode = nil
32
- classvalue = nil
33
31
  getchecked = nil
34
-
35
32
  statuscode = Sisimai::SMTP::Status.find(argv1)
36
33
  statuscode = Sisimai::SMTP::Reply.find(argv1) if statuscode.empty?
37
34
  classvalue = statuscode[0, 1].to_i
@@ -81,8 +78,6 @@ module Sisimai
81
78
  return '' if argv1.empty?
82
79
 
83
80
  getchecked = nil
84
- statuscode = nil
85
- classvalue = nil
86
81
  softorhard = nil
87
82
 
88
83
  if argv1 =~ /\A(?:delivered|feedback|vacation)\z/
@@ -75,7 +75,7 @@ module Sisimai
75
75
  (?:\d|[01]?\d\d|2[0-4]\d|25[0-5])[.]
76
76
  (?:\d|[01]?\d\d|2[0-4]\d|25[0-5])[.]
77
77
  (?:\d|[01]?\d\d|2[0-4]\d|25[0-5])
78
- \b}x;
78
+ \b}x
79
79
 
80
80
  if argv1 =~ ip4re
81
81
  # Convert found IPv4 addresses to '***.***.***.***' to avoid that
@@ -81,13 +81,13 @@ module Sisimai
81
81
  plain = plain.gsub(%r|<a\s+href\s*=\s*['"](https?://.+?)['"].*?>(.*?)</a>|i, '[\2](\1)')
82
82
  plain = plain.gsub(%r|<a\s+href\s*=\s*["']mailto:([^\s]+?)["']>(.*?)</a>|i, '[\2](mailto:\1)')
83
83
 
84
- plain = plain.gsub(/<[^<@>]+?>\s*/,' ') # Delete HTML tags except <neko@example.jp>
85
- plain = plain.gsub(/&lt;/, '<') # Convert to left angle brackets
86
- plain = plain.gsub(/&gt;/, '>') # Convert to right angle brackets
87
- plain = plain.gsub(/&amp;/, '&') # Convert to "&"
88
- plain = plain.gsub(/&quot;/, '"') # Convert to '"'
89
- plain = plain.gsub(/&apos;/, "'") # Convert to "'"
90
- plain = plain.gsub(/&nbsp;/, ' ') # Convert to ' '
84
+ plain = plain.gsub(/<[^<@>]+?>\s*/, ' ') # Delete HTML tags except <neko@example.jp>
85
+ plain = plain.gsub(/&lt;/, '<') # Convert to left angle brackets
86
+ plain = plain.gsub(/&gt;/, '>') # Convert to right angle brackets
87
+ plain = plain.gsub(/&amp;/, '&') # Convert to "&"
88
+ plain = plain.gsub(/&quot;/, '"') # Convert to '"'
89
+ plain = plain.gsub(/&apos;/, "'") # Convert to "'"
90
+ plain = plain.gsub(/&nbsp;/, ' ') # Convert to ' '
91
91
 
92
92
  if argv1.size > plain.size
93
93
  plain = plain.squeeze(' ')
@@ -1,4 +1,4 @@
1
1
  # Define the version number of Sisimai
2
2
  module Sisimai
3
- VERSION = '4.20.1'
3
+ VERSION = '4.20.2'.freeze
4
4
  end
@@ -0,0 +1,56 @@
1
+ Return-Path: <>
2
+ Received: from mta.example.org ([192.0.2.1])
3
+ by inbound-smtp.us-east-1.amazonaws.com with SMTP id pseudo-smtp-session-id-string
4
+ for bounces+example.org@example.net.br;
5
+ Fri, 10 Feb 2017 19:14:33 +0000 (UTC)
6
+ X-SES-Spam-Verdict: PASS
7
+ X-SES-Virus-Verdict: PASS
8
+ Received-SPF: none (spfCheck: [192.0.2.22] is neither permitted nor denied by domain of example.org) client-ip=[192.0.2.12]; envelope-from=postmaster@example.com.br; helo=example.com.br;
9
+ Authentication-Results: amazonses.com;
10
+ spf=none (spfCheck: [192.0.2.12] is neither permitted nor denied by domain of example.com.br) client-ip=[192.0.2.221]; envelope-from=postmaster@example.com.br; helo=example.com.br;
11
+ X-SES-RECEIPT:
12
+ X-SES-DKIM-SIGNATURE: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
13
+ s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1486754116;
14
+ h=X-SES-RECEIPT:Date:From:To:Message-ID:Subject:MIME-Version:Content-Type;
15
+ bh=0bYTWVAQOGTZY45Q929yxHVJoEggqClgGJJtcyDttRA=;
16
+ b=RFkTDfEJ8ugYYu823Qu40RfHxykHFb9xOjWWyQhMvRmtPrRPbgIvt/ozSO7i7A2y
17
+ /RK+3BLlbCeca8Onv7U7FZouOfe34TViXGTlv9KthLHndvFtv8XgbwmYfdlUSPyNJB6
18
+ bpU1A2ppoitWThG89fUd+1akanBfw0/deRA0I7T8=
19
+ Received: from localhost (localhost [127.0.0.1])
20
+ by example.com.br (Postfix) with ESMTP id 2D4F15228F6
21
+ for <bounces+example.org@example.net.br>; Fri, 10 Feb 2017 17:15:17 -0200 (BRST)
22
+ Received: from example.com.br ([127.0.0.1])
23
+ by localhost (example.com.br [127.0.0.1]) (amavisd-new, port 10032)
24
+ with ESMTP id R3_QsTphIcaa
25
+ for <bounces+example@example.net.br>;
26
+ Fri, 10 Feb 2017 17:15:17 -0200 (BRST)
27
+ Received: from localhost (localhost [127.0.0.1])
28
+ by example.com.br (Postfix) with ESMTP id 05A90522911
29
+ for <bounces+example@example.net.br>; Fri, 10 Feb 2017 17:15:17 -0200 (BRST)
30
+ X-Virus-Scanned: amavisd-new at example.com.br
31
+ Received: from example.com.br ([127.0.0.1])
32
+ by localhost (example.com.br [127.0.0.1]) (amavisd-new, port 10026)
33
+ with ESMTP id CsEmah0fuPMu
34
+ for <bounces+example@example.net.br>;
35
+ Fri, 10 Feb 2017 17:15:16 -0200 (BRST)
36
+ Received: from example.com.br (example.com.br [10.0.0.56])
37
+ by example.com.br (Postfix) with ESMTP id D473C5228F6
38
+ for <bounces+example.org@example.net.br>; Fri, 10 Feb 2017 17:15:16 -0200 (BRST)
39
+ Date: Fri, 10 Feb 2017 17:15:16 -0200 (BRST)
40
+ From: Kijitora <kijitora@example.org>
41
+ To:
42
+ bounces+example.org@example.net.br
43
+ Message-ID: <1257668210.10263839.1486754116408.JavaMail.zimbra@example.com.br>
44
+ In-Reply-To: <20170210191426.1wKDapP798yQEJKMGjlLVAmNMYzWOBbq@example.net.br>
45
+ Subject: =?utf-8?Q?Re:_EXAMPLE?=
46
+ MIME-Version: 1.0
47
+ Content-Type: text/plain; charset=utf-8
48
+ Content-Transfer-Encoding: quoted-printable
49
+ Auto-Submitted: auto-replied (zimbra; vacation)
50
+ Precedence: bulk
51
+ X-Mailer: Zimbra 8.6.0_GA_1153
52
+ Thread-Topic:
53
+ Thread-Index:
54
+
55
+ Estarei ausente do dia 08/02 at=C3=A9 o dia 12/03
56
+ favor encaminhar email para kijitora e example.org
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.20.1
4
+ version: 4.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - azumakuniyuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-31 00:00:00.000000000 Z
11
+ date: 2017-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,6 +97,7 @@ files:
97
97
  - appveyor.yml
98
98
  - bin/console
99
99
  - bin/setup
100
+ - fig/sisimai-architecture.png
100
101
  - lib/sisimai.rb
101
102
  - lib/sisimai/address.rb
102
103
  - lib/sisimai/arf.rb
@@ -576,6 +577,7 @@ files:
576
577
  - set-of-emails/maildir/bsd/rfc3834-03.eml
577
578
  - set-of-emails/maildir/bsd/rfc3834-04.eml
578
579
  - set-of-emails/maildir/bsd/rfc3834-05.eml
580
+ - set-of-emails/maildir/bsd/rfc3834-06.eml
579
581
  - set-of-emails/maildir/bsd/rhost-exchange-online-01.eml
580
582
  - set-of-emails/maildir/bsd/rhost-google-apps-01.eml
581
583
  - set-of-emails/maildir/dos/arf-01.eml
@@ -757,7 +759,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
757
759
  version: '0'
758
760
  requirements: []
759
761
  rubyforge_project:
760
- rubygems_version: 2.6.2
762
+ rubygems_version: 2.6.8
761
763
  signing_key:
762
764
  specification_version: 4
763
765
  summary: Mail Analyzing Interface