sisimai 4.25.3-java → 4.25.4-java

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 (123) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -0
  4. data/ANALYTICAL-PRECISION +2 -4
  5. data/CONTRIBUTING +4 -0
  6. data/ChangeLog.md +39 -0
  7. data/Developers.mk +1 -72
  8. data/Makefile +4 -0
  9. data/README-JA.md +3 -0
  10. data/README.md +5 -2
  11. data/lib/sisimai.rb +4 -3
  12. data/lib/sisimai/arf.rb +6 -6
  13. data/lib/sisimai/bite.rb +8 -3
  14. data/lib/sisimai/bite/email.rb +7 -50
  15. data/lib/sisimai/bite/json.rb +5 -25
  16. data/lib/sisimai/data.rb +1 -1
  17. data/lib/sisimai/lhost.rb +101 -0
  18. data/lib/sisimai/{bite/email → lhost}/activehunter.rb +10 -10
  19. data/lib/sisimai/{bite/email → lhost}/amavis.rb +9 -9
  20. data/lib/sisimai/lhost/amazonses.rb +403 -0
  21. data/lib/sisimai/{bite/email → lhost}/amazonworkmail.rb +9 -9
  22. data/lib/sisimai/{bite/email → lhost}/aol.rb +10 -10
  23. data/lib/sisimai/{bite/email → lhost}/apachejames.rb +10 -10
  24. data/lib/sisimai/{bite/email → lhost}/bigfoot.rb +9 -9
  25. data/lib/sisimai/{bite/email → lhost}/biglobe.rb +10 -10
  26. data/lib/sisimai/{bite/email → lhost}/courier.rb +10 -10
  27. data/lib/sisimai/{bite/email → lhost}/domino.rb +9 -9
  28. data/lib/sisimai/{bite/email → lhost}/einsundeins.rb +10 -10
  29. data/lib/sisimai/{bite/email → lhost}/exchange2003.rb +9 -9
  30. data/lib/sisimai/{bite/email → lhost}/exchange2007.rb +9 -9
  31. data/lib/sisimai/{bite/email → lhost}/exim.rb +10 -10
  32. data/lib/sisimai/{bite/email → lhost}/ezweb.rb +9 -9
  33. data/lib/sisimai/{bite/email → lhost}/facebook.rb +9 -9
  34. data/lib/sisimai/{bite/email → lhost}/fml.rb +10 -10
  35. data/lib/sisimai/{bite/email → lhost}/gmx.rb +10 -10
  36. data/lib/sisimai/{bite/email → lhost}/google.rb +14 -14
  37. data/lib/sisimai/{bite/email → lhost}/gsuite.rb +10 -10
  38. data/lib/sisimai/{bite/email → lhost}/imailserver.rb +10 -10
  39. data/lib/sisimai/{bite/email → lhost}/interscanmss.rb +9 -9
  40. data/lib/sisimai/{bite/email → lhost}/kddi.rb +10 -10
  41. data/lib/sisimai/{bite/email → lhost}/mailfoundry.rb +9 -9
  42. data/lib/sisimai/{bite/email → lhost}/mailmarshalsmtp.rb +9 -9
  43. data/lib/sisimai/{bite/email → lhost}/mailru.rb +11 -11
  44. data/lib/sisimai/{bite/email → lhost}/mcafee.rb +9 -9
  45. data/lib/sisimai/{bite/email → lhost}/messagelabs.rb +9 -9
  46. data/lib/sisimai/{bite/email → lhost}/messagingserver.rb +9 -9
  47. data/lib/sisimai/{bite/email → lhost}/mfilter.rb +9 -9
  48. data/lib/sisimai/{bite/email → lhost}/mxlogic.rb +10 -10
  49. data/lib/sisimai/{bite/email → lhost}/notes.rb +9 -9
  50. data/lib/sisimai/{bite/email → lhost}/office365.rb +10 -10
  51. data/lib/sisimai/{bite/email → lhost}/opensmtpd.rb +9 -9
  52. data/lib/sisimai/{bite/email → lhost}/outlook.rb +9 -9
  53. data/lib/sisimai/{bite/email → lhost}/postfix.rb +9 -9
  54. data/lib/sisimai/{bite/email → lhost}/qmail.rb +9 -9
  55. data/lib/sisimai/{bite/email → lhost}/receivingses.rb +11 -11
  56. data/lib/sisimai/{bite/email → lhost}/sendgrid.rb +120 -11
  57. data/lib/sisimai/{bite/email → lhost}/sendmail.rb +9 -9
  58. data/lib/sisimai/{bite/email → lhost}/surfcontrol.rb +9 -9
  59. data/lib/sisimai/{bite/email → lhost}/userdefined.rb +9 -9
  60. data/lib/sisimai/{bite/email → lhost}/v5sendmail.rb +10 -10
  61. data/lib/sisimai/{bite/email → lhost}/verizon.rb +11 -11
  62. data/lib/sisimai/{bite/email → lhost}/x1.rb +9 -9
  63. data/lib/sisimai/{bite/email → lhost}/x2.rb +9 -9
  64. data/lib/sisimai/{bite/email → lhost}/x3.rb +9 -9
  65. data/lib/sisimai/{bite/email → lhost}/x4.rb +10 -10
  66. data/lib/sisimai/{bite/email → lhost}/x5.rb +9 -9
  67. data/lib/sisimai/{bite/email → lhost}/yahoo.rb +9 -9
  68. data/lib/sisimai/{bite/email → lhost}/yandex.rb +10 -10
  69. data/lib/sisimai/{bite/email → lhost}/zoho.rb +10 -10
  70. data/lib/sisimai/mda.rb +1 -1
  71. data/lib/sisimai/message.rb +535 -28
  72. data/lib/sisimai/message/email.rb +3 -454
  73. data/lib/sisimai/message/json.rb +3 -177
  74. data/lib/sisimai/order.rb +238 -4
  75. data/lib/sisimai/order/email.rb +5 -190
  76. data/lib/sisimai/order/json.rb +3 -39
  77. data/lib/sisimai/reason.rb +1 -1
  78. data/lib/sisimai/reason/norelaying.rb +1 -1
  79. data/lib/sisimai/reason/userunknown.rb +1 -1
  80. data/lib/sisimai/reason/virusdetected.rb +1 -0
  81. data/lib/sisimai/rfc1894.rb +2 -2
  82. data/lib/sisimai/rfc3464.rb +13 -13
  83. data/lib/sisimai/rfc3834.rb +3 -3
  84. data/lib/sisimai/rfc5322.rb +1 -1
  85. data/lib/sisimai/rhost.rb +5 -4
  86. data/lib/sisimai/rhost/exchangeonline.rb +1 -1
  87. data/lib/sisimai/rhost/franceptt.rb +1 -1
  88. data/lib/sisimai/rhost/godaddy.rb +1 -1
  89. data/lib/sisimai/rhost/iua.rb +39 -0
  90. data/lib/sisimai/version.rb +1 -1
  91. data/set-of-emails/README.md +0 -1
  92. data/set-of-emails/maildir/bsd/email-gsuite-13.eml +261 -0
  93. data/set-of-emails/maildir/bsd/email-postfix-62.eml +105 -0
  94. data/set-of-emails/maildir/bsd/email-postfix-63.eml +85 -0
  95. data/set-of-emails/maildir/bsd/rhost-iua-01.eml +70 -0
  96. metadata +75 -94
  97. data/fig/sisimai-architecture.png +0 -0
  98. data/lib/sisimai/bite/email/amazonses.rb +0 -186
  99. data/lib/sisimai/bite/json/amazonses.rb +0 -242
  100. data/lib/sisimai/bite/json/sendgrid.rb +0 -123
  101. data/set-of-emails/jsonobj/json-amazonses-01.json +0 -1
  102. data/set-of-emails/jsonobj/json-amazonses-02.json +0 -11
  103. data/set-of-emails/jsonobj/json-amazonses-03.json +0 -1
  104. data/set-of-emails/jsonobj/json-amazonses-04.json +0 -1
  105. data/set-of-emails/jsonobj/json-amazonses-05.json +0 -1
  106. data/set-of-emails/jsonobj/json-amazonses-06.json +0 -1
  107. data/set-of-emails/jsonobj/json-sendgrid-01.json +0 -1
  108. data/set-of-emails/jsonobj/json-sendgrid-02.json +0 -1
  109. data/set-of-emails/jsonobj/json-sendgrid-03.json +0 -1
  110. data/set-of-emails/jsonobj/json-sendgrid-04.json +0 -1
  111. data/set-of-emails/jsonobj/json-sendgrid-05.json +0 -1
  112. data/set-of-emails/jsonobj/json-sendgrid-06.json +0 -1
  113. data/set-of-emails/jsonobj/json-sendgrid-07.json +0 -1
  114. data/set-of-emails/jsonobj/json-sendgrid-08.json +0 -1
  115. data/set-of-emails/jsonobj/json-sendgrid-09.json +0 -1
  116. data/set-of-emails/jsonobj/json-sendgrid-10.json +0 -1
  117. data/set-of-emails/jsonobj/json-sendgrid-11.json +0 -1
  118. data/set-of-emails/jsonobj/json-sendgrid-12.json +0 -1
  119. data/set-of-emails/jsonobj/json-sendgrid-13.json +0 -1
  120. data/set-of-emails/jsonobj/json-sendgrid-14.json +0 -1
  121. data/set-of-emails/jsonobj/json-sendgrid-15.json +0 -1
  122. data/set-of-emails/jsonobj/json-sendgrid-16.json +0 -1
  123. data/set-of-emails/jsonobj/json-sendgrid-17.json +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 566f76a60184562c81236ca1ed69414c6ff8f2a5
4
- data.tar.gz: c41f35e8fe6cef2e270ffda60e9a0be0b8815ec2
2
+ SHA256:
3
+ metadata.gz: 0447e075261174ff041771d1f5ad336285e307bb5d2c987a15f6118781910b8b
4
+ data.tar.gz: 6a01a9e3c78c2ef292595552416685bdd08d8cbccfbaf9ba7e5c5ff36b0da487
5
5
  SHA512:
6
- metadata.gz: ef471a4b893dbb3b2123f6792f79c8c6748e63f6efce62149e82a662599de213220b0fc63c0addb5467cb7d5522bcf49b63efaa0b84377f59e29ec34f3334160
7
- data.tar.gz: f052990f00ada0e7880de7f4c1a3830b3440c6ca2f903a04f402dd4a68809620f06837a70afa4edfa41c1f31a7a4f7b87b36c266b04a658b2c9130d73cff4a18
6
+ metadata.gz: 3535a69520e958950a1f450a6e2d1b04131012c8976ac3ae37efda0066edbd6e1943d6687f83be786787bafcd19b5eeab9cc46e4900b4fb3a93489dfe9d0cacb
7
+ data.tar.gz: a324969a25521aca7b227fc0c4846d9b7a9c2246aabf9f562c9871e6cdd2b63ef98c1374f0e2bdc77bcf967c542ad0bea0254daf4ed5e470b5d29f1224448d44
data/.gitignore CHANGED
@@ -8,5 +8,6 @@
8
8
  /sbin
9
9
  /spec/reports/
10
10
  /set-of-emails/private/
11
+ /set-of-emails/obsoleted/
11
12
  /tmp/
12
13
  .rubocop_todo.yml
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ # See http://rubies.travis-ci.org for Precompiled Ruby Versions
3
4
  - 2.1.1
4
5
  - 2.2.4
5
6
  - 2.3.0
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 1570/2630 0.5970
62
- Sisimai 4.25.3 2630/2630 1.0000
59
+ bounceHammer 2.7.13p3 1523/2569 0.5928
60
+ Sisimai 4.25.3p2 2569/2569 1.0000
data/CONTRIBUTING ADDED
@@ -0,0 +1,4 @@
1
+ CONTRIBUTING
2
+ ===============================================================================
3
+
4
+
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)/Bite/Email
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
@@ -59,6 +59,10 @@ release:
59
59
 
60
60
  test: cruby-test
61
61
 
62
+ check:
63
+ find lib -type f -exec grep --color -E ' $$' {} /dev/null \;
64
+ find lib -type f -exec grep --color -E '[;][ ]*$$' {} /dev/null \;
65
+
62
66
  cruby-test:
63
67
  $(RAKE) spec
64
68
 
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 Sisimai 4.20.0 or
170
- later.
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[Bite::Email Bite::JSON ARF RFC3464 RFC3834].each do |e|
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.start_with?('Bite::Email', 'Bite::JSON')
133
- # Sisimai::Bite::Email or Sisimai::Bite::JSON
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/bite/email'
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::Bite::Email.INDICATORS
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 scan(mhead, mbody)
79
+ def make(mhead, mbody)
80
80
  return nil unless self.is_arf(mhead)
81
81
 
82
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
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::Bite.DELIVERYSTATUS
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/rfc5322'
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 = ''); return v.to_s.sub(/\ASisimai::Bite::/, ''); end
32
- def description; return ''; end
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
@@ -1,59 +1,16 @@
1
- module Sisimai
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/bite'
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
@@ -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/bite'
8
-
9
- def headerlist; return []; end
10
-
11
- # MTA list
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