sisimai 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +10 -0
- data/README-JA.md +6 -6
- data/README.md +18 -18
- data/lib/sisimai/rhost/cloudflare.rb +31 -0
- data/lib/sisimai/rhost/nttdocomo.rb +8 -2
- data/lib/sisimai/rhost.rb +1 -0
- data/lib/sisimai/smtp/status.rb +1 -1
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/maildir/bsd/rhost-cloudflare-01.eml +75 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bab63d91aaae7cafcd3eb9fb7d5f10335abdf48ea110aa653e9b1cab0826295b
|
4
|
+
data.tar.gz: a0538d447059d4faf79d3d70de91fc131c1c8718fce4623ea0d1e6d11f4d76a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8570d1381042de41fd967b5d63731d23b5d5dae98de06d72c8b67e34a47eb8f4d32bc792407eff2a1c336dc90b656999742dddedcb427f8abd3347b9184f7089
|
7
|
+
data.tar.gz: fe629b00d60cfffa2a8f3b37c86f9ae6796fb5baec6bf9383c36be996ffed2d672a5a546b4e279dd53a22b4e91411ba39981e1dea21d231fa07e547e96615456
|
data/ChangeLog.md
CHANGED
@@ -3,6 +3,16 @@ RELEASE NOTES for Ruby version of Sisimai
|
|
3
3
|
- releases: "https://github.com/sisimai/rb-sisimai/releases"
|
4
4
|
- download: "https://rubygems.org/gems/sisimai"
|
5
5
|
|
6
|
+
v5.2.1
|
7
|
+
---------------------------------------------------------------------------------------------------
|
8
|
+
- release: "Wed, 12 Mar 2025 06:50:25 +0900 (JST)"
|
9
|
+
- version: "5.2.1"
|
10
|
+
- changes:
|
11
|
+
- Implement `Sisimai::Rhost::Cloudflare` #336 #337
|
12
|
+
- #333 NTT DOCOMO (Major Japanese mobile carrier) no longer returns a bounce mail due to domain
|
13
|
+
rejection or similar email settings, but instead were being delivered to the spam folder after
|
14
|
+
March 13th. #334
|
15
|
+
|
6
16
|
v5.2.0
|
7
17
|
---------------------------------------------------------------------------------------------------
|
8
18
|
- release: "5.2.0"
|
data/README-JA.md
CHANGED
@@ -65,14 +65,14 @@ Sisimai(シシマイ)は複雑で多種多様なバウンスメールを解析
|
|
65
65
|
The key features of Sisimai
|
66
66
|
---------------------------------------------------------------------------------------------------
|
67
67
|
* __バウンスメールを構造化したデータに変換__
|
68
|
-
* 以下
|
68
|
+
* 以下26項目の情報を含むデータ構造[^2]
|
69
69
|
* __基本的情報__: `timestamp`, `origin`
|
70
70
|
* __発信者情報__: `addresser`, `senderdomain`,
|
71
71
|
* __受信者情報__: `recipient`, `destination`, `alias`
|
72
|
-
* __配信の情報__: `action`, `replycode
|
72
|
+
* __配信の情報__: `action`, `replycode`, `deliverystatus`, `command`
|
73
73
|
* __エラー情報__: `reason`, `diagnosticcode`, `diagnostictype`, `feedbacktype`, `hardbounce`
|
74
74
|
* __メール情報__: `subject`, `messageid`, `listid`,
|
75
|
-
* __その他情報__: `
|
75
|
+
* __その他情報__: `decodedby`, `timezoneoffset`, `lhost`, `rhost`, `token`, `catch`
|
76
76
|
* __出力可能な形式__
|
77
77
|
* Ruby (Hash, Array)
|
78
78
|
* JSON
|
@@ -319,8 +319,8 @@ Output example
|
|
319
319
|
"catch": null,
|
320
320
|
"addresser": "michitsuna@example.jp",
|
321
321
|
"alias": "nekochan@example.co.jp",
|
322
|
-
"
|
323
|
-
"
|
322
|
+
"decodedby": "Postfix",
|
323
|
+
"command": "DATA",
|
324
324
|
"senderdomain": "example.jp",
|
325
325
|
"listid": "",
|
326
326
|
"action": "failed",
|
@@ -362,7 +362,7 @@ Sisimai 5.0.0から**Ruby 2.4以上**が必要になります。
|
|
362
362
|
| ソースコードの行数 | 10,800 行 | 9,860 行 |
|
363
363
|
| テストフレームワーク | rspec | minitest |
|
364
364
|
| テスト件数(spec/またはtest/ディレクトリ) | 311,000 件 | 410,000 件 |
|
365
|
-
| 1秒間に解析できるバウンスメール数[^4] | 290 通 |
|
365
|
+
| 1秒間に解析できるバウンスメール数[^4] | 290 通 | 360 通 |
|
366
366
|
| ライセンス | 2条項BSD | 2条項BSD |
|
367
367
|
| 開発会社による商用サポート | 提供中 | 提供中 |
|
368
368
|
|
data/README.md
CHANGED
@@ -67,14 +67,14 @@ Perl version of Sisimai at [github.com/sisimai/p5-sisimai](https://github.com/si
|
|
67
67
|
The key features of Sisimai
|
68
68
|
---------------------------------------------------------------------------------------------------
|
69
69
|
* __Decode email bounces to structured data__
|
70
|
-
* Sisimai provides detailed insights into bounce emails by extracting
|
70
|
+
* Sisimai provides detailed insights into bounce emails by extracting 26 key data points.[^2]
|
71
71
|
* __Essential information__: `timestamp`, `origin`
|
72
72
|
* __Sender information__: `addresser`, `senderdomain`,
|
73
73
|
* __Recipient information__: `recipient`, `destination`, `alias`
|
74
|
-
* __Delivery information__: `action`, `replycode
|
75
|
-
* __Bounce details__: `reason`, `diagnosticcode`, `diagnostictype`, `feedbacktype`, `hardbounce`
|
74
|
+
* __Delivery information__: `action`, `replycode`, `deliverystatus`, `command`
|
75
|
+
* __Bounce details__: `reason`, `diagnosticcode`, `diagnostictype`, `feedbacktype`, `feedbackid`, `hardbounce`
|
76
76
|
* __Message details__: `subject`, `messageid`, `listid`,
|
77
|
-
* __Additional information__: `
|
77
|
+
* __Additional information__: `decodedby`, `timezoneoffset`, `lhost`, `rhost`, `token`, `catch`
|
78
78
|
* Output formats
|
79
79
|
* Ruby (Hash, Array)
|
80
80
|
* JSON
|
@@ -85,9 +85,9 @@ The key features of Sisimai
|
|
85
85
|
* `gem install`
|
86
86
|
* `git clone && make`
|
87
87
|
* __High Precision of Analysis__
|
88
|
-
* Support [
|
88
|
+
* Support [59 MTAs/MDAs/ESPs](https://libsisimai.org/en/engine/)
|
89
89
|
* Support Feedback Loop Message(ARF)
|
90
|
-
* Can detect [
|
90
|
+
* Can detect [36 bounce reasons](https://libsisimai.org/en/reason/)
|
91
91
|
|
92
92
|
[^2]: The callback function allows you to add your own data under the `catch` accessor.
|
93
93
|
|
@@ -114,10 +114,10 @@ Install
|
|
114
114
|
### From RubyGems
|
115
115
|
```shell
|
116
116
|
$ sudo gem install sisimai
|
117
|
-
Fetching: sisimai-5.2.
|
118
|
-
Successfully installed sisimai-5.2.
|
119
|
-
Parsing documentation for sisimai-5.2.
|
120
|
-
Installing ri documentation for sisimai-5.2.
|
117
|
+
Fetching: sisimai-5.2.1.gem (100%)
|
118
|
+
Successfully installed sisimai-5.2.1
|
119
|
+
Parsing documentation for sisimai-5.2.1
|
120
|
+
Installing ri documentation for sisimai-5.2.1
|
121
121
|
Done installing documentation for sisimai after 6 seconds
|
122
122
|
1 gem installed
|
123
123
|
```
|
@@ -145,13 +145,13 @@ if [ -d "/usr/local/jr" ]; then \
|
|
145
145
|
...
|
146
146
|
3 gems installed
|
147
147
|
/opt/local/bin/rake install
|
148
|
-
sisimai 5.2.
|
149
|
-
sisimai (5.2.
|
148
|
+
sisimai 5.2.1 built to pkg/sisimai-5.2.1.gem.
|
149
|
+
sisimai (5.2.1) installed.
|
150
150
|
if [ -d "/usr/local/jr" ]; then \
|
151
151
|
PATH="/usr/local/jr/bin:$PATH" /usr/local/jr/bin/rake install; \
|
152
152
|
fi
|
153
|
-
sisimai 5.2.
|
154
|
-
sisimai (5.2.
|
153
|
+
sisimai 5.2.1 built to pkg/sisimai-5.2.1-java.gem.
|
154
|
+
sisimai (5.2.1) installed.
|
155
155
|
```
|
156
156
|
|
157
157
|
Usage
|
@@ -318,8 +318,8 @@ Output example
|
|
318
318
|
"catch": null,
|
319
319
|
"addresser": "michitsuna@example.jp",
|
320
320
|
"alias": "nekochan@example.co.jp",
|
321
|
-
"
|
322
|
-
"
|
321
|
+
"decodedby": "Postfix",
|
322
|
+
"command": "DATA",
|
323
323
|
"senderdomain": "example.jp",
|
324
324
|
"listid": "",
|
325
325
|
"action": "failed",
|
@@ -355,13 +355,13 @@ Beginning with v5.0.0, Sisimai requires **Ruby 2.4.0 or later.**
|
|
355
355
|
| System requirements (CRuby) | 2.1 - 3.3.0 | **2.4** or later |
|
356
356
|
| System requirements (JRuby) | 9.0.4.0 - 9.1.17.0 | **9.2** or later |
|
357
357
|
| Callback feature for the original email file | N/A | Available[^3] |
|
358
|
-
| The number of MTA/ESP modules | 68 |
|
358
|
+
| The number of MTA/ESP modules | 68 | 59 |
|
359
359
|
| The number of detectable bounce reasons | 29 | 36 |
|
360
360
|
| Dependencies (Except Ruby Standard Gems) | 1 gem | 1 gem |
|
361
361
|
| Source lines of code | 10,300 lines | 9,800 lines |
|
362
362
|
| Test frameworks | rspec | minitest |
|
363
363
|
| The number of tests in spec/ or test/ directory | 311,000 tests | 410,000 tests |
|
364
|
-
| The number of bounce emails decoded/sec (CRuby)[^4] | 290 emails |
|
364
|
+
| The number of bounce emails decoded/sec (CRuby)[^4] | 290 emails | 360 emails |
|
365
365
|
| License | 2 Clause BSD | 2 Caluse BSD |
|
366
366
|
| Commercial support | Available | Available |
|
367
367
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Sisimai
|
2
|
+
module Rhost
|
3
|
+
# Sisimai::Rhost detects the bounce reason from the content of Sisimai::Fact object as an argument
|
4
|
+
# of find() method when the value of "rhost" of the object is "*.mx.cloudflare.net".
|
5
|
+
# This class is called only from Sisimai::Fact class.
|
6
|
+
module Cloudflare
|
7
|
+
class << self
|
8
|
+
MessagesOf = {
|
9
|
+
"blocked" => ["found on one or more DNSBLs"],
|
10
|
+
"systemerror" => ["Upstream error"],
|
11
|
+
}.freeze
|
12
|
+
|
13
|
+
# Detect bounce reason from Cloudflare Email Routing
|
14
|
+
# @param [Sisimai::Fact] argvs Decoded email object
|
15
|
+
# @return [String] The bounce reason for Cloudflare
|
16
|
+
# @since v5.2.1
|
17
|
+
# @see https://developers.cloudflare.com/email-routing/postmaster/
|
18
|
+
def find(argvs)
|
19
|
+
return "" if argvs["diagnosticcode"].empty?
|
20
|
+
MessagesOf.each_key do |e|
|
21
|
+
# Try to match the error message with message patterns defined in $MessagesOf
|
22
|
+
return e if MessagesOf[e].any? { |a| argvs["diagnosticcode"].include?(a) }
|
23
|
+
end
|
24
|
+
return ""
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
@@ -7,8 +7,9 @@ module Sisimai
|
|
7
7
|
class << self
|
8
8
|
MessagesOf = {
|
9
9
|
'mailboxfull' => ['552 too much mail data'],
|
10
|
-
'toomanyconn' => ['552 too many recipients'],
|
11
10
|
'syntaxerror' => ['503 bad sequence of commands', '504 command parameter not implemented'],
|
11
|
+
'toomanyconn' => ['552 too many recipients'],
|
12
|
+
'userunknown' => ['550 unknown user'],
|
12
13
|
}.freeze
|
13
14
|
|
14
15
|
# Detect bounce reason from NTT DOCOMO
|
@@ -51,7 +52,12 @@ module Sisimai
|
|
51
52
|
else
|
52
53
|
# The value of "Diagnostic-Code:" field is not empty
|
53
54
|
MessagesOf.each_key do |e|
|
54
|
-
#
|
55
|
+
# - The key name is a bounce reason name
|
56
|
+
# - https://github.com/sisimai/go-sisimai/issues/64
|
57
|
+
# - After March 12, 2025, if an error message contains "550 Unknown user", the
|
58
|
+
# bounce reason will be definitively "userunknown". This is because NTT DOCOMO
|
59
|
+
# no longer rejects emails via SMTP for domain-specific rejection or specified
|
60
|
+
# reception filters.
|
55
61
|
next unless MessagesOf[e].any? { |a| esmtperror.include?(a) }
|
56
62
|
reasontext = e
|
57
63
|
break
|
data/lib/sisimai/rhost.rb
CHANGED
@@ -7,6 +7,7 @@ module Sisimai
|
|
7
7
|
RhostClass = {
|
8
8
|
"Aol" => [".mail.aol.com", ".mx.aol.com"],
|
9
9
|
"Apple" => [".mail.icloud.com", ".apple.com", ".me.com"],
|
10
|
+
"Cloudflare" => [".mx.cloudflare.net"],
|
10
11
|
"Cox" => ["cox.net"],
|
11
12
|
"Facebook" => [".facebook.com"],
|
12
13
|
"FrancePTT" => [".laposte.net", ".orange.fr", ".wanadoo.fr"],
|
data/lib/sisimai/smtp/status.rb
CHANGED
@@ -735,7 +735,7 @@ module Sisimai
|
|
735
735
|
else
|
736
736
|
['5.', '4.', '2.']
|
737
737
|
end
|
738
|
-
esmtperror = ' ' + argv1 + '
|
738
|
+
esmtperror = ' ' + argv1 + ' ' # Why 3 space characters? see https://github.com/sisimai/p5-sisimai/issues/574
|
739
739
|
lookingfor = []
|
740
740
|
|
741
741
|
Sisimai::RFC791.find(esmtperror).each do |e|
|
data/lib/sisimai/version.rb
CHANGED
@@ -0,0 +1,75 @@
|
|
1
|
+
Return-Path: <>
|
2
|
+
Received: from relay.mx.example.jp (unknown [192.0.2.21])
|
3
|
+
by sisimai.mx.example.jp (Postfix) with ESMTPS id m6SrZSzVjhzC3KjV
|
4
|
+
for <neko@mx.example.jp>; Tue, 2 Jul 2024 23:34:45 +0900 (JST)
|
5
|
+
Date: Tue, 2 Jul 2024 23:34:45 +0900 (JST)
|
6
|
+
From: MAILER-DAEMON@relay.mx.example.jp (Mail Delivery System)
|
7
|
+
To: neko@mx.example.jp
|
8
|
+
Message-Id: <qQYlj9jhzdzY6WHr@relay.mx.example.jp>
|
9
|
+
Subject: Undelivered Mail Returned to Sender
|
10
|
+
Auto-Submitted: auto-replied
|
11
|
+
MIME-Version: 1.0
|
12
|
+
Content-Type: multipart/report; report-type=delivery-status;
|
13
|
+
boundary="yKvJXwrDt6zP1H5n.1316187218/relay.mx.example.jp"
|
14
|
+
|
15
|
+
This is a MIME-encapsulated message.
|
16
|
+
|
17
|
+
--yKvJXwrDt6zP1H5n.1316187218/relay.mx.example.jp
|
18
|
+
Content-Description: Notification
|
19
|
+
Content-Type: text/plain; charset=us-ascii
|
20
|
+
|
21
|
+
This is the mail system at host relay.mx.example.jp.
|
22
|
+
|
23
|
+
I'm sorry to have to inform you that your message could not
|
24
|
+
be delivered to one or more recipients. It's attached below.
|
25
|
+
|
26
|
+
For further assistance, please send mail to postmaster.
|
27
|
+
|
28
|
+
If you do so, please include this problem report. You can
|
29
|
+
delete your own text from the attached returned message.
|
30
|
+
|
31
|
+
The mail system
|
32
|
+
|
33
|
+
<kijitora-neko@example.com>: host route3.mx.cloudflare.net[162.159.205.25]
|
34
|
+
said: 421 4.3.0 Upstream error, please check
|
35
|
+
https://developers.cloudflare.com/email-routing/postmaster for possible
|
36
|
+
reasons why. RsrUEMk60942 (in reply to end of DATA command)
|
37
|
+
|
38
|
+
--yKvJXwrDt6zP1H5n.1316187218/relay.mx.example.jp
|
39
|
+
Content-Description: Delivery report
|
40
|
+
Content-Type: message/delivery-status
|
41
|
+
|
42
|
+
Reporting-MTA: dns; relay.mx.example.jp
|
43
|
+
X-Postfix-Queue-ID: yKvJXwrDt6zP1H5n
|
44
|
+
X-Postfix-Sender: rfc822; neko@mx.example.jp
|
45
|
+
Arrival-Date: Tue, 2 Jul 2024 23:34:45 +0900 (JST)
|
46
|
+
|
47
|
+
Final-Recipient: rfc822; kijitora-neko@example.com
|
48
|
+
Original-Recipient: rfc822;kijitora-neko@example.com
|
49
|
+
Action: failed
|
50
|
+
Status: 4.3.0
|
51
|
+
Remote-MTA: dns; route3.mx.cloudflare.net
|
52
|
+
Diagnostic-Code: smtp; 421 4.3.0 Upstream error, please check
|
53
|
+
https://developers.cloudflare.com/email-routing/postmaster for possible
|
54
|
+
reasons why. RsrUEMk60942
|
55
|
+
|
56
|
+
--yKvJXwrDt6zP1H5n.1316187218/relay.mx.example.jp
|
57
|
+
Content-Description: Undelivered Message
|
58
|
+
Content-Type: message/rfc822
|
59
|
+
|
60
|
+
Return-Path: <neko@mx.example.jp>
|
61
|
+
Received: from local-mail-hub-1.example.jp (unknown [192.0.2.253])
|
62
|
+
by relay.mx.example.jp (Postfix) with ESMTP id yKvJXwrDt6zP1H5n
|
63
|
+
for <kijitora-neko@example.com>; Tue, 2 Jul 2024 23:34:45 +0900 (JST)
|
64
|
+
From: <neko@mx.example.jp>
|
65
|
+
Date: Tue, 02 Jul 2024 23:34:45 +0900
|
66
|
+
Message-Id: <QtF9aH-aSDIzG-WP@mx.example.jp>
|
67
|
+
To: <kijitora-neko@example.com>
|
68
|
+
Subject: Nyaaaaaan
|
69
|
+
MIME-Version: 1.0
|
70
|
+
Content-Type: text/plain; charset=us-ascii
|
71
|
+
|
72
|
+
Nyaan?
|
73
|
+
|
74
|
+
--yKvJXwrDt6zP1H5n.1316187218/relay.mx.example.jp--
|
75
|
+
|
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: 5.2.
|
4
|
+
version: 5.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azumakuniyuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/sisimai/rhost.rb
|
195
195
|
- lib/sisimai/rhost/aol.rb
|
196
196
|
- lib/sisimai/rhost/apple.rb
|
197
|
+
- lib/sisimai/rhost/cloudflare.rb
|
197
198
|
- lib/sisimai/rhost/cox.rb
|
198
199
|
- lib/sisimai/rhost/facebook.rb
|
199
200
|
- lib/sisimai/rhost/franceptt.rb
|
@@ -761,6 +762,7 @@ files:
|
|
761
762
|
- set-of-emails/maildir/bsd/rhost-apple-02.eml
|
762
763
|
- set-of-emails/maildir/bsd/rhost-apple-03.eml
|
763
764
|
- set-of-emails/maildir/bsd/rhost-apple-04.eml
|
765
|
+
- set-of-emails/maildir/bsd/rhost-cloudflare-01.eml
|
764
766
|
- set-of-emails/maildir/bsd/rhost-cox-01.eml
|
765
767
|
- set-of-emails/maildir/bsd/rhost-facebook-03.eml
|
766
768
|
- set-of-emails/maildir/bsd/rhost-facebook-04.eml
|