sisimai 4.25.6 → 4.25.11
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 +4 -3
- data/ANALYTICAL-PRECISION +1 -1
- data/Benchmarks.mk +1 -1
- data/ChangeLog.md +71 -2
- data/Developers.mk +2 -2
- data/Makefile +1 -1
- data/README-JA.md +16 -16
- data/README.md +16 -16
- data/Repository.mk +1 -1
- data/lib/sisimai.rb +3 -3
- data/lib/sisimai/address.rb +6 -3
- data/lib/sisimai/arf.rb +25 -21
- data/lib/sisimai/data.rb +8 -29
- data/lib/sisimai/datetime.rb +18 -17
- data/lib/sisimai/lhost/amazonses.rb +1 -1
- data/lib/sisimai/lhost/domino.rb +29 -4
- data/lib/sisimai/lhost/einsundeins.rb +1 -1
- data/lib/sisimai/lhost/exchange2007.rb +1 -1
- data/lib/sisimai/lhost/exim.rb +12 -8
- data/lib/sisimai/lhost/ezweb.rb +1 -1
- data/lib/sisimai/lhost/fml.rb +0 -2
- data/lib/sisimai/lhost/gsuite.rb +5 -0
- data/lib/sisimai/lhost/imailserver.rb +1 -1
- data/lib/sisimai/lhost/mailfoundry.rb +3 -4
- data/lib/sisimai/lhost/mailmarshalsmtp.rb +2 -2
- data/lib/sisimai/lhost/mxlogic.rb +1 -1
- data/lib/sisimai/lhost/notes.rb +1 -1
- data/lib/sisimai/lhost/office365.rb +1 -1
- data/lib/sisimai/lhost/postfix.rb +3 -10
- data/lib/sisimai/lhost/qmail.rb +7 -7
- data/lib/sisimai/lhost/sendgrid.rb +2 -2
- data/lib/sisimai/lhost/sendmail.rb +1 -1
- data/lib/sisimai/lhost/verizon.rb +4 -4
- data/lib/sisimai/lhost/x3.rb +4 -0
- data/lib/sisimai/lhost/x4.rb +8 -8
- data/lib/sisimai/lhost/x5.rb +7 -3
- data/lib/sisimai/mail.rb +2 -21
- data/lib/sisimai/mda.rb +2 -2
- data/lib/sisimai/message.rb +47 -83
- data/lib/sisimai/reason/blocked.rb +40 -26
- data/lib/sisimai/reason/exceedlimit.rb +4 -1
- data/lib/sisimai/reason/expired.rb +2 -0
- data/lib/sisimai/reason/filtered.rb +1 -0
- data/lib/sisimai/reason/hostunknown.rb +3 -0
- data/lib/sisimai/reason/mailererror.rb +1 -1
- data/lib/sisimai/reason/norelaying.rb +5 -0
- data/lib/sisimai/reason/notaccept.rb +2 -0
- data/lib/sisimai/reason/policyviolation.rb +4 -0
- data/lib/sisimai/reason/rejected.rb +5 -1
- data/lib/sisimai/reason/securityerror.rb +5 -6
- data/lib/sisimai/reason/spamdetected.rb +17 -15
- data/lib/sisimai/reason/suspend.rb +1 -0
- data/lib/sisimai/reason/systemerror.rb +2 -0
- data/lib/sisimai/reason/userunknown.rb +25 -21
- data/lib/sisimai/rfc1894.rb +24 -22
- data/lib/sisimai/rfc3464.rb +4 -5
- data/lib/sisimai/rfc3834.rb +1 -1
- data/lib/sisimai/rfc5322.rb +8 -4
- data/lib/sisimai/rhost.rb +6 -8
- data/lib/sisimai/rhost/cox.rb +112 -0
- data/lib/sisimai/rhost/exchangeonline.rb +8 -1
- data/lib/sisimai/rhost/googleapps.rb +4 -1
- data/lib/sisimai/rhost/spectrum.rb +73 -0
- data/lib/sisimai/smtp/error.rb +8 -6
- data/lib/sisimai/smtp/reply.rb +1 -1
- data/lib/sisimai/smtp/status.rb +1 -1
- data/lib/sisimai/time.rb +1 -2
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/README.md +5 -4
- data/set-of-emails/maildir/bsd/arf-25.eml +61 -0
- data/set-of-emails/maildir/bsd/lhost-aol-04.eml +23 -23
- data/set-of-emails/maildir/bsd/lhost-domino-02.eml +1 -2
- data/set-of-emails/maildir/bsd/lhost-exim-61.eml +40 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-38.eml +1 -1
- data/set-of-emails/maildir/bsd/lhost-postfix-66.eml +80 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-67.eml +80 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-68.eml +82 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-69.eml +80 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-70.eml +87 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-71.eml +81 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-72.eml +81 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-73.eml +79 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-74.eml +83 -0
- data/set-of-emails/maildir/bsd/lhost-sendmail-08.eml +1 -1
- data/set-of-emails/maildir/bsd/lhost-sendmail-11.eml +1 -1
- data/set-of-emails/maildir/bsd/lhost-sendmail-57.eml +59 -0
- data/set-of-emails/maildir/bsd/lhost-sendmail-58.eml +70 -0
- data/set-of-emails/maildir/bsd/lhost-sendmail-59.eml +68 -0
- data/set-of-emails/maildir/bsd/lhost-x3-06.eml +53 -0
- data/set-of-emails/maildir/bsd/rhost-cox-01.eml +192 -0
- data/set-of-emails/maildir/bsd/{rhost-exchange-online-01.eml → rhost-exchangeonline-01.eml} +0 -0
- data/set-of-emails/maildir/bsd/{rhost-exchange-online-02.eml → rhost-exchangeonline-02.eml} +0 -0
- data/set-of-emails/maildir/bsd/{rhost-exchange-online-03.eml → rhost-exchangeonline-03.eml} +0 -0
- data/set-of-emails/maildir/bsd/{rhost-google-apps-01.eml → rhost-googleapps-01.eml} +0 -0
- data/set-of-emails/maildir/bsd/{rhost-google-apps-02.eml → rhost-googleapps-02.eml} +0 -0
- data/set-of-emails/maildir/bsd/rhost-spectrum-01.eml +111 -0
- data/set-of-emails/maildir/dos/{rhost-exchange-online-01.eml → rhost-exchangeonline-01.eml} +0 -0
- data/set-of-emails/maildir/dos/{rhost-google-apps-01.eml → rhost-googleapps-01.eml} +0 -0
- data/set-of-emails/maildir/mac/{rhost-exchange-online-01.eml → rhost-exchangeonline-01.eml} +0 -0
- data/set-of-emails/maildir/mac/{rhost-google-apps-01.eml → rhost-googleapps-01.eml} +0 -0
- data/sisimai-java.gemspec +4 -4
- data/sisimai.gemspec +4 -4
- metadata +39 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b96e6f5eb8587091c2902d4bdf83d63fd5d36606d80120428b509afeae37ab4b
|
4
|
+
data.tar.gz: 074ee81152220a51456a3a4d2236075715b1aa7045ddcace81aa0fd406676f4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3dbf3a7f80e30ef008b925c3f2105d005663a61e94bff2e361f9c9bf5bd80991cc9ca2e7ab522c657012ebe42a7f717de9d96a241c5b5b4e3d16921f8d6ac77
|
7
|
+
data.tar.gz: 8903044d48d468b905758a0b7c4abd8851d5609bbefb7f46c4f09379529f06751d6f0bec5214a50f782c7ea5902f2df33ea663a8806418584ff900cc13b5e019
|
data/.travis.yml
CHANGED
@@ -2,11 +2,12 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
# See http://rubies.travis-ci.org for Precompiled Ruby Versions
|
4
4
|
- 2.1.1
|
5
|
-
- 2.2.
|
5
|
+
- 2.2.10
|
6
6
|
# - 2.3.0
|
7
|
-
|
7
|
+
- 2.4.9
|
8
8
|
# - 2.5.0
|
9
|
-
- 2.6.
|
9
|
+
- 2.6.6
|
10
|
+
- 2.7.0
|
10
11
|
# - jruby-9.0.5.0
|
11
12
|
# - jruby-9.1.9.0
|
12
13
|
before_install:
|
data/ANALYTICAL-PRECISION
CHANGED
@@ -61,4 +61,4 @@ RFC3464 .......... 151/0322 0.4689 Fallback Module for MTAs
|
|
61
61
|
RFC3834 .......... 0/0014 0.0000 Detector for auto replied message
|
62
62
|
--------------------------------------------------------------------------------
|
63
63
|
bounceHammer 1523/2635 0.5779
|
64
|
-
Sisimai 4.25.
|
64
|
+
Sisimai 4.25.8 2635/2635 1.0000
|
data/Benchmarks.mk
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,8 +1,77 @@
|
|
1
1
|
RELEASE NOTES for Ruby version of Sisimai
|
2
2
|
================================================================================
|
3
|
-
- releases: "https://github.com/sisimai/rb-
|
3
|
+
- releases: "https://github.com/sisimai/rb-sisimai/releases"
|
4
4
|
- download: "https://rubygems.org/gems/sisimai"
|
5
5
|
|
6
|
+
v4.25.11
|
7
|
+
--------------------------------------------------------------------------------
|
8
|
+
- release: "Mon, 22 Feb 2021 21:15:22 +0900 (JST)"
|
9
|
+
- version: "4.25.11"
|
10
|
+
- changes:
|
11
|
+
- Fix typo in `Sisimai::RFC3464`
|
12
|
+
- Import some commits from Sisimai version 5 preview #
|
13
|
+
- Improved code for getting an email address in `Sisimai::Address`
|
14
|
+
- Improved code for checking the day of month value, for converting a full
|
15
|
+
month name and a full day of the week at `Sisimai::DateTime`
|
16
|
+
- Improvement code for picking text blocks of message/rfc822 part in RFC5322
|
17
|
+
- Add 60+ error message patterns
|
18
|
+
- Improved code for encodings in `Sisimai::Lhost::Domino`, `Sisimai::String`
|
19
|
+
|
20
|
+
v4.25.10
|
21
|
+
--------------------------------------------------------------------------------
|
22
|
+
- release: "Tue, 22 Dec 2020 13:22:22 +0900 (JST)"
|
23
|
+
- version: "4.25.10"
|
24
|
+
- changes:
|
25
|
+
- #187 Remove the following old methods (marked as obsolete from v4.25.6)
|
26
|
+
- `Sisimai::Mail.close` (automatically closes at the EOF)
|
27
|
+
- `Sisimai::Mail.type` (use `Sisimai::Mail.kind` instead)
|
28
|
+
- `Sisimai::Mail.mail.*` (use `Sisimai::Mail.data.*` instead)
|
29
|
+
- `Sisimai::Lhost::Exim` and `Sisimai::Lhost::X3` improvement
|
30
|
+
- #205 Code improvement for `Source-IP` field on `Sisimai::ARF`
|
31
|
+
- #207 Updates for DMARC and SPF related errors
|
32
|
+
- The value of `reason` rejected due to DMARC policy is `policyviolation`
|
33
|
+
- The value of `reason` rejected due to no SPF record is `rejected`
|
34
|
+
- Add some sample emails related to above into set-of-emails/
|
35
|
+
|
36
|
+
v4.25.9
|
37
|
+
--------------------------------------------------------------------------------
|
38
|
+
- release: "Sat, 3 Oct 2020 22:00:00 +0900 (JST)"
|
39
|
+
- version: ""
|
40
|
+
- changes:
|
41
|
+
- Suppress warning messages on Ruby 2.7. Thanks to @koic
|
42
|
+
- Suppress keyword argument warnings in Ruby 2.7 #200
|
43
|
+
- Suppress a Ruby warning for `Object#=~` and bug fix to match patterns #201
|
44
|
+
- #203 Replace `.+` with `[^ ]` on some large regular expressions for serious
|
45
|
+
performance reason.
|
46
|
+
- #204 Suport Null MX (RFC7505) on Sendmail sisimai/set-of-emails#4
|
47
|
+
|
48
|
+
v4.25.8
|
49
|
+
--------------------------------------------------------------------------------
|
50
|
+
- release: "Fri, 17 Jul 2020 11:59:49 +0900 (JST)"
|
51
|
+
- version: "4.25.8"
|
52
|
+
- changes:
|
53
|
+
- **Repository URL was changed to https://github.com/sisimai/rb-sisimai**
|
54
|
+
- `Sisimai::Message.make` method was merged into `Sisimai::Message.new`
|
55
|
+
- `Sisimai::Message.divideup` returns an array (faster than a hash)
|
56
|
+
- Remove unused code blocks for deciding the order of email header fields at
|
57
|
+
`Sisimai::Data.make` method
|
58
|
+
- Remove old parameters: `datasrc` and `bounces` at the callback feature #189
|
59
|
+
- Implement `Sisimai::Rhost::Spectrum` for parsing bounce mails returned from
|
60
|
+
https://www.spectrum.com/.
|
61
|
+
- Remove unsed method `Sisimai::Rhost->list`
|
62
|
+
- Fix bugs in `Sisimai::Lhost::FML` and `Sisimai::Lhost::X5`
|
63
|
+
- Fix code for finding the value of `Diagnostic-Code` field in multiple lines
|
64
|
+
at `Sisimai::RFC3464`
|
65
|
+
- Implement Sisimai::Rhost::Cox for parsing bounce mails returned from Cox:
|
66
|
+
https://cox.com/ #193
|
67
|
+
|
68
|
+
v4.25.7
|
69
|
+
--------------------------------------------------------------------------------
|
70
|
+
- release: "Sat, 25 Apr 2020 22:22:22 +0900 (JST)"
|
71
|
+
- version: "4.25.7"
|
72
|
+
- changes:
|
73
|
+
- Bug fix in `rake spec` for removed module `Sisimai::Lhost::UserDefined`
|
74
|
+
|
6
75
|
v4.25.6
|
7
76
|
--------------------------------------------------------------------------------
|
8
77
|
- release: "Wed, 22 Apr 2020 16:22:22 +0900 (JST)"
|
@@ -38,7 +107,7 @@ v4.25.6
|
|
38
107
|
- `Sisimai::MIME.patterns`
|
39
108
|
- `Sisimai::SMTP.command`
|
40
109
|
- `Sisimai::Lhost::Google` has been renamed to `Sisimai::Lhost::Gmail`
|
41
|
-
- Implement
|
110
|
+
- Implement 4 MTA modules: #178 #181
|
42
111
|
- `Sisimai::Lhost::Barracuda`
|
43
112
|
- `Sisimai::Lhost::PowerMTA`
|
44
113
|
- `Sisimai::Lhost::X6`
|
data/Developers.mk
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# rb-sisimai/Developers.mk
|
2
2
|
# ____ _ _
|
3
3
|
# | _ \ _____ _____| | ___ _ __ ___ _ __ ___ _ __ ___ | | __
|
4
4
|
# | | | |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __| | '_ ` _ \| |/ /
|
@@ -15,7 +15,7 @@ LS := ls -1
|
|
15
15
|
CP := cp
|
16
16
|
RM := rm -f
|
17
17
|
|
18
|
-
PERL5SISIMAI := p5-
|
18
|
+
PERL5SISIMAI := p5-sisimai
|
19
19
|
PRECISIONTAB := ANALYTICAL-PRECISION
|
20
20
|
PARSERLOGDIR := tmp/parser-logs
|
21
21
|
MAILCLASSDIR := lib/$(NAME)/Lhost
|
data/Makefile
CHANGED
data/README-JA.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
![](https://libsisimai.org/static/images/logo/sisimai-x01.png)
|
2
2
|
|
3
|
-
[![License](https://img.shields.io/badge/license-BSD%202--Clause-orange.svg)](https://github.com/sisimai/rb-
|
4
|
-
[![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-
|
5
|
-
[![Build Status](https://travis-ci.org/sisimai/rb-
|
6
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-
|
3
|
+
[![License](https://img.shields.io/badge/license-BSD%202--Clause-orange.svg)](https://github.com/sisimai/rb-sisimai/blob/master/LICENSE)
|
4
|
+
[![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-sisimai.svg)](https://coveralls.io/r/sisimai/rb-sisimai)
|
5
|
+
[![Build Status](https://travis-ci.org/sisimai/rb-sisimai.svg?branch=master)](https://travis-ci.org/sisimai/rb-sisimai)
|
6
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-sisimai)
|
7
7
|
[![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.6.0-red.svg)](https://www.ruby-lang.org/)
|
8
8
|
[![Gem Version](https://badge.fury.io/rb/sisimai.svg)](https://badge.fury.io/rb/sisimai)
|
9
9
|
|
@@ -39,7 +39,7 @@ What is Sisimai
|
|
39
39
|
===============================================================================
|
40
40
|
Sisimai(シシマイ)はRFC5322準拠のエラーメールを解析し、解析結果をデータ構造に
|
41
41
|
変換するインターフェイスを提供するRubyライブラリです。
|
42
|
-
[github.com/sisimai/p5-
|
42
|
+
[github.com/sisimai/p5-sisimai](https://github.com/sisimai/p5-sisimai/)
|
43
43
|
で公開しているPerl版シシマイから移植しました。
|
44
44
|
|
45
45
|
![](https://libsisimai.org/static/images/figure/sisimai-overview-1.png)
|
@@ -53,7 +53,7 @@ Key features
|
|
53
53
|
* git clone & make
|
54
54
|
* __高い解析精度__
|
55
55
|
* 解析精度はbounceHammerの2倍
|
56
|
-
*
|
56
|
+
* 68種類のMTA/MDA/ESPに対応
|
57
57
|
* Feedback Loopにも対応
|
58
58
|
* 29種類のエラー理由を検出
|
59
59
|
|
@@ -89,8 +89,8 @@ Done installing documentation for sisimai after 6 seconds
|
|
89
89
|
|
90
90
|
```shell
|
91
91
|
$ cd /usr/local/src
|
92
|
-
$ git clone https://github.com/sisimai/rb-
|
93
|
-
$ cd ./rb-
|
92
|
+
$ git clone https://github.com/sisimai/rb-sisimai.git
|
93
|
+
$ cd ./rb-sisimai
|
94
94
|
$ sudo make depend install-from-local
|
95
95
|
gem install bundle rake rspec coveralls
|
96
96
|
...
|
@@ -208,7 +208,7 @@ Sisimai Specification
|
|
208
208
|
|
209
209
|
Differences between Ruby version and Perl version
|
210
210
|
-------------------------------------------------------------------------------
|
211
|
-
公開中のPerl版Sisimai(p5-
|
211
|
+
公開中のPerl版Sisimai(p5-sisimai)とRuby版Sisimai(rb-sisimai)は下記のような違いが
|
212
212
|
あります。bounceHammer 2.7.13p3とSisimai(シシマイ)の違いについては
|
213
213
|
[Sisimai | 違いの一覧](https://libsisimai.org/ja/diff/)をご覧ください。
|
214
214
|
|
@@ -220,12 +220,12 @@ Differences between Ruby version and Perl version
|
|
220
220
|
| メール解析速度(1000通のメール) | 2.22秒[2] | 1.35秒 |
|
221
221
|
| インストール方法 | gem install | cpanm, cpm |
|
222
222
|
| 依存モジュール数(コアモジュールを除く) | 1モジュール | 2モジュール |
|
223
|
-
| LOC:ソースコードの行数 |
|
224
|
-
| テスト件数(spec/,t/,xt/ディレクトリ) | 236000件 |
|
223
|
+
| LOC:ソースコードの行数 | 10300行 | 10500行 |
|
224
|
+
| テスト件数(spec/,t/,xt/ディレクトリ) | 236000件 | 265000件 |
|
225
225
|
| ライセンス | 二条項BSD | 二条項BSD |
|
226
226
|
| 開発会社によるサポート契約 | 提供中 | 提供中 |
|
227
227
|
|
228
|
-
1. [./ANALYTICAL-PRECISION](https://github.com/sisimai/rb-
|
228
|
+
1. [./ANALYTICAL-PRECISION](https://github.com/sisimai/rb-sisimai/blob/master/ANALYTICAL-PRECISION)を参照
|
229
229
|
2. Xeon E5-2640 2.5GHz x 2 cores | 5000 bogomips | 1GB RAM | Ruby 2.3.4p301
|
230
230
|
|
231
231
|
Other spec of Sisimai
|
@@ -239,7 +239,7 @@ Contributing
|
|
239
239
|
|
240
240
|
Bug report
|
241
241
|
-------------------------------------------------------------------------------
|
242
|
-
もしもSisimaiにバグを発見した場合は[Issues](https://github.com/sisimai/rb-
|
242
|
+
もしもSisimaiにバグを発見した場合は[Issues](https://github.com/sisimai/rb-sisimai/issues)
|
243
243
|
にて連絡をいただけると助かります。
|
244
244
|
|
245
245
|
Emails could not be parsed
|
@@ -256,14 +256,14 @@ Related sites
|
|
256
256
|
* __libSISIMAI.ORG__ | [Sisimai | The successor to bounceHammer, Library to parse bounce mails](https://libsisimai.org/)
|
257
257
|
* __Sisimai Blog__ | [blog.libsisimai.org](http://blog.libsisimai.org/)
|
258
258
|
* __Facebook Page__ | [facebook.com/libsisimai](https://www.facebook.com/libsisimai/)
|
259
|
-
* __GitHub__ | [github.com/sisimai/rb-
|
259
|
+
* __GitHub__ | [github.com/sisimai/rb-sisimai](https://github.com/sisimai/rb-sisimai)
|
260
260
|
* __RubyGems.org__ | [rubygems.org/gems/sisimai](https://rubygems.org/gems/sisimai)
|
261
|
-
* __Perl verson__ | [Perl version of Sisimai](https://github.com/sisimai/p5-
|
261
|
+
* __Perl verson__ | [Perl version of Sisimai](https://github.com/sisimai/p5-sisimai)
|
262
262
|
* __Fixtures__ | [set-of-emails - Sample emails for "make test"](https://github.com/sisimai/set-of-emails)
|
263
263
|
|
264
264
|
See also
|
265
265
|
-------------------------------------------------------------------------------
|
266
|
-
* [README.md - README.md in English](https://github.com/sisimai/rb-
|
266
|
+
* [README.md - README.md in English](https://github.com/sisimai/rb-sisimai/blob/master/README.md)
|
267
267
|
* [RFC3463 - Enhanced Mail System Status Codes](https://tools.ietf.org/html/rfc3463)
|
268
268
|
* [RFC3464 - An Extensible Message Format for Delivery Status Notifications](https://tools.ietf.org/html/rfc3464)
|
269
269
|
* [RFC3834 - Recommendations for Automatic Responses to Electronic Mail](https://tools.ietf.org/html/rfc3834)
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
![](https://libsisimai.org/static/images/logo/sisimai-x01.png)
|
2
2
|
|
3
|
-
[![License](https://img.shields.io/badge/license-BSD%202--Clause-orange.svg)](https://github.com/sisimai/rb-
|
4
|
-
[![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-
|
5
|
-
[![Build Status](https://travis-ci.org/sisimai/rb-
|
6
|
-
[![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-
|
3
|
+
[![License](https://img.shields.io/badge/license-BSD%202--Clause-orange.svg)](https://github.com/sisimai/rb-sisimai/blob/master/LICENSE)
|
4
|
+
[![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-sisimai.svg)](https://coveralls.io/r/sisimai/rb-sisimai)
|
5
|
+
[![Build Status](https://travis-ci.org/sisimai/rb-sisimai.svg?branch=master)](https://travis-ci.org/sisimai/rb-sisimai)
|
6
|
+
[![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-sisimai)
|
7
7
|
[![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.6.0-red.svg)](https://www.ruby-lang.org/)
|
8
8
|
[![Gem Version](https://badge.fury.io/rb/sisimai.svg)](https://badge.fury.io/rb/sisimai)
|
9
9
|
|
@@ -39,7 +39,7 @@ What is Sisimai
|
|
39
39
|
===============================================================================
|
40
40
|
Sisimai is a Ruby library for analyzing RFC5322 bounce emails and generating
|
41
41
|
structured data from parsed results. The Ruby version of Sisimai is ported from
|
42
|
-
the Perl version of Sisimai at [github.com/sisimai/p5-
|
42
|
+
the Perl version of Sisimai at [github.com/sisimai/p5-sisimai](https://github.com/sisimai/p5-sisimai/).
|
43
43
|
|
44
44
|
![](https://libsisimai.org/static/images/figure/sisimai-overview-1.png)
|
45
45
|
|
@@ -52,14 +52,14 @@ Key Features
|
|
52
52
|
* git clone & make
|
53
53
|
* __High Precision of Analysis__
|
54
54
|
* 2 times higher than bounceHammer
|
55
|
-
* Support
|
55
|
+
* Support 68 MTAs/MDAs/ESPs
|
56
56
|
* Support Feedback Loop Message(ARF)
|
57
57
|
* Can detect 29 error reasons
|
58
58
|
|
59
59
|
Command line demo
|
60
60
|
-------------------------------------------------------------------------------
|
61
61
|
The following screen shows a demonstration of Sisimai at the command line using
|
62
|
-
Ruby(rb-
|
62
|
+
Ruby(rb-sisimai) and Perl(p5-sisimai) version of Sisimai.
|
63
63
|
![](https://libsisimai.org/static/images/demo/sisimai-dump-01.gif)
|
64
64
|
|
65
65
|
Setting Up Sisimai
|
@@ -94,8 +94,8 @@ Done installing documentation for sisimai after 6 seconds
|
|
94
94
|
|
95
95
|
```shell
|
96
96
|
$ cd /usr/local/src
|
97
|
-
$ git clone https://github.com/sisimai/rb-
|
98
|
-
$ cd ./rb-
|
97
|
+
$ git clone https://github.com/sisimai/rb-sisimai.git
|
98
|
+
$ cd ./rb-sisimai
|
99
99
|
$ sudo make depend install-from-local
|
100
100
|
gem install bundle rake rspec coveralls
|
101
101
|
...
|
@@ -225,12 +225,12 @@ and bounceHammer are available at
|
|
225
225
|
| The speed of parsing email(1000 emails) | 2.22s[2] | 1.35s |
|
226
226
|
| How to install | gem install | cpanm, cpm |
|
227
227
|
| Dependencies (Except core modules) | 1 module | 2 modules |
|
228
|
-
| LOC:Source lines of code |
|
229
|
-
| The number of tests(spec/,t/,xt/) directory | 236000 tests |
|
228
|
+
| LOC:Source lines of code | 10300 lines | 10500 lines |
|
229
|
+
| The number of tests(spec/,t/,xt/) directory | 236000 tests | 265000 tests |
|
230
230
|
| License | BSD 2-Clause | BSD 2-Clause |
|
231
231
|
| Support Contract provided by Developer | Available | Available |
|
232
232
|
|
233
|
-
1. See [./ANALYTICAL-PRECISION](https://github.com/sisimai/rb-
|
233
|
+
1. See [./ANALYTICAL-PRECISION](https://github.com/sisimai/rb-sisimai/blob/master/ANALYTICAL-PRECISION)
|
234
234
|
2. Xeon E5-2640 2.5GHz x 2 cores | 5000 bogomips | 1GB RAM | Ruby 2.3.4p301
|
235
235
|
|
236
236
|
Other specification of Sisimai
|
@@ -244,7 +244,7 @@ Contributing
|
|
244
244
|
|
245
245
|
Bug report
|
246
246
|
-------------------------------------------------------------------------------
|
247
|
-
Please use the [issue tracker](https://github.com/sisimai/rb-
|
247
|
+
Please use the [issue tracker](https://github.com/sisimai/rb-sisimai/issues)
|
248
248
|
to report any bugs.
|
249
249
|
|
250
250
|
Emails could not be parsed
|
@@ -263,14 +263,14 @@ Related Sites
|
|
263
263
|
* __libSISIMAI.ORG__ | [Sisimai | The successor to bounceHammer, Library to parse bounce mails](https://libsisimai.org/)
|
264
264
|
* __Sisimai Blog__ | [blog.libsisimai.org](http://blog.libsisimai.org/)
|
265
265
|
* __Facebook Page__ | [facebook.com/libsisimai](https://www.facebook.com/libsisimai/)
|
266
|
-
* __GitHub__ | [github.com/sisimai/rb-
|
266
|
+
* __GitHub__ | [github.com/sisimai/rb-sisimai](https://github.com/sisimai/rb-sisimai)
|
267
267
|
* __RubyGems.org__ | [rubygems.org/gems/sisimai](https://rubygems.org/gems/sisimai)
|
268
|
-
* __Perl verson__ | [Perl version of Sisimai](https://github.com/sisimai/p5-
|
268
|
+
* __Perl verson__ | [Perl version of Sisimai](https://github.com/sisimai/p5-sisimai)
|
269
269
|
* __Fixtures__ | [set-of-emails - Sample emails for "make test"](https://github.com/sisimai/set-of-emails)
|
270
270
|
|
271
271
|
See also
|
272
272
|
-------------------------------------------------------------------------------
|
273
|
-
* [README-JA.md - README.md in Japanese(日本語)](https://github.com/sisimai/rb-
|
273
|
+
* [README-JA.md - README.md in Japanese(日本語)](https://github.com/sisimai/rb-sisimai/blob/master/README-JA.md)
|
274
274
|
* [RFC3463 - Enhanced Mail System Status Codes](https://tools.ietf.org/html/rfc3463)
|
275
275
|
* [RFC3464 - An Extensible Message Format for Delivery Status Notifications](https://tools.ietf.org/html/rfc3464)
|
276
276
|
* [RFC3834 - Recommendations for Automatic Responses to Electronic Mail](https://tools.ietf.org/html/rfc3834)
|
data/Repository.mk
CHANGED
data/lib/sisimai.rb
CHANGED
@@ -31,11 +31,11 @@ module Sisimai
|
|
31
31
|
while r = mail.data.read do
|
32
32
|
# Read and parse each email file
|
33
33
|
methodargv = { data: r, hook: argv1[:hook] }
|
34
|
-
mesg = Sisimai::Message.new(methodargv)
|
34
|
+
mesg = Sisimai::Message.new(**methodargv)
|
35
35
|
next if mesg.void
|
36
36
|
|
37
37
|
methodargv = { data: mesg, delivered: argv1[:delivered], origin: mail.data.path }
|
38
|
-
next unless data = Sisimai::Data.make(methodargv)
|
38
|
+
next unless data = Sisimai::Data.make(**methodargv)
|
39
39
|
list += data unless data.empty?
|
40
40
|
end
|
41
41
|
|
@@ -54,7 +54,7 @@ module Sisimai
|
|
54
54
|
def dump(argv0, **argv1)
|
55
55
|
return nil unless argv0
|
56
56
|
|
57
|
-
nyaan = Sisimai.make(argv0, argv1) || []
|
57
|
+
nyaan = Sisimai.make(argv0, **argv1) || []
|
58
58
|
if RUBY_PLATFORM.start_with?('java')
|
59
59
|
# java-based ruby environment like JRuby.
|
60
60
|
require 'jrjackson'
|
data/lib/sisimai/address.rb
CHANGED
@@ -240,7 +240,7 @@ module Sisimai
|
|
240
240
|
|
241
241
|
# Remove angle brackets, other brackets, and quotations: []<>{}'`
|
242
242
|
# except a domain part is an IP address like neko@[192.0.2.222]
|
243
|
-
e[:address] = e[:address].sub(/\A[\[<{('`]/, '').sub(/['`>})]\z/, '')
|
243
|
+
e[:address] = e[:address].sub(/\A[\[<{('`]/, '').sub(/[.'`>});]\z/, '')
|
244
244
|
e[:address].chomp!(']') unless e[:address] =~ /[@]\[[0-9A-Za-z:\.]+\]\z/
|
245
245
|
e[:address] = e[:address].sub(/\A["]/, '').chomp('"') unless e[:address] =~ /\A["].+["][@]/
|
246
246
|
|
@@ -321,13 +321,16 @@ module Sisimai
|
|
321
321
|
addrs = Sisimai::Address.find(argv1)
|
322
322
|
return nil unless addrs
|
323
323
|
return nil if addrs.empty?
|
324
|
+
|
324
325
|
thing = addrs.shift
|
326
|
+
heads = ['<']
|
327
|
+
tails = ['>', ',', '.', ';']
|
325
328
|
|
326
329
|
if cv = thing[:address].match(/\A([^\s]+)[@]([^@]+)\z/) ||
|
327
330
|
thing[:address].match(/\A(["].+?["])[@]([^@]+)\z/)
|
328
331
|
# Get the local part and the domain part from the email address
|
329
|
-
lpart = cv[1]
|
330
|
-
dpart = cv[2]
|
332
|
+
lpart = cv[1]; heads.each { |e| lpart.gsub!(/\A#{e}/, '') if lpart.start_with?(e) }
|
333
|
+
dpart = cv[2]; tails.each { |e| dpart.gsub!(/#{e}\z/, '') if dpart.end_with?(e) }
|
331
334
|
email = Sisimai::Address.expand_verp(thing[:address])
|
332
335
|
aname = nil
|
333
336
|
|
data/lib/sisimai/arf.rb
CHANGED
@@ -14,15 +14,20 @@ module Sisimai
|
|
14
14
|
# OpenDMARC 1.3.0 uses: This is an authentication failure report for an email message received from IP
|
15
15
|
# Abusix ARF uses this is an autogenerated email abuse complaint regarding your network.
|
16
16
|
Indicators = Sisimai::Lhost.INDICATORS
|
17
|
-
StartingOf = {
|
17
|
+
StartingOf = {
|
18
|
+
rfc822: ['Content-Type: message/rfc822', 'Content-Type: text/rfc822-headers'],
|
19
|
+
report: ['Content-Type: message/feedback-report'],
|
20
|
+
}.freeze
|
18
21
|
MarkingsOf = {
|
19
22
|
message: %r{\A(?>
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
[Tt]his[ ]is[ ]a[ ][^ ]+[ ](?:email[ ])?[Aa]buse[ ][Rr]eport
|
24
|
+
|[Tt]his[ ]is[ ]an[ ]email[ ]abuse[ ]report
|
25
|
+
|[Tt]his[ ]is[ ](?:
|
26
|
+
a[ ][^ ]+[ ]authentication[ -]failure[ ]report
|
27
|
+
|an[ ]authentication[ -]failure[ ]report
|
28
|
+
|an[ ]autogenerated[ ]email[ ]abuse[ ]complaint
|
29
|
+
|an?[ ][^ ]+[ ]report[ ]for
|
30
|
+
)
|
26
31
|
)
|
27
32
|
}x,
|
28
33
|
}.freeze
|
@@ -33,8 +38,7 @@ module Sisimai
|
|
33
38
|
def description; return 'Abuse Feedback Reporting Format'; end
|
34
39
|
|
35
40
|
# Email is a Feedback-Loop message or not
|
36
|
-
# @param [Hash] heads Email header including "Content-Type", "From",
|
37
|
-
# and "Subject" field
|
41
|
+
# @param [Hash] heads Email header including "Content-Type", "From", and "Subject" field
|
38
42
|
# @return [True,False] true: Feedback Loop
|
39
43
|
# false: is not Feedback loop
|
40
44
|
def is_arf(heads)
|
@@ -109,12 +113,17 @@ module Sisimai
|
|
109
113
|
# this specification is set to "1".
|
110
114
|
#
|
111
115
|
while e = bodyslices.shift do
|
116
|
+
# This is an email abuse report for an email message with the
|
117
|
+
# message-id of 0000-000000000000000000000000000000000@mx
|
118
|
+
# received from IP address 192.0.2.1 on
|
119
|
+
# Thu, 29 Apr 2010 00:00:00 +0900 (JST)
|
120
|
+
if e =~ MarkingsOf[:message]
|
121
|
+
commondata['diagnosis'] = e if commondata['diagnosis'].empty?
|
122
|
+
end
|
123
|
+
|
112
124
|
if readcursor == 0
|
113
125
|
# Beginning of the bounce message or message/delivery-status part
|
114
|
-
if e
|
115
|
-
readcursor |= Indicators[:deliverystatus]
|
116
|
-
next
|
117
|
-
end
|
126
|
+
readcursor |= Indicators[:deliverystatus] if e.start_with?(StartingOf[:report][0])
|
118
127
|
end
|
119
128
|
|
120
129
|
if (readcursor & Indicators[:'message-rfc822']) == 0
|
@@ -169,7 +178,7 @@ module Sisimai
|
|
169
178
|
rcptintext = rhs if lhs == 'to'
|
170
179
|
end
|
171
180
|
else
|
172
|
-
# message/
|
181
|
+
# message/feedback-report part
|
173
182
|
next unless readcursor & Indicators[:deliverystatus] > 0
|
174
183
|
next if e.empty?
|
175
184
|
|
@@ -226,7 +235,7 @@ module Sisimai
|
|
226
235
|
# Reporting-MTA: dns; mx.example.jp
|
227
236
|
commondata['rhost'] = cv[1]
|
228
237
|
|
229
|
-
elsif cv = e.match(/\ASource-
|
238
|
+
elsif cv = e.match(/\ASource-I[Pp]:[ ]*(.+)\z/)
|
230
239
|
# The header is optional and MUST NOT appear more than once.
|
231
240
|
# Source-IP: 192.0.2.45
|
232
241
|
arfheaders['rhost'] = cv[1]
|
@@ -236,12 +245,6 @@ module Sisimai
|
|
236
245
|
# Original-Mail-From: <somespammer@example.net>
|
237
246
|
commondata['from'] = Sisimai::Address.s3s4(cv[1]) if commondata['from'].empty?
|
238
247
|
|
239
|
-
elsif e =~ MarkingsOf[:message]
|
240
|
-
# This is an email abuse report for an email message with the
|
241
|
-
# message-id of 0000-000000000000000000000000000000000@mx
|
242
|
-
# received from IP address 192.0.2.1 on
|
243
|
-
# Thu, 29 Apr 2010 00:00:00 +0900 (JST)
|
244
|
-
commondata['diagnosis'] = e
|
245
248
|
end
|
246
249
|
end
|
247
250
|
end
|
@@ -287,6 +290,7 @@ module Sisimai
|
|
287
290
|
|
288
291
|
e['softbounce'] = -1
|
289
292
|
e['diagnosis'] = commondata['diagnosis'] unless e['diagnosis']
|
293
|
+
e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
|
290
294
|
e['date'] = mhead['date'] if e['date'].empty?
|
291
295
|
e['reason'] = 'feedback'
|
292
296
|
e['agent'] = 'Feedback-Loop'
|