sisimai 4.25.3 → 4.25.4
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 +5 -5
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/ANALYTICAL-PRECISION +2 -4
- data/CONTRIBUTING +4 -0
- data/ChangeLog.md +39 -0
- data/Developers.mk +1 -72
- data/Makefile +4 -0
- data/README-JA.md +3 -0
- data/README.md +5 -2
- data/lib/sisimai.rb +4 -3
- data/lib/sisimai/arf.rb +6 -6
- data/lib/sisimai/bite.rb +8 -3
- data/lib/sisimai/bite/email.rb +7 -50
- data/lib/sisimai/bite/json.rb +5 -25
- data/lib/sisimai/data.rb +1 -1
- data/lib/sisimai/lhost.rb +101 -0
- data/lib/sisimai/{bite/email → lhost}/activehunter.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/amavis.rb +9 -9
- data/lib/sisimai/lhost/amazonses.rb +403 -0
- data/lib/sisimai/{bite/email → lhost}/amazonworkmail.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/aol.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/apachejames.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/bigfoot.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/biglobe.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/courier.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/domino.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/einsundeins.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/exchange2003.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/exchange2007.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/exim.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/ezweb.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/facebook.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/fml.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/gmx.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/google.rb +14 -14
- data/lib/sisimai/{bite/email → lhost}/gsuite.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/imailserver.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/interscanmss.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/kddi.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/mailfoundry.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/mailmarshalsmtp.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/mailru.rb +11 -11
- data/lib/sisimai/{bite/email → lhost}/mcafee.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/messagelabs.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/messagingserver.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/mfilter.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/mxlogic.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/notes.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/office365.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/opensmtpd.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/outlook.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/postfix.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/qmail.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/receivingses.rb +11 -11
- data/lib/sisimai/{bite/email → lhost}/sendgrid.rb +120 -11
- data/lib/sisimai/{bite/email → lhost}/sendmail.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/surfcontrol.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/userdefined.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/v5sendmail.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/verizon.rb +11 -11
- data/lib/sisimai/{bite/email → lhost}/x1.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/x2.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/x3.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/x4.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/x5.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/yahoo.rb +9 -9
- data/lib/sisimai/{bite/email → lhost}/yandex.rb +10 -10
- data/lib/sisimai/{bite/email → lhost}/zoho.rb +10 -10
- data/lib/sisimai/mda.rb +1 -1
- data/lib/sisimai/message.rb +535 -28
- data/lib/sisimai/message/email.rb +3 -454
- data/lib/sisimai/message/json.rb +3 -177
- data/lib/sisimai/order.rb +238 -4
- data/lib/sisimai/order/email.rb +5 -190
- data/lib/sisimai/order/json.rb +3 -39
- data/lib/sisimai/reason.rb +1 -1
- data/lib/sisimai/reason/norelaying.rb +1 -1
- data/lib/sisimai/reason/userunknown.rb +1 -1
- data/lib/sisimai/reason/virusdetected.rb +1 -0
- data/lib/sisimai/rfc1894.rb +2 -2
- data/lib/sisimai/rfc3464.rb +13 -13
- data/lib/sisimai/rfc3834.rb +3 -3
- data/lib/sisimai/rfc5322.rb +1 -1
- data/lib/sisimai/rhost.rb +5 -4
- data/lib/sisimai/rhost/exchangeonline.rb +1 -1
- data/lib/sisimai/rhost/franceptt.rb +1 -1
- data/lib/sisimai/rhost/godaddy.rb +1 -1
- data/lib/sisimai/rhost/iua.rb +39 -0
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/README.md +0 -1
- data/set-of-emails/maildir/bsd/email-gsuite-13.eml +261 -0
- data/set-of-emails/maildir/bsd/email-postfix-62.eml +105 -0
- data/set-of-emails/maildir/bsd/email-postfix-63.eml +85 -0
- data/set-of-emails/maildir/bsd/rhost-iua-01.eml +70 -0
- metadata +62 -82
- data/fig/sisimai-architecture.png +0 -0
- data/lib/sisimai/bite/email/amazonses.rb +0 -186
- data/lib/sisimai/bite/json/amazonses.rb +0 -242
- data/lib/sisimai/bite/json/sendgrid.rb +0 -123
- data/set-of-emails/jsonobj/json-amazonses-01.json +0 -1
- data/set-of-emails/jsonobj/json-amazonses-02.json +0 -11
- data/set-of-emails/jsonobj/json-amazonses-03.json +0 -1
- data/set-of-emails/jsonobj/json-amazonses-04.json +0 -1
- data/set-of-emails/jsonobj/json-amazonses-05.json +0 -1
- data/set-of-emails/jsonobj/json-amazonses-06.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-01.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-02.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-03.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-04.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-05.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-06.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-07.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-08.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-09.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-10.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-11.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-12.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-13.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-14.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-15.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-16.json +0 -1
- data/set-of-emails/jsonobj/json-sendgrid-17.json +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1ae7efed62436e79f66169f4330363ee5a29da001d3c27116d482691c52b41a6
|
4
|
+
data.tar.gz: acabb1f0447f1f077bafb00bff61184e124fe6dffc0c3333f1cb192e8c7eaf9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec06a3be887143a9d0d0cdd33ae5616003127ec4f2d9d49cfdc85d201f858f4bf43f1ef18be267ee36f39d6974dde414a884d78b200d81f5d9fcfbb3cfb678b
|
7
|
+
data.tar.gz: 98f96ff3685f168e7f3012ba157421d2a79fc1e35adc46da9f69eb0061717fba2bd171b7eca301b5c182746486b3bedd6c2346af0dbe66fc55fd6d86e95e8dde
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/ANALYTICAL-PRECISION
CHANGED
@@ -52,11 +52,9 @@ Email::Yandex ........... 4/0007 0.5714 Yandex.Mail: http://www.yandex.ru
|
|
52
52
|
Email::Zoho ............. 0/0011 0.0000 Zoho Mail: https://www.zoho.com
|
53
53
|
Email::mFILTER .......... 0/0012 0.0000 Digital Arts m-FILTER
|
54
54
|
Email::qmail ............ 58/0087 0.6667 qmail
|
55
|
-
JSON::AmazonSES ......... 40/0049 0.8163 Amazon SES(JSON): http://aws.amazon.com/ses/
|
56
|
-
JSON::SendGrid .......... 7/0012 0.5833 SendGrid(JSON): http://sendgrid.com/
|
57
55
|
ARF ..................... 8/0038 0.2105 Abuse Feedback Reporting Format
|
58
56
|
RFC3464 ................. 151/0322 0.4689 Fallback Module for MTAs
|
59
57
|
RFC3834 ................. 0/0014 0.0000 Detector for auto replied message
|
60
58
|
--------------------------------------------------------------------------------
|
61
|
-
bounceHammer 2.7.13p3
|
62
|
-
Sisimai 4.25.
|
59
|
+
bounceHammer 2.7.13p3 1523/2569 0.5928
|
60
|
+
Sisimai 4.25.3p2 2569/2569 1.0000
|
data/CONTRIBUTING
ADDED
data/ChangeLog.md
CHANGED
@@ -3,6 +3,45 @@ 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
|
+
v4.25.4
|
7
|
+
--------------------------------------------------------------------------------
|
8
|
+
- release: "Tue, 3 Dec 2019 12:34:45 +0900 (JST)"
|
9
|
+
- version: "4.25.4"
|
10
|
+
- changes:
|
11
|
+
- #152 **THE ABILITY TO READ JSON STRING AS AN INPUT SOURCE AND TO PARSE JSON
|
12
|
+
FORMATTED BOUNCE MESSAGE WILL NOT BE SUPPORTED AT Sisimai 4.25.5**
|
13
|
+
- **The following modules for reading json string as an input source, and for
|
14
|
+
parsing json formatted bounce message will be removed at Sisimai 4.25.5**
|
15
|
+
- `Sisimai::Message::JSON`
|
16
|
+
- `Sisimai::Bite::JSON`
|
17
|
+
- `Sisimai::Bite::JSON::AmazonSES`
|
18
|
+
- `Sisimai::Bite::JSON::SendGrid`
|
19
|
+
- `Sisimai::Order::JSON`
|
20
|
+
- Implement a new MTA module class `Sisimai::Lhost`, it is a parent class of
|
21
|
+
all the MTA modules for a bounce mail returned as an email message via SMTP
|
22
|
+
and **THE FOLLOWING NAME SPACES WERE MARKED AS OBSOLETED OR REMOVED** #153
|
23
|
+
- `Sisimai::Bite`: Use `Sisimai::Lhost` instead
|
24
|
+
- `Sisimai::Bite::Email`: Merged into `Sisimai::Lhost`
|
25
|
+
- `Sisimai::Bite::Email::*`: Moved under `Sisimai::Lhost` as the same named
|
26
|
+
MTA module
|
27
|
+
- The following modules were marked as obsoleted, will be removed and merged
|
28
|
+
into each parent class
|
29
|
+
- `Sisimai::Message::Email`
|
30
|
+
- `Sisimai::Order::Email`
|
31
|
+
- USAGE AND PARAMETERS FOR THE FOLLOWING METHODS HAVE NOT BEEN CHANGED AT ALL
|
32
|
+
AND WILL NOT BE CHANGED AFTER Sisimai 4.25.5
|
33
|
+
- `Sisimai.make`
|
34
|
+
- `Sisimai.dump`
|
35
|
+
- `Sisimai::Message.new`
|
36
|
+
- Implement `Sisimai::Rhost::IUA` for SMTP error codes at https://www.i.ua/.
|
37
|
+
- Update error message pattern for ClamSMTP at "virusdetected" reason.
|
38
|
+
- Fix an indicator string for detecting the beginning of the original message
|
39
|
+
part at `Sisimai::Bite::Email::MFILTER`
|
40
|
+
- Multibyte characters in the original subject header will not be removed and
|
41
|
+
replaced with "MULTIBYTE CHARACTERS HAS BEEN REMOVED"
|
42
|
+
- Error message `... had no relevant answers.` from GSuite is classified into
|
43
|
+
"networkerror" reason.
|
44
|
+
|
6
45
|
v4.25.3
|
7
46
|
--------------------------------------------------------------------------------
|
8
47
|
- release: ""Sat, 7 Sep 2019 15:00:22 +0900 (JST)
|
data/Developers.mk
CHANGED
@@ -15,27 +15,17 @@ LS := ls -1
|
|
15
15
|
CP := cp
|
16
16
|
RM := rm -f
|
17
17
|
|
18
|
-
THELASTBHVER := 2.7.13p3
|
19
|
-
BOUNCEHAMMER := /usr/local/bouncehammer
|
20
|
-
MBOXPARSERV0 := $(BOUNCEHAMMER)/bin/mailboxparser -T
|
21
18
|
PERL5SISIMAI := p5-Sisimai
|
22
19
|
PRECISIONTAB := ANALYTICAL-PRECISION
|
23
20
|
PARSERLOGDIR := tmp/parser-logs
|
24
|
-
MAILCLASSDIR := lib/$(NAME)/
|
25
|
-
JSONCLASSDIR := lib/$(NAME)/Bite/JSON
|
21
|
+
MAILCLASSDIR := lib/$(NAME)/Lhost
|
26
22
|
MTARELATIVES := ARF rfc3464 rfc3834
|
27
|
-
|
28
23
|
BENCHMARKDIR := tmp/benchmark
|
29
|
-
PRECISIONDIR := tmp/emails-for-precision
|
30
|
-
COMPARINGDIR := tmp/emails-for-comparing
|
31
|
-
|
32
24
|
PARSERSCRIPT := $(RUBY) sbin/emparser --delivered
|
33
25
|
RELEASEVERMP := $(RUBY) -rsisimai
|
34
26
|
DEVELOPVERMP := $(RUBY) -I./lib -rsisimai
|
35
27
|
HOWMANYMAILS := $(DEVELOPVERMP) -e 'print Sisimai.make($$*.shift, delivered: true).size' $(COMPARINGDIR)
|
36
|
-
|
37
28
|
BENCHMARKEMP := sbin/mp
|
38
|
-
|
39
29
|
SET_OF_EMAIL := set-of-emails
|
40
30
|
PRIVATEMAILS := $(SET_OF_EMAIL)/private
|
41
31
|
PUBLICEMAILS := $(SET_OF_EMAIL)/maildir/bsd
|
@@ -55,11 +45,6 @@ private-sample:
|
|
55
45
|
$(RM) -r ./$(PRIVATEMAILS)
|
56
46
|
$(CP) -vRp ../$(PERL5SISIMAI)/$(PRIVATEMAILS) $(SET_OF_EMAIL)
|
57
47
|
|
58
|
-
precision-table:
|
59
|
-
cat ../$(PERL5SISIMAI)/$(PRECISIONTAB) | sed \
|
60
|
-
-e 's/Email::qmail/Email::Qmail/g' \
|
61
|
-
-e 's/Email::mFILTER/Email::MFILTER/g' > $(PRECISIONTAB)
|
62
|
-
|
63
48
|
update-other-format-emails:
|
64
49
|
for v in `find $(PUBLICEMAILS) -name '*-01.eml' -type f`; do \
|
65
50
|
f="`basename $$v`" ;\
|
@@ -67,62 +52,6 @@ update-other-format-emails:
|
|
67
52
|
nkf -Lm $$v > $(MACFORMATSET)/$$f ;\
|
68
53
|
done
|
69
54
|
|
70
|
-
emails-for-precision:
|
71
|
-
@ for v in `$(LS) ./$(MAILCLASSDIR)/*.rb | grep -v userdefined`; do \
|
72
|
-
MTA=`echo $$v | cut -d/ -f6 | tr '[A-Z]' '[a-z]' | sed 's/.rb//g'` ;\
|
73
|
-
$(MKDIR) $(PRECISIONDIR)/email-$$MTA ;\
|
74
|
-
$(CP) $(PUBLICEMAILS)/email-$$MTA-*.eml $(PRECISIONDIR)/email-$$MTA/ ;\
|
75
|
-
$(CP) $(PRIVATEMAILS)/email-$$MTA/* $(PRECISIONDIR)/email-$$MTA/ ;\
|
76
|
-
done
|
77
|
-
@ for v in arf rfc3464 rfc3834; do \
|
78
|
-
$(MKDIR) $(PRECISIONDIR)/$$v ;\
|
79
|
-
$(CP) $(PUBLICEMAILS)/$$v*.eml $(PRECISIONDIR)/$$v/ ;\
|
80
|
-
$(CP) $(PRIVATEMAILS)/$$v/* $(PRECISIONDIR)/$$v/ ;\
|
81
|
-
done
|
82
|
-
|
83
|
-
emails-for-comparing:
|
84
|
-
@ rm -fr ./$(COMPARINGDIR)
|
85
|
-
@ $(MKDIR) $(COMPARINGDIR)
|
86
|
-
@ for v in $(BH_CAN_PARSE); do \
|
87
|
-
$(CP) $(PUBLICEMAILS)/email-`echo $$v | tr '[A-Z]' '[a-z]'`-*.eml $(COMPARINGDIR)/; \
|
88
|
-
test -d $(PRIVATEEMAILS) && $(CP) $(PRIVATEMAILS)/email-`echo $$v | tr '[A-Z]' '[a-z]'`/*.eml $(COMPARINGDIR)/; \
|
89
|
-
done
|
90
|
-
|
91
|
-
comparison: emails-for-comparing
|
92
|
-
@ echo -------------------------------------------------------------------
|
93
|
-
@ echo `$(HOWMANYMAILS)` emails in $(COMPARINGDIR)
|
94
|
-
@ echo -n 'Calculating the velocity of parsing 1000 mails: multiply by '
|
95
|
-
@ echo "scale=6; 1000 / `$(HOWMANYMAILS)`" | bc
|
96
|
-
@ echo -------------------------------------------------------------------
|
97
|
-
@ uptime
|
98
|
-
@ echo -------------------------------------------------------------------
|
99
|
-
@ if [ -x "$(BOUNCEHAMMER)/bin/mailboxparser" ]; then \
|
100
|
-
echo bounceHammer $(THELASTBHVER); \
|
101
|
-
n=1; while [ $$n -le 5 ]; do \
|
102
|
-
/usr/bin/time $(MBOXPARSERV0) -Fjson $(COMPARINGDIR) > /dev/null ;\
|
103
|
-
sleep 1; \
|
104
|
-
n=`expr $$n + 1`; \
|
105
|
-
done; \
|
106
|
-
echo -------------------------------------------------------------------; \
|
107
|
-
fi
|
108
|
-
@ echo 'Sisimai' `$(RELEASEVERMP) -e 'puts Sisimai.version'` $(RELEASEVERMP)
|
109
|
-
@ n=1; while [ $$n -le 5 ]; do \
|
110
|
-
/usr/bin/time $(RELEASEVERMP) -e 'Sisimai.make($$*.shift, deliverd: true)' $(COMPARINGDIR) > /dev/null ;\
|
111
|
-
sleep 1; \
|
112
|
-
n=`expr $$n + 1`; \
|
113
|
-
done
|
114
|
-
@ echo -------------------------------------------------------------------
|
115
|
-
@ echo 'Sisimai' `$(DEVELOPVERMP) -e 'puts Sisimai.version'` $(DEVELOPVERMP)
|
116
|
-
@ n=1; while [ $$n -le 5 ]; do \
|
117
|
-
/usr/bin/time $(DEVELOPVERMP) -e 'Sisimai.make($$*.shift, deliverd: true)' $(COMPARINGDIR) > /dev/null ;\
|
118
|
-
sleep 1; \
|
119
|
-
n=`expr $$n + 1`; \
|
120
|
-
done
|
121
|
-
@ echo -------------------------------------------------------------------
|
122
|
-
|
123
55
|
clean:
|
124
|
-
$(RM) -r ./$(PRECISIONDIR)
|
125
56
|
$(RM) -r ./$(BENCHMARKDIR)
|
126
|
-
$(RM) -f tmp/subject-list tmp/senders-list
|
127
|
-
|
128
57
|
|
data/Makefile
CHANGED
data/README-JA.md
CHANGED
@@ -57,6 +57,7 @@ Key features
|
|
57
57
|
* 29種類のMTAに対応
|
58
58
|
* 22種類の著名なMSPに対応
|
59
59
|
* 2種類の著名なメール配信クラウドに対応(JSON)
|
60
|
+
* **Sisimai 4.25.5で削除予定**
|
60
61
|
* Feedback Loopにも対応
|
61
62
|
* 29種類のエラー理由を検出
|
62
63
|
|
@@ -160,6 +161,8 @@ puts Sisimai.dump('/path/to/mbox', delivered: true)
|
|
160
161
|
|
161
162
|
Read bounce object
|
162
163
|
-------------------------------------------------------------------------------
|
164
|
+
**この機能はSisimai 4.25.5で削除されます**
|
165
|
+
|
163
166
|
メール配信クラウドからAPIで取得したバウンスオブジェクト(JSON)を読んで解析する
|
164
167
|
場合は、次のようなコードを書いてください。この機能はSisimai v4.20.0で実装され
|
165
168
|
ました。
|
data/README.md
CHANGED
@@ -56,6 +56,7 @@ Key Features
|
|
56
56
|
* Support 24 known MTAs and 5 unknown MTAs
|
57
57
|
* Support 22 major MSPs(Mail Service Providers)
|
58
58
|
* Support 2 major Cloud Email Delivery Services(JSON format)
|
59
|
+
* **WILL BE REMOVED AT Sisimai 4.25.5**
|
59
60
|
* Support Feedback Loop Message(ARF)
|
60
61
|
* Can detect 29 error reasons
|
61
62
|
|
@@ -165,9 +166,11 @@ puts Sisimai.dump('/path/to/mbox', delivered: true)
|
|
165
166
|
|
166
167
|
Read bounce object
|
167
168
|
-------------------------------------------------------------------------------
|
169
|
+
**THIS FEATURE WILL BE REMOVED AT SISIMAI 4.25.5**
|
170
|
+
|
168
171
|
The way to read a bounce object retrived from Cloud Email Services as JSON using
|
169
|
-
their API is the following code. This feature is available at
|
170
|
-
|
172
|
+
their API is the following code. This feature is available at between v4.20.0
|
173
|
+
and **v4.25.5**.
|
171
174
|
|
172
175
|
```ruby
|
173
176
|
#! /usr/bin/env ruby
|
data/lib/sisimai.rb
CHANGED
@@ -66,6 +66,7 @@ module Sisimai
|
|
66
66
|
|
67
67
|
elsif input == 'json'
|
68
68
|
# Decoded JSON object: 'input' => 'json'
|
69
|
+
warn ' ***warning: input: "json" is marked as obsoleted'
|
69
70
|
type = argv0.class.to_s
|
70
71
|
list = []
|
71
72
|
|
@@ -125,12 +126,12 @@ module Sisimai
|
|
125
126
|
def engine
|
126
127
|
table = {}
|
127
128
|
|
128
|
-
%w[
|
129
|
+
%w[Lhost ARF RFC3464 RFC3834].each do |e|
|
129
130
|
r = 'Sisimai::' << e
|
130
131
|
require r.gsub('::', '/').downcase
|
131
132
|
|
132
|
-
if e
|
133
|
-
# Sisimai::
|
133
|
+
if e == 'Lhost'
|
134
|
+
# Sisimai::Lhost::*
|
134
135
|
Module.const_get(r).send(:index).each do |ee|
|
135
136
|
# Load and get the value of "description" from each module
|
136
137
|
rr = 'Sisimai::' << e + '::' << ee
|
data/lib/sisimai/arf.rb
CHANGED
@@ -3,7 +3,7 @@ module Sisimai
|
|
3
3
|
module ARF
|
4
4
|
# Imported from p5-Sisimail/lib/Sisimai/ARF.pm
|
5
5
|
class << self
|
6
|
-
require 'sisimai/
|
6
|
+
require 'sisimai/lhost'
|
7
7
|
require 'sisimai/rfc5322'
|
8
8
|
|
9
9
|
# http://tools.ietf.org/html/rfc5965
|
@@ -13,7 +13,7 @@ module Sisimai
|
|
13
13
|
# Netease DMARC uses: This is a spf/dkim authentication-failure report for an email message received from IP
|
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
|
-
Indicators = Sisimai::
|
16
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
17
17
|
StartingOf = { rfc822: ['Content-Type: message/rfc822', 'Content-Type: text/rfc822-headers'] }.freeze
|
18
18
|
MarkingsOf = {
|
19
19
|
message: %r{\A(?>
|
@@ -76,10 +76,10 @@ module Sisimai
|
|
76
76
|
# @return [Hash, Nil] Bounce data list and message/rfc822 part
|
77
77
|
# or nil if it failed to parse or the
|
78
78
|
# arguments are missing
|
79
|
-
def
|
79
|
+
def make(mhead, mbody)
|
80
80
|
return nil unless self.is_arf(mhead)
|
81
81
|
|
82
|
-
dscontents = [Sisimai::
|
82
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
83
83
|
hasdivided = mbody.split("\n")
|
84
84
|
rfc822part = '' # (String) message/rfc822-headers part
|
85
85
|
previousfn = '' # (String) Previous field name
|
@@ -195,7 +195,7 @@ module Sisimai
|
|
195
195
|
# Redacted-Address: localpart@
|
196
196
|
if v['recipient']
|
197
197
|
# There are multiple recipient addresses in the message body.
|
198
|
-
dscontents << Sisimai::
|
198
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
199
199
|
v = dscontents[-1]
|
200
200
|
end
|
201
201
|
v['recipient'] = Sisimai::Address.s3s4(cv[1])
|
@@ -278,7 +278,7 @@ module Sisimai
|
|
278
278
|
if cv = mhead['subject'].match(/complaint about message from (\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3})/)
|
279
279
|
# Microsoft ARF: remote host address.
|
280
280
|
arfheaders['rhost'] = cv[1]
|
281
|
-
commondata['diagnosis'] =
|
281
|
+
commondata['diagnosis'] =
|
282
282
|
'This is a Microsoft email abuse report for an email message received from IP' << arfheaders['rhost'] + ' on ' << mhead['date']
|
283
283
|
end
|
284
284
|
|
data/lib/sisimai/bite.rb
CHANGED
@@ -3,12 +3,13 @@ module Sisimai
|
|
3
3
|
module Bite
|
4
4
|
class << self
|
5
5
|
# Imported from p5-Sisimail/lib/Sisimai/Bite.pm
|
6
|
-
require 'sisimai/
|
6
|
+
require 'sisimai/lhost'
|
7
7
|
|
8
8
|
# Data structure for parsed bounce messages
|
9
9
|
# @return [Hash] Data structure for delivery status
|
10
10
|
# @private
|
11
11
|
def DELIVERYSTATUS
|
12
|
+
Sisimai::Lhost.warn
|
12
13
|
return {
|
13
14
|
'spec' => nil, # Protocl specification
|
14
15
|
'date' => nil, # The value of Last-Attempt-Date header
|
@@ -28,8 +29,12 @@ module Sisimai
|
|
28
29
|
}
|
29
30
|
end
|
30
31
|
|
31
|
-
def smtpagent(v = '')
|
32
|
-
|
32
|
+
def smtpagent(v = '')
|
33
|
+
Sisimai::Lhost.warn(self.name)
|
34
|
+
return v.to_s.sub(/\ASisimai::Bite::/, '')
|
35
|
+
end
|
36
|
+
|
37
|
+
def description; Sisimai::Lhost.warn; return ''; end
|
33
38
|
end
|
34
39
|
end
|
35
40
|
end
|
data/lib/sisimai/bite/email.rb
CHANGED
@@ -1,59 +1,16 @@
|
|
1
|
-
|
1
|
+
module Sisimai
|
2
2
|
module Bite
|
3
3
|
# Sisimai::Bite::Email- Base class for Sisimai::Bite::Email::*
|
4
4
|
module Email
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email.pm
|
7
|
-
require 'sisimai/
|
8
|
-
|
9
|
-
# @abstract Flags for position variable
|
10
|
-
# @return [Hash] Position flag data
|
11
|
-
# @private
|
12
|
-
def INDICATORS
|
13
|
-
return {
|
14
|
-
:'deliverystatus' => (1 << 1),
|
15
|
-
:'message-rfc822' => (1 << 2),
|
16
|
-
}
|
17
|
-
end
|
18
|
-
def headerlist; return []; end
|
19
|
-
|
20
|
-
# @abstract MTA list
|
21
|
-
# @return [Array] MTA list with order
|
22
|
-
def index
|
23
|
-
return %w[
|
24
|
-
Sendmail Postfix Qmail Exim Courier OpenSMTPD Office365 Outlook
|
25
|
-
Exchange2007 Exchange2003 Yahoo GSuite Aol SendGrid AmazonSES MailRu
|
26
|
-
Yandex MessagingServer Domino Notes ReceivingSES AmazonWorkMail Verizon
|
27
|
-
GMX Bigfoot Facebook Zoho EinsUndEins MessageLabs EZweb KDDI Biglobe
|
28
|
-
Amavis ApacheJames McAfee MXLogic MailFoundry IMailServer
|
29
|
-
MFILTER Activehunter InterScanMSS SurfControl MailMarshalSMTP
|
30
|
-
X1 X2 X3 X4 X5 V5sendmail FML Google]
|
31
|
-
end
|
32
|
-
|
33
|
-
# @abstract MTA list which have one or more extra headers
|
34
|
-
# @return [Array] MTA list (have extra headers)
|
35
|
-
def heads
|
36
|
-
return %w[
|
37
|
-
Exim Office365 Outlook Exchange2007 Exchange2003 GSuite SendGrid
|
38
|
-
AmazonSES ReceivingSES AmazonWorkMail Aol GMX MailRu MessageLabs Yahoo
|
39
|
-
Yandex Zoho EinsUndEins MXLogic McAfee MFILTER EZweb Activehunter IMailServer
|
40
|
-
SurfControl FML Google
|
41
|
-
]
|
42
|
-
end
|
43
|
-
|
44
|
-
# @abstract Parse bounce messages
|
45
|
-
# @param [Hash] mhead Message header of a bounce email
|
46
|
-
# @options mhead [String] from From header
|
47
|
-
# @options mhead [String] date Date header
|
48
|
-
# @options mhead [String] subject Subject header
|
49
|
-
# @options mhead [Array] received Received headers
|
50
|
-
# @options mhead [String] others Other required headers
|
51
|
-
# @param [String] mbody Message body of a bounce email
|
52
|
-
# @return [Hash, Nil] Bounce data list and message/rfc822
|
53
|
-
# part or nil if it failed to parse or
|
54
|
-
# the arguments are missing
|
55
|
-
def scan; return nil; end
|
7
|
+
require 'sisimai/lhost'
|
56
8
|
|
9
|
+
def INDICATORS; Sisimai::Lhost.warn; return Sisimai::Lhost.INDICATORS; end
|
10
|
+
def headerlist; Sisimai::Lhost.warn; return Sisimai::Lhost.headerlist; end
|
11
|
+
def index; Sisimai::Lhost.warn; return Sisimai::Lhost.index; end
|
12
|
+
def heads; Sisimai::Lhost.warn; return Sisimai::Lhost.heads; end
|
13
|
+
def scan; Sisimai::Lhost.warn('make'); return Sisimai::Lhost.make; end
|
57
14
|
end
|
58
15
|
end
|
59
16
|
end
|
data/lib/sisimai/bite/json.rb
CHANGED
@@ -4,31 +4,11 @@ module Sisimai
|
|
4
4
|
module JSON
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/JSON.pm
|
7
|
-
require 'sisimai/
|
8
|
-
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
# @return [Array] MTA list with order
|
13
|
-
def index
|
14
|
-
return %w[SendGrid AmazonSES]
|
15
|
-
end
|
16
|
-
|
17
|
-
# Convert from JSON object to Sisimai::Message
|
18
|
-
# @param [Hash] mhead Message header of a bounce email
|
19
|
-
# @param [String] mbody Message body of a bounce email(JSON)
|
20
|
-
# @return [Hash, Nil] Bounce data list and message/rfc822 part
|
21
|
-
# or nil if it failed to parse or the
|
22
|
-
# arguments are missing
|
23
|
-
def scan; return nil; end
|
24
|
-
|
25
|
-
# @abstract Adapt bounce object for Sisimai::Message format
|
26
|
-
# @param [Hash] argvs bounce object returned from each email cloud
|
27
|
-
# @return [Hash, Nil] Bounce data list and message/rfc822 part
|
28
|
-
# or nil if it failed to parse or the
|
29
|
-
# arguments are missing
|
30
|
-
def adapt; return nil; end
|
31
|
-
|
7
|
+
require 'sisimai/lhost'
|
8
|
+
def INDICATORS; Sisimai::Lhost.warn('gone'); return Sisimai::Lhost.INDICATORS; end
|
9
|
+
def index; Sisimai::Lhost.warn('gone'); return Sisimai::Lhost.index; end
|
10
|
+
def scan; Sisimai::Lhost.warn('gone'); return Sisimai::Lhost.make; end
|
11
|
+
def adapt; Sisimai::Lhost.warn('gone'); return nil; end
|
32
12
|
end
|
33
13
|
end
|
34
14
|
end
|