sisimai 4.20.2 → 4.21.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ae65a92e8ce97f94a3a2e9d49afac7daf4dd616
4
- data.tar.gz: ac6fb8541ef2fcdfb931fb144ff6fcb6eab19774
3
+ metadata.gz: 2046eb91d0583931b210c5bd0e6aa6bdc504a366
4
+ data.tar.gz: 55aa06f4bc74998520e90f7271c998d54a55b605
5
5
  SHA512:
6
- metadata.gz: 2ccd7a6266707802d83a0ad80c9e76e27660a93210c20620a0b9f641b9d5d0e2bc72560f1934b89c641e0ba9b1ab081eaa101d8289966a46db9da100d63b692f
7
- data.tar.gz: bec6463ca315a9eae480c1302f1d7227c4dc8c389e911a65f2634c4cf1f7de5efd6ae8df94557d192714fb60eb9c303f5e7ece6519d7b8e42a7cfc981eb81e39
6
+ metadata.gz: 3f2b4f015f99be61210bc1e0831588a3239a993f8bd77843f0f6b1a0167016cae1986e6eef7a816937417cc83821990ed68e592e30f4779df710a4878f8639af
7
+ data.tar.gz: 319b32e062689516bb4c8caed1012b244dd3187bdb04ea7ae9746a0e90f9bad07d554c476014365332ee50da52b7b1777a4c6af5b605a437d7a4f76c7c34f179
data/Changes CHANGED
@@ -1,5 +1,19 @@
1
1
  Revision history for the Ruby version of Sisimai
2
2
 
3
+ 4.21.0 Mon, 10 Apr 2017 12:17:22 +0900 (JST)
4
+ - Experimental implementation: new MTA module "Sisimai::MSP::US::GSuite" to
5
+ parse bounce mails returned from G Suite.
6
+ - Sisimai.make and Sisimai::Message.new methods check "field" argument more
7
+ strictly.
8
+ - Improved Sisimai::SMTP::Status.find(). The method checks whether a found
9
+ value as D.S.N. is IPv4 address or not.
10
+ - Improved code for getting error messages, D.S.N. values, and SMTP reply
11
+ codes in Sisimai::MTA::Postfix.scan() method.
12
+ - Pull-Request #69, Fix some typos. Thanks to @koic.
13
+ - Pull-Request #71, Fix break statement. Thanks to @MichiakiNakaya.
14
+ - Issue #70, All the value of $PATH in Makefile have been fixed to build a
15
+ gem file for JRuby Platform. Thanks to @MichiakiNakaya, @hiroyuki-sato.
16
+
3
17
  4.20.2 Sat, 11 Mar 2017 16:32:48 +0900 (JST)
4
18
  - Pull-Request #63 Add some error message patterns from Amazon SES SMTP
5
19
  endpoint.
@@ -105,7 +119,7 @@ Revision history for the Ruby version of Sisimai
105
119
  - Implement new MTA/MSP module "Sisimai::MSP::US::Office365" to parse error
106
120
  mails via Microsoft Office 365. The module, test codes, and sample emails
107
121
  are imported from https://github.com/sisimai/p5-Sisimai/pull/164.
108
- - New method Sisimai::Address#to_s to get a email address as String, it is
122
+ - New method Sisimai::Address#to_s to get an email address as String, it is
109
123
  implemented at pull-request #39. Thanks to @hiroyuki-sato.
110
124
  - Almost all of the class variables are removed for resolving issue #40 and
111
125
  merged pull-request #43, thanks to @hiroyuki-sato.
data/Makefile CHANGED
@@ -27,38 +27,43 @@ REPOS_TARGETS = git-status git-push git-commit-amend git-tag-list git-diff \
27
27
  depend:
28
28
  gem install $(DEPENDENCIES)
29
29
  if [ test -d "$(JRUBY)" ]; then \
30
- PATH="$$PATH:$(JRUBY)/bin" $(JRUBY)/bin/gem install $(DEPENDENCIES); \
30
+ PATH="$(JRUBY)/bin:$$PATH" $(JRUBY)/bin/gem install $(DEPENDENCIES); \
31
31
  fi
32
32
 
33
33
  install-from-rubygems:
34
34
  gem install $(NAME)
35
35
  if [ test -d "$(JRUBY)" ]; then \
36
- PATH="$$PATH:$(JRUBY)/bin" $(JRUBY)/bin/gem install $(NAME); \
36
+ PATH="$(JRUBY)/bin:$$PATH" $(JRUBY)/bin/gem install $(NAME); \
37
37
  fi
38
38
 
39
39
  install-from-local:
40
40
  $(RAKE) install
41
41
  if [ test -d "$(JRUBY)" ]; then \
42
- PATH="$$PATH:$(JRUBY)/bin" $(JRUBY)/bin/rake install; \
42
+ PATH="$(JRUBY)/bin:$$PATH" $(JRUBY)/bin/rake install; \
43
43
  fi
44
44
 
45
45
  build:
46
46
  $(RAKE) $@
47
47
  if [ -d "$(JRUBY)" ]; then \
48
- PATH="$$PATH:$(JRUBY)/bin" $(JRUBY)/bin/rake $@; \
48
+ PATH="$(JRUBY)/bin:$$PATH" $(JRUBY)/bin/rake $@; \
49
49
  fi
50
50
 
51
51
  release:
52
52
  $(RAKE) release
53
53
  if [ -d "$(JRUBY)" ]; then \
54
- PATH="$$PATH:$(JRUBY)/bin" $(JRUBY)/bin/rake release; \
54
+ PATH="$(JRUBY)/bin:$$PATH" $(JRUBY)/bin/rake release; \
55
55
  fi
56
56
 
57
- test: user-test
57
+ test: cruby-test
58
58
 
59
- user-test:
59
+ cruby-test:
60
60
  $(RAKE) spec
61
61
 
62
+ jruby-test:
63
+ if [ -d "$(JRUBY)" ]; then \
64
+ PATH="$(JRUBY)/bin:$$PATH" LS_HEAP_SIZE='1024m' $(JRUBY)/bin/rake spec; \
65
+ fi
66
+
62
67
  patrol:
63
68
  rubocop -fp --display-cop-names --display-style-guide --no-color lib
64
69
 
data/README-JA.md CHANGED
@@ -55,7 +55,7 @@ Key features
55
55
  * __高い解析精度__
56
56
  * 解析精度はbounceHammerの2倍
57
57
  * 27種類のMTAに対応
58
- * 21種類の著名なMSPに対応
58
+ * 22種類の著名なMSPに対応
59
59
  * 2種類の著名なメール配信クラウドに対応(JSON)
60
60
  * Feedback Loopにも対応
61
61
  * 27種類のエラー理由を検出
@@ -80,10 +80,10 @@ Install
80
80
 
81
81
  ```shell
82
82
  $ sudo gem install sisimai
83
- Fetching: sisimai-4.20.2.gem (100%)
84
- Successfully installed sisimai-4.20.2
85
- Parsing documentation for sisimai-4.20.2
86
- Installing ri documentation for sisimai-4.20.2
83
+ Fetching: sisimai-4.21.0.gem (100%)
84
+ Successfully installed sisimai-4.21.0
85
+ Parsing documentation for sisimai-4.21.0
86
+ Installing ri documentation for sisimai-4.21.0
87
87
  Done installing documentation for sisimai after 6 seconds
88
88
  1 gem installed
89
89
  ```
@@ -96,22 +96,11 @@ $ git clone https://github.com/sisimai/rb-Sisimai.git
96
96
  $ cd ./rb-Sisimai
97
97
  $ sudo make depend install-from-local
98
98
  gem install bundle rake rspec coveralls
99
- Successfully installed bundle-0.0.1
100
- Parsing documentation for bundle-0.0.1
101
- Done installing documentation for bundle after 0 seconds
102
- Successfully installed rake-10.5.0
103
- Parsing documentation for rake-10.5.0
104
- Done installing documentation for rake after 1 seconds
105
- Successfully installed rspec-3.4.0
106
- Parsing documentation for rspec-3.4.0
107
- Done installing documentation for rspec after 0 seconds
108
- Successfully installed coveralls-0.8.10
109
- Parsing documentation for coveralls-0.8.10
110
- Done installing documentation for coveralls after 0 seconds
99
+ ...
111
100
  4 gems installed
112
101
  bundle exec rake install
113
- sisimai 4.20.2 built to pkg/sisimai-4.20.2.gem.
114
- sisimai (4.20.2) installed.
102
+ sisimai 4.21.0 built to pkg/sisimai-4.21.0.gem.
103
+ sisimai (4.21.0) installed.
115
104
  ```
116
105
 
117
106
  Usage
@@ -250,8 +239,8 @@ Differences between Ruby version and Perl version
250
239
  | メール解析速度(1000通のメール) | 3.30秒 | 2.33秒 |
251
240
  | インストール方法 | gem install | cpanm |
252
241
  | 依存モジュール数(コアモジュールを除く) | 1モジュール | 2モジュール |
253
- | LOC:ソースコードの行数 | 12200行 | 8800行 |
254
- | テスト件数(spec/,t/,xt/ディレクトリ) | 106600件 | 188000件 |
242
+ | LOC:ソースコードの行数 | 12400行 | 9000行 |
243
+ | テスト件数(spec/,t/,xt/ディレクトリ) | 108000件 | 189600件 |
255
244
  | ライセンス | 二条項BSD | 二条項BSD |
256
245
  | 開発会社によるサポート契約 | 準備中 | 提供中 |
257
246
 
data/README.md CHANGED
@@ -54,7 +54,7 @@ Key Features
54
54
  * __High Precision of Analysis__
55
55
  * 2 times higher than bounceHammer
56
56
  * Support 22 known MTAs and 5 unknown MTAs
57
- * Support 21 major MSPs(Mail Service Providers)
57
+ * Support 22 major MSPs(Mail Service Providers)
58
58
  * Support 2 major Cloud Email Delivery Services(JSON format)
59
59
  * Support Feedback Loop Message(ARF)
60
60
  * Can detect 27 error reasons
@@ -85,10 +85,10 @@ Install
85
85
 
86
86
  ```shell
87
87
  $ sudo gem install sisimai
88
- Fetching: sisimai-4.20.2.gem (100%)
89
- Successfully installed sisimai-4.20.2
90
- Parsing documentation for sisimai-4.20.2
91
- Installing ri documentation for sisimai-4.20.2
88
+ Fetching: sisimai-4.21.0.gem (100%)
89
+ Successfully installed sisimai-4.21.0
90
+ Parsing documentation for sisimai-4.21.0
91
+ Installing ri documentation for sisimai-4.21.0
92
92
  Done installing documentation for sisimai after 6 seconds
93
93
  1 gem installed
94
94
  ```
@@ -104,8 +104,8 @@ gem install bundle rake rspec coveralls
104
104
  ...
105
105
  4 gems installed
106
106
  bundle exec rake install
107
- sisimai 4.20.2 built to pkg/sisimai-4.20.2.gem.
108
- sisimai (4.20.2) installed.
107
+ sisimai 4.21.0 built to pkg/sisimai-4.21.0.gem.
108
+ sisimai (4.21.0) installed.
109
109
  ```
110
110
 
111
111
  Usage
@@ -243,8 +243,8 @@ and bounceHammer are available at
243
243
  | The speed of parsing email(1000 emails) | 3.30s | 2.33s |
244
244
  | How to install | gem install | cpanm |
245
245
  | Dependencies (Except core modules) | 1 module | 2 modules |
246
- | LOC:Source lines of code | 12200 lines | 8850 lines |
247
- | The number of tests(spec/,t/,xt/) directory | 107600 tests | 188000 tests |
246
+ | LOC:Source lines of code | 12400 lines | 9000 lines |
247
+ | The number of tests(spec/,t/,xt/) directory | 108000 tests | 189600 tests |
248
248
  | License | BSD 2-Clause | BSD 2-Clause |
249
249
  | Support Contract provided by Developer | Coming soon | Available |
250
250
 
data/lib/sisimai.rb CHANGED
@@ -29,8 +29,11 @@ module Sisimai
29
29
  require 'sisimai/data'
30
30
  require 'sisimai/message'
31
31
 
32
- input = argv1[:input] || nil
33
32
  rtype = nil
33
+ input = argv1[:input] || nil
34
+ field = argv1[:field] || []
35
+ fail ' ***error: "field" accepts an array reference only' unless field.is_a? Array
36
+
34
37
 
35
38
  unless input
36
39
  # "input" did not specified, try to detect automatically.
@@ -48,7 +51,6 @@ module Sisimai
48
51
  methodargv = {}
49
52
  delivered1 = argv1[:delivered] || false
50
53
  hookmethod = argv1[:hook] || nil
51
- headerlist = argv1[:field] || []
52
54
  bouncedata = []
53
55
 
54
56
  if input == 'email'
@@ -59,7 +61,7 @@ module Sisimai
59
61
 
60
62
  while r = mail.read do
61
63
  # Read and parse each mail file
62
- methodargv = { data: r, hook: hookmethod, input: 'email', field: headerlist }
64
+ methodargv = { data: r, hook: hookmethod, input: 'email', field: field }
63
65
  mesg = Sisimai::Message.new(methodargv)
64
66
  next if mesg.void
65
67
 
@@ -14,7 +14,7 @@ module Sisimai
14
14
 
15
15
  @@rwaccessors = [
16
16
  :from, # [String] UNIX From line
17
- :header, # [Hash] Header part of a email
17
+ :header, # [Hash] Header part of an email
18
18
  :ds, # [Array] Parsed data by Sisimai::MTA::*
19
19
  :rfc822, # [Hash] Header part of the original message
20
20
  :catch, # [?] The results returned by hook method
@@ -53,6 +53,13 @@ module Sisimai
53
53
 
54
54
  else
55
55
  # Unsupported value in "input"
56
+ warn ' ***warning: Unsupported value in "input": ' + input.to_s
57
+ return nil
58
+ end
59
+
60
+ unless field.is_a? Array
61
+ # Unsupported value in "field"
62
+ warn ' ***warning: "field" accepts an array reference only'
56
63
  return nil
57
64
  end
58
65
 
@@ -66,7 +73,7 @@ module Sisimai
66
73
  methodargv = {
67
74
  'data' => email,
68
75
  'hook' => argvs[:hook] || nil,
69
- 'field' => argvs[:field],
76
+ 'field' => field,
70
77
  }
71
78
  [:load, :order].each do |e|
72
79
  # Order of MTA, MSP modules
data/lib/sisimai/msp.rb CHANGED
@@ -15,8 +15,8 @@ module Sisimai
15
15
  def index
16
16
  return [
17
17
  'US::Google', 'US::Yahoo', 'US::Aol', 'US::Outlook', 'US::AmazonSES',
18
- 'US::SendGrid', 'US::Verizon', 'RU::MailRu', 'RU::Yandex', 'DE::GMX',
19
- 'US::Bigfoot', 'US::Facebook', 'US::Zoho', 'DE::EinsUndEins',
18
+ 'US::SendGrid', 'US::GSuite', 'US::Verizon', 'RU::MailRu', 'RU::Yandex',
19
+ 'DE::GMX', 'US::Bigfoot', 'US::Facebook', 'US::Zoho', 'DE::EinsUndEins',
20
20
  'UK::MessageLabs', 'JP::EZweb', 'JP::KDDI', 'JP::Biglobe',
21
21
  'US::ReceivingSES', 'US::AmazonWorkMail', 'US::Office365',
22
22
  ]
@@ -0,0 +1,258 @@
1
+ module Sisimai
2
+ module MSP::US
3
+ # Sisimai::MSP::US::GSuite parses a bounce email which created by G Suite.
4
+ # Methods in the module are called from only Sisimai::Message.
5
+ module GSuite
6
+ # Imported from p5-Sisimail/lib/Sisimai/MSP/US/GSuite.pm
7
+ class << self
8
+ require 'sisimai/msp'
9
+ require 'sisimai/rfc5322'
10
+
11
+ Re0 = {
12
+ :from => %r/[@]googlemail[.]com[>]?\z/,
13
+ :subject => %r/Delivery[ ]Status[ ]Notification/,
14
+ }
15
+ Re1 = {
16
+ :begin => %r/\A[*][*][ ].+[ ][*][*]\z/,
17
+ :error => %r/\AThe[ ]response[ ]from[ ]the[ ]remote[ ]server[ ]was:\z/,
18
+ :html => %r{\AContent-Type:[ ]*text/html;[ ]*charset=['"]?(?:UTF|utf)[-]8['"]?\z},
19
+ :rfc822 => %r{\AContent-Type:[ ]*(?:message/rfc822|text/rfc822-headers)\z},
20
+ :endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
21
+ }
22
+ ErrorMayBe = { :userunknown => %r/because the address couldn't be found/ }
23
+ Indicators = Sisimai::MSP.INDICATORS
24
+
25
+ def description; return 'G Suite: https://gsuite.google.com'; end
26
+ def smtpagent; return Sisimai::MSP.smtpagent(self); end
27
+ def headerlist; return ['X-Gm-Message-State']; end
28
+ def pattern; return Re0; end
29
+
30
+ # Parse bounce messages from G Suite (Transfer from G Suite to a destinaion host)
31
+ # @param [Hash] mhead Message header of a bounce email
32
+ # @options mhead [String] from From header
33
+ # @options mhead [String] date Date header
34
+ # @options mhead [String] subject Subject header
35
+ # @options mhead [Array] received Received headers
36
+ # @options mhead [String] others Other required headers
37
+ # @param [String] mbody Message body of a bounce email
38
+ # @return [Hash, Nil] Bounce data list and message/rfc822
39
+ # part or nil if it failed to parse or
40
+ # the arguments are missing
41
+ def scan(mhead, mbody)
42
+ return nil unless mhead
43
+ return nil unless mbody
44
+
45
+ return nil unless mhead['from'] =~ Re0[:from]
46
+ return nil unless mhead['subject'] =~ Re0[:subject]
47
+ return nil unless mhead['x-gm-message-state']
48
+
49
+ require 'sisimai/address'
50
+ dscontents = [Sisimai::MSP.DELIVERYSTATUS]
51
+ hasdivided = mbody.split("\n")
52
+ rfc822list = [] # (Array) Each line in message/rfc822 part string
53
+ blanklines = 0 # (Integer) The number of blank lines
54
+ readcursor = 0 # (Integer) Points the current cursor position
55
+ recipients = 0 # (Integer) The number of 'Final-Recipient' header
56
+ anotherset = {} # (Hash) Another error information
57
+ emptylines = 0 # (Integer) The number of empty lines
58
+ connvalues = 0 # (Integer) Flag, 1 if all the value of $connheader have been set
59
+ connheader = {
60
+ 'date' => '', # The value of Arrival-Date header
61
+ 'lhost' => '', # The value of Reporting-MTA header
62
+ }
63
+ v = nil
64
+
65
+ hasdivided.each do |e|
66
+ if readcursor.zero?
67
+ # Beginning of the bounce message or delivery status part
68
+ if e =~ Re1[:begin]
69
+ readcursor |= Indicators[:deliverystatus]
70
+ end
71
+ end
72
+
73
+ if readcursor & Indicators[:'message-rfc822'] == 0
74
+ # Beginning of the original message part
75
+ if e =~ Re1[:rfc822]
76
+ readcursor |= Indicators[:'message-rfc822']
77
+ next
78
+ end
79
+ end
80
+
81
+ if readcursor & Indicators[:'message-rfc822'] > 0
82
+ # After "message/rfc822"
83
+ if e.empty?
84
+ blanklines += 1
85
+ break if blanklines > 1
86
+ next
87
+ end
88
+ rfc822list << e
89
+
90
+ else
91
+ # Before "message/rfc822"
92
+ next if readcursor & Indicators[:deliverystatus] == 0
93
+ next if e.empty?
94
+
95
+ if connvalues == connheader.keys.size
96
+ # Final-Recipient: rfc822; kijitora@example.de
97
+ # Action: failed
98
+ # Status: 5.0.0
99
+ # Remote-MTA: dns; 192.0.2.222 (192.0.2.222, the server for the domain.)
100
+ # Diagnostic-Code: smtp; 550 #5.1.0 Address rejected.
101
+ # Last-Attempt-Date: Fri, 24 Mar 2017 23:34:10 -0700 (PDT)
102
+ v = dscontents[-1]
103
+
104
+ if cv = e.match(/\A[Ff]inal-[Rr]ecipient:[ ]*(?:RFC|rfc)822;[ ]*(.+)\z/)
105
+ # Final-Recipient: rfc822; kijitora@example.de
106
+ if v['recipient']
107
+ # There are multiple recipient addresses in the message body.
108
+ dscontents << Sisimai::MTA.DELIVERYSTATUS
109
+ v = dscontents[-1]
110
+ end
111
+ v['recipient'] = cv[1]
112
+ recipients += 1
113
+
114
+ elsif cv = e.match(/\A[Aa]ction:[ ]*(.+)\z/)
115
+ # Action: failed
116
+ v['action'] = cv[1].downcase
117
+
118
+ elsif cv = e.match(/\A[Ss]tatus:[ ]*(\d[.]\d+[.]\d+)/)
119
+ # Status: 5.0.0
120
+ v['status'] = cv[1]
121
+
122
+ elsif cv = e.match(/\A[Rr]emote-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/)
123
+ # Remote-MTA: dns; 192.0.2.222 (192.0.2.222, the server for the domain.)
124
+ v['rhost'] = cv[1].downcase
125
+ v['rhost'] = '' if v['rhost'] =~ /\A\s+\z/ # Remote-MTA: DNS;
126
+
127
+ elsif cv = e.match(/\A[Ll]ast-[Aa]ttempt-[Dd]ate:[ ]*(.+)\z/)
128
+ # Last-Attempt-Date: Fri, 24 Mar 2017 23:34:10 -0700 (PDT)
129
+ v['date'] = cv[1]
130
+
131
+ else
132
+ if cv = e.match(/\A[Dd]iagnostic-[Cc]ode:[ ]*(.+?);[ ]*(.+)\z/)
133
+ # Diagnostic-Code: smtp; 550 #5.1.0 Address rejected.
134
+ v['spec'] = cv[1].upcase
135
+ v['diagnosis'] = cv[2]
136
+ end
137
+ end
138
+
139
+ else
140
+ # Reporting-MTA: dns; googlemail.com
141
+ # Received-From-MTA: dns; sironeko@example.jp
142
+ # Arrival-Date: Fri, 24 Mar 2017 23:34:07 -0700 (PDT)
143
+ # X-Original-Message-ID: <06C1ED5C-7E02-4036-AEE1-AA448067FB2C@example.jp>
144
+ if cv = e.match(/\A[Rr]eporting-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/)
145
+ # Reporting-MTA: dns; mx.example.jp
146
+ next if connheader['lhost'].size > 0
147
+ connheader['lhost'] = cv[1].downcase
148
+ connvalues += 1
149
+
150
+ elsif cv = e.match(/\A[Aa]rrival-[Dd]ate:[ ]*(.+)\z/)
151
+ # Arrival-Date: Wed, 29 Apr 2009 16:03:18 +0900
152
+ next if connheader['date'].size > 0
153
+ connheader['date'] = 1
154
+ connvalues += 1
155
+
156
+ else
157
+ # Detect SMTP session error or connection error
158
+ if e =~ Re1[:error]
159
+ # The response from the remote server was:
160
+ anotherset['diagnosis'] = e
161
+ else
162
+ # ** Address not found **
163
+ #
164
+ # Your message wasn't delivered to * because the address couldn't be found.
165
+ # Check for typos or unnecessary spaces and try again.
166
+ #
167
+ # The response from the remote server was:
168
+ # 550 #5.1.0 Address rejected.
169
+ next if e =~ Re1[:html]
170
+
171
+ if anotherset['diagnosis']
172
+ # 550 #5.1.0 Address rejected.
173
+ emptylines += 1 if e.empty?
174
+ next if emptylines > 2
175
+ anotherset['diagnosis'] += ' ' + e
176
+ else
177
+ # ** Address not found **
178
+ #
179
+ # Your message wasn't delivered to * because the address couldn't be found.
180
+ # Check for typos or unnecessary spaces and try again.
181
+ next if e.empty?
182
+ next unless e =~ Re1[:begin]
183
+ anotherset['diagnosis'] = e
184
+ end
185
+ end
186
+
187
+ end
188
+ end
189
+ end
190
+ end
191
+
192
+ return nil if recipients.zero?
193
+ require 'sisimai/string'
194
+ require 'sisimai/smtp/reply'
195
+ require 'sisimai/smtp/status'
196
+
197
+ dscontents.map do |e|
198
+ # Set default values if each value is empty.
199
+ connheader.each_key { |a| e[a] ||= connheader[a] || '' }
200
+
201
+ if anotherset['diagnosis']
202
+ # Copy alternative error message
203
+ e['diagnosis'] = anotherset['diagnosis'] unless e['diagnosis']
204
+
205
+ if e['diagnosis'] =~ /\A\d+\z/
206
+ e['diagnosis'] = anotherset['diagnosis']
207
+ else
208
+ # More detailed error message is in "$anotherset"
209
+ as = nil # status
210
+ ar = nil # replycode
211
+
212
+ if e['status'] == '' || e['status'] =~ /\A[45][.]0[.]0\z/
213
+ # Check the value of D.S.N. in $anotherset
214
+ as = Sisimai::SMTP::Status.find(anotherset['diagnosis'])
215
+ if as.size > 0 && as[-3, 3] != '0.0'
216
+ # The D.S.N. is neither an empty nor *.0.0
217
+ e['status'] = as
218
+ end
219
+ end
220
+
221
+ if e['replycode'] == '' || e['replycode'] =~ /\A[45]00\z/
222
+ # Check the value of SMTP reply code in $anotherset
223
+ ar = Sisimai::SMTP::Reply.find(anotherset['diagnosis'])
224
+ if ar.size > 0 && ar[-2, 2].to_i != 0
225
+ # The SMTP reply code is neither an empty nor *00
226
+ e['replycode'] = ar
227
+ end
228
+ end
229
+
230
+ if ( as || ar ) && ( anotherset['diagnosis'].size > e['diagnosis'].size )
231
+ # Update the error message in $e->{'diagnosis'}
232
+ e['diagnosis'] = anotherset['diagnosis']
233
+ end
234
+ end
235
+ end
236
+
237
+ e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
238
+ e['agent'] = Sisimai::MSP::US::GSuite.smtpagent
239
+
240
+ ErrorMayBe.each_key do |q|
241
+ # Guess an reason of the bounce
242
+ next unless e['diagnosis'] =~ ErrorMayBe[q]
243
+ e['reason'] = q.to_s
244
+ break
245
+ end
246
+
247
+ end
248
+
249
+ rfc822part = Sisimai::RFC5322.weedout(rfc822list)
250
+ return { 'ds' => dscontents, 'rfc822' => rfc822part }
251
+ end
252
+
253
+ end
254
+ end
255
+ end
256
+ end
257
+
258
+
@@ -248,7 +248,7 @@ module Sisimai
248
248
  # Try to match with each key as a regular expression
249
249
  next unless e['status'] =~ f
250
250
  e['reason'] = CodeTable[f]
251
- last
251
+ break
252
252
  end
253
253
  end
254
254
  end
@@ -186,10 +186,12 @@ module Sisimai
186
186
  if cv = e.match(/[ \t][(]in reply to ([A-Z]{4}).*/)
187
187
  # 5.1.1 <userunknown@example.co.jp>... User Unknown (in reply to RCPT TO
188
188
  commandset << cv[1]
189
+ anotherset['diagnosis'] += ' ' + e
189
190
 
190
191
  elsif cv = e.match(/([A-Z]{4})[ \t]*.*command[)]\z/)
191
192
  # to MAIL command)
192
193
  commandset << cv[1]
194
+ anotherset['diagnosis'] += ' ' + e
193
195
 
194
196
  else
195
197
  if cv = e.match(/\A[Rr]eporting-MTA:[ ]*(?:DNS|dns);[ ]*(.+)\z/)
@@ -229,6 +231,7 @@ module Sisimai
229
231
  anotherset['diagnosis'] += ' ' + e
230
232
  end
231
233
  end
234
+
232
235
  end
233
236
  end
234
237
  end
@@ -246,8 +249,8 @@ module Sisimai
246
249
  return nil if recipients.zero?
247
250
 
248
251
  require 'sisimai/string'
249
- require 'sisimai/smtp'
250
252
  require 'sisimai/smtp/status'
253
+ require 'sisimai/smtp/reply'
251
254
 
252
255
  dscontents.map do |e|
253
256
  # Set default values if each value is empty.
@@ -259,8 +262,39 @@ module Sisimai
259
262
  if anotherset['diagnosis']
260
263
  # Copy alternative error message
261
264
  e['diagnosis'] = anotherset['diagnosis'] unless e['diagnosis']
262
- e['diagnosis'] = anotherset['diagnosis'] if e['diagnosis'] =~ /\A\d+\z/
265
+
266
+ if e['diagnosis'] =~ /\A\d+\z/
267
+ e['diagnosis'] = anotherset['diagnosis']
268
+ else
269
+ # More detailed error message is in "$anotherset"
270
+ as = nil # status
271
+ ar = nil # replycode
272
+
273
+ if e['status'] == '' || e['status'] =~ /\A[45][.]0[.]0\z/
274
+ # Check the value of D.S.N. in $anotherset
275
+ as = Sisimai::SMTP::Status.find(anotherset['diagnosis'])
276
+ if as.size > 0 && as[-3, 3] != '0.0'
277
+ # The D.S.N. is neither an empty nor *.0.0
278
+ e['status'] = as
279
+ end
280
+ end
281
+
282
+ if e['replycode'] == '' || e['replycode'] =~ /\A[45]00\z/
283
+ # Check the value of SMTP reply code in $anotherset
284
+ ar = Sisimai::SMTP::Reply.find(anotherset['diagnosis'])
285
+ if ar.size > 0 && ar[-2, 2].to_i != 0
286
+ # The SMTP reply code is neither an empty nor *00
287
+ e['replycode'] = ar
288
+ end
289
+ end
290
+
291
+ if ( as || ar ) && ( anotherset['diagnosis'].size > e['diagnosis'].size )
292
+ # Update the error message in $e->{'diagnosis'}
293
+ e['diagnosis'] = anotherset['diagnosis']
294
+ end
295
+ end
263
296
  end
297
+
264
298
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
265
299
  e['spec'] ||= 'SMTP' if e['diagnosis'] =~ /host .+ said:/
266
300
  e.each_key { |a| e[a] ||= '' }
@@ -10,7 +10,7 @@ module Sisimai
10
10
  class << self
11
11
  def text; return 'mesgtoobig'; end
12
12
  def description
13
- return 'Email rejected due to a email size is too big for a destination mail server'
13
+ return 'Email rejected due to an email size is too big for a destination mail server'
14
14
  end
15
15
 
16
16
  # Try to match that the given text and regular expressions
@@ -78,7 +78,7 @@ module Sisimai
78
78
 
79
79
  # Check that the argument is an email address or not
80
80
  # @param [String] email Email address string
81
- # @return [True,False] true: is a email address
81
+ # @return [True,False] true: is an email address
82
82
  # false: is not an email address
83
83
  def is_emailaddress(email)
84
84
  return false unless email.is_a?(::String)
@@ -747,6 +747,12 @@ module Sisimai
747
747
  # Get the value of D.S.N. in the text
748
748
  next unless r = argv1.match(e)
749
749
  foundvalue = r[1]
750
+
751
+ if argv1 =~ /\b(?:#{foundvalue}[.]\d{1,3}|\d{1,3}[.]#{foundvalue})\b/
752
+ # Clear and skip if the value is an IPv4 address
753
+ foundvalue = ''
754
+ next
755
+ end
750
756
  break
751
757
  end
752
758
 
@@ -1,4 +1,4 @@
1
1
  # Define the version number of Sisimai
2
2
  module Sisimai
3
- VERSION = '4.20.2'.freeze
3
+ VERSION = '4.21.0'.freeze
4
4
  end
@@ -0,0 +1,189 @@
1
+ Return-Path: <>
2
+ Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67])
3
+ by aneyakoji.example.jp (V8/cf) with ESMTP id v22nekonyan
4
+ for <sironeko@example.jp>; Sat, 25 Mar 2017 12:34:56 +0900
5
+ X-SenderID: Sendmail Sender-ID Filter v1.0.0 aneyakoji.example.jp v22nekonyan
6
+ Authentication-Results: aneyakoji.example.jp; sender-id=pass header.from=mailer-daemon@googlemail.com
7
+ Received: by mail-pg0-f67.google.com with SMTP id q22neko2222nn.1
8
+ for <sironeko@example.jp>; Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
9
+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
10
+ d=googlemail.com; s=20161025;
11
+ h=from:to:auto-submitted:subject:references:in-reply-to:message-id
12
+ :date;
13
+ bh=wHN9FsOc8eHpGnInjZe8hO+5G9NIf4zIVtk69pRMC9U=;
14
+ b=Uddu2IezvdWUyBWOpp0ENc3K9ElRKs+DGllfYC7k5ZWLg0DDEzRvHkvu8GBjtzTQTi
15
+ 1vCNkxBMPyS/MSdIxlLgKf/ZQg+9FnknIj+oj+bKC6iVhfeYpSd+Kr++QTYsoPmhdkYT
16
+ yw0+gS2iSAponz/KwdCRn6PiV1lj6B6ute82OaqvtUP0wIRGSJxRFNXXtqOa+LlLkxEX
17
+ b0Xl3SMOd0G/Sa82AX7jOYhb/M5Y95z3ikMFlFkecyqxCikC9HtlZh3L0kRFHbQkDdR0
18
+ jF5Dpn6r08ZFReZ5WkCyYb1dxcOGgpwUX162VU5aT2lgfHYoPVq0Ipt1PS1HGfVncUDO
19
+ 50Xg==
20
+ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
21
+ d=1e100.net; s=20161025;
22
+ h=x-gm-message-state:from:to:auto-submitted:subject:references
23
+ :in-reply-to:message-id:date;
24
+ bh=wHN9FsOc8eHpGnInjZe8hO+5G9NIf4zIVtk69pRMC9U=;
25
+ b=uOUCl+vxmjPk5A/TQ08YtayveKldmt23MD6hR5E7ONm9ssx3SGjG0jagZH0KWltpU6
26
+ K2WbK9DkpYkrazY6m+OE1xnL63yI/iBKosC24SQR/shZCWXlcdTPwncVDIkp+fp7RoM5
27
+ 3FUyj6ZUQI8pYfglHHoZwR6tBKSZg81lgCNYDAKipQP5XdDPY1l1+QEv4R/tCegmdxOF
28
+ GrlgrpdOSl/1g1tdcga3jAW33ZO4QsudPKXoOOA37YLIdT90JzNxTzyXnF7yxtpH72wq
29
+ ay82xboOVGzHeW3s51uTdGhkU2Hi1ICwoJb5th9m/D3wXblZFee4ELsf7aM3JEDxrRXS
30
+ AlEQ==
31
+ X-Gm-Message-State: NEKO/Nyaaaaaaaaaaaaaaaaaaaaan/NoranekoNyaaaan+Nyaan/nekoneko22nyannyaaaaan==
32
+ X-Received: by 10.99.122.22 with SMTP id v22neko222222332neko.222.1490423650000;
33
+ Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
34
+ Content-Type: multipart/report; boundary=ffff00000000000000ffff; report-type=delivery-status
35
+ Received: by 10.99.122.22 with SMTP id v22neko222233nyan.222; Fri, 24 Mar 2017
36
+ 12:34:56 -0700 (PDT)
37
+ From: Mail Delivery Subsystem <mailer-daemon@googlemail.com>
38
+ To: sironeko@example.jp
39
+ Auto-Submitted: auto-replied
40
+ Subject: Delivery Status Notification (Failure)
41
+ References: <00222222-2222-2222-2222-FF00FFFF0000@example.jp>
42
+ In-Reply-To: <00222222-2222-2222-2222-FF00FFFF0000@example.jp>
43
+ Message-ID: <ee002222.2200eeaa.2002f.e222.NYAAN@mx.google.com>
44
+ Date: Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
45
+
46
+ --ffff00000000000000ffff
47
+ Content-Type: multipart/related; boundary=ee00ff00002222eeffccdd
48
+
49
+ --ee00ff00002222eeffccdd
50
+ Content-Type: multipart/alternative; boundary=aa00220022222222ffeebb
51
+
52
+ --aa00220022222222ffeebb
53
+ Content-Type: text/plain; charset=UTF-8
54
+
55
+
56
+ ** Address not found **
57
+
58
+ Your message wasn't delivered to kijitora@example.de because the address couldn't be found. Check for typos or unnecessary spaces and try again.
59
+
60
+
61
+
62
+ The response from the remote server was:
63
+ 550 #5.1.0 Address rejected.
64
+
65
+ --aa00220022222222ffeebb
66
+ Content-Type: text/html; charset=UTF-8
67
+
68
+
69
+ <html>
70
+ <head>
71
+ <style>
72
+ * {
73
+ font-family:Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
74
+ }
75
+ </style>
76
+ </head>
77
+ <body>
78
+ <table cellpadding="0" cellspacing="0" class="email-wrapper" style="padding-top:32px;background-color:#ffffff;"><tbody>
79
+ <tr><td>
80
+ <table cellpadding=0 cellspacing=0><tbody>
81
+ <tr><td style="max-width:560px;padding:24px 24px 32px;background-color:#fafafa;border:1px solid #e0e0e0;border-radius:2px">
82
+ <img style="padding:0 24px 16px 0;float:left" width=72 height=72 alt="Error Icon" src="cid:icon.png">
83
+ <table style="min-width:272px;padding-top:8px"><tbody>
84
+ <tr><td><h2 style="font-size:20px;color:#212121;font-weight:bold;margin:0">
85
+ Address not found
86
+ </h2></td></tr>
87
+ <tr><td style="padding-top:20px;color:#757575;font-size:16px;font-weight:normal;text-align:left">
88
+ Your message wasn't delivered to <a style='color:#212121;text-decoration:none'><b>kijitora@example.de</b></a> because the address couldn't be found. Check for typos or unnecessary spaces and try again.
89
+ </td></tr>
90
+ </tbody></table>
91
+ </td></tr>
92
+ </tbody></table>
93
+ </td></tr>
94
+ <tr style="border:none;background-color:#fff;font-size:12.8px;width:90%">
95
+ <td align="left" style="padding:48px 10px">
96
+ The response from the remote server was:<br/>
97
+ <p style="font-family:monospace">
98
+ 550 #5.1.0 Address rejected.
99
+ </p>
100
+ </td>
101
+ </tr>
102
+ </tbody></table>
103
+ </body>
104
+ </html>
105
+
106
+ --aa00220022222222ffeebb--
107
+ --ee00ff00002222eeffccdd
108
+ Content-Type: image/png; name="icon.png"
109
+ Content-Disposition: attachment; filename="icon.png"
110
+ Content-Transfer-Encoding: base64
111
+ Content-ID: <icon.png>
112
+
113
+ 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
138
+ LK8FGADCTxYrr+EVJgAAAABJRU5ErkJggg==
139
+ --ee00ff00002222eeffccdd--
140
+ --ffff00000000000000ffff
141
+ Content-Type: message/delivery-status
142
+
143
+ Reporting-MTA: dns; googlemail.com
144
+ Received-From-MTA: dns; sironeko@example.jp
145
+ Arrival-Date: Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
146
+ X-Original-Message-ID: <00222222-2222-2222-2222-FF00FFFF0000@example.jp>
147
+
148
+ Final-Recipient: rfc822; kijitora@example.de
149
+ Action: failed
150
+ Status: 5.0.0
151
+ Remote-MTA: dns; 192.0.2.222 (192.0.2.222, the server for the domain.)
152
+ Diagnostic-Code: smtp; 550 #5.1.0 Address rejected.
153
+ Last-Attempt-Date: Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
154
+
155
+ --ffff00000000000000ffff
156
+ Content-Type: message/rfc822
157
+
158
+ X-Gm-Message-State: NEKO/Nyaaaan0ai9dgaig4u9u8hamcbh499/Nyaan2/222NN+nyaaanNekochan22nyaaaaaaaan/Sotoneko22Nyaan/NekoNyaaan2
159
+ X-Received: by 10.99.122.22 with SMTP id v22nekochan488nya.222.1490423649015;
160
+ Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
161
+ X-Received: by 10.99.122.22 with SMTP id v22nekochan477nya.222.1490423648801;
162
+ Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
163
+ Return-Path: <sironeko@example.jp>
164
+ Received: from aneyakoji.example.jp (aneyakoji.example.jp. [198.51.100.2])
165
+ by mx.google.com with ESMTP id 22neko22nyaaaan.404.2017.03.24.12.34.56
166
+ for <kijitora@example.de>;
167
+ Fri, 24 Mar 2017 12:34:56 -0700 (PDT)
168
+ Received-SPF: pass (google.com: domain of sironeko@example.jp designates 198.51.100.2 as permitted sender) client-ip=198.51.100.2;
169
+ Authentication-Results: mx.google.com;
170
+ spf=pass (google.com: domain of sironeko@example.jp designates 198.51.100.2 as permitted sender) smtp.mailfrom=sironeko@example.jp
171
+ Received: from [172.31.127.65] (c222-222kyoto.kyoto.example.ne.jp [203.0.113.222])
172
+ (authenticated bits=0)
173
+ by aneyakoji.example.jp (V8/cf) with ESMTP id v2NekoNyaan22g
174
+ for <kijitora@example.de>; Sat, 25 Mar 2017 12:34:56 +0900
175
+ X-SenderID: Sendmail Sender-ID Filter v1.0.0 aneyakoji.example.jp v2NekoNyaan22g
176
+ Authentication-Results: aneyakoji.example.jp; sender-id=pass header.from=sironeko@example.jp; auth=pass (CRAM-MD5); spf=pass smtp.mfrom=sironeko@example.jp
177
+ From: "Neko, Nyaaan" <sironeko@example.jp>
178
+ Content-Type: text/plain; charset=us-ascii
179
+ Content-Transfer-Encoding: 7bit
180
+ Subject: Nyaaan
181
+ Message-Id: <00222222-2222-2222-2222-FF00FFFF0000@example.jp>
182
+ Date: Sat, 25 Mar 2017 12:34:56 +0900
183
+ To: kijitora@example.de
184
+ Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
185
+ X-Mailer: Apple Mail (2.3124)
186
+
187
+ Nyaan
188
+
189
+ --ffff00000000000000ffff--
@@ -0,0 +1,180 @@
1
+ X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shelby.example.net
2
+ X-Spam-Level:
3
+ X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,
4
+ DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MIME_HEADER_CTYPE_ONLY,
5
+ RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,URIBL_BLOCKED autolearn=no version=3.3.2
6
+ Received: from mail-lf0-f66.google.com ([209.85.215.66])
7
+ by shelby.example.net with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128)
8
+ (Exim 4.80)
9
+ id 1crLWb-0001Wu-2x
10
+ for issue218@linux.example.de; Fri, 24 Mar 2017 10:28:49 +0100
11
+ Received: by mail-lf0-f66.google.com with SMTP id v2so883599lfi.2
12
+ for <issue218@linux.example.de>; Fri, 24 Mar 2017 02:28:44 -0700 (PDT)
13
+ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
14
+ d=googlemail.com; s=20161025;
15
+ h=from:to:auto-submitted:subject:references:in-reply-to:message-id
16
+ :date;
17
+ bh=ZaXqPubt2Y09f+riOSQuXHWlmBs3J2KZBO54WcbtBbs=;
18
+ b=Rv9u7Eur5Wp5DTB7hYKOgAo/gspH/9TKLryAhBN2AB3Qt/3QIr6ygVtYA06s50Mgzq
19
+ kk1DDtPzLVWYaTgmYZjrgcxUCvfMyN6gRNKx77F807DfQUt7rNDanK7INrR7LPFuZcId
20
+ /SAQTfS6IR/dtv3/W7G62/gZWwlMyNRR5hpVmpJ4v6OBh42DWdsqpBIM1G/63XgeyqY3
21
+ DrgEBh45asP/FQrLQ2/krBL7UZOtUC19fQO98ncnLVXSJM4tMzw9ohOf3F6IyiNPaxAa
22
+ aLkphGZKxgMvmZbUyQSDtfHioxw8ysl1xaGRWU/lAPFSpnMbQ5pU7R4S/fnv+AzpRT1P
23
+ js3Q==
24
+ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
25
+ d=1e100.net; s=20161025;
26
+ h=x-gm-message-state:from:to:auto-submitted:subject:references
27
+ :in-reply-to:message-id:date;
28
+ bh=ZaXqPubt2Y09f+riOSQuXHWlmBs3J2KZBO54WcbtBbs=;
29
+ b=jY2PhN9mja59DbIHRzgp67y7GkMWbhE5f6WUBrETSWy47flYvS8UVX0EnzmbyZqS+D
30
+ hd/zHhfjp31omPkIm3GBb+YCJOWSJr+gf/5D9r1r4owunRPPs5ezIHYVYdYogVCoQJNX
31
+ XWlg7UwlafB83IbDHMEH9A/jiLG6F24sgfYsDjEZ7dEbcE5sviJvBQMWu1ac1gq6c497
32
+ 3Buy6f/wxlbKUByTnNMFYunOaK06LTrzcJ3JPo6n3wz2WRkCgp0U6CwOfx3RZHxtaoGZ
33
+ Zkqv4pyplW8EXAcrF1MgBPlS1e3djXSyaN4tsg8mqoGiEYzZnY9K2oeNGqyBtGfWZSjP
34
+ MRXQ==
35
+ X-Gm-Message-State: AFeK/H3OuV9ifjCJwkb2Us7PvVoxwdQUuHnbSNbSaHXDml+9YXnFKPh+X1RtdVWDxiWK57WfdSc1Ya28oRMSbHx2dj3Bs/9zsS1p+oY=
36
+ X-Received: by 10.25.37.10 with SMTP id l10mr3508841lfl.17.1490347718449;
37
+ Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
38
+ Content-Type: multipart/report; boundary=001a1140640e599149054b769e99; report-type=delivery-status
39
+ Received: by 10.25.37.10 with SMTP id l10mr3857678lfl.17; Fri, 24 Mar 2017
40
+ 02:28:38 -0700 (PDT)
41
+ From: Mail Delivery Subsystem <mailer-daemon@googlemail.com>
42
+ To: issue218@linux.example.de
43
+ Auto-Submitted: auto-replied
44
+ Subject: Delivery Status Notification (Failure)
45
+ References: <002b01d2a4bb$028be941$b756c59a@example>
46
+ In-Reply-To: <002b01d2a4bb$028be941$b756c59a@example>
47
+ Message-ID: <58d4e6c6.0a25190a.79dd8.8aff.GMRIR@mx.google.com>
48
+ Date: Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
49
+
50
+ --001a1140640e599149054b769e99
51
+ Content-Type: multipart/related; boundary=001a1140640e599177054b769e9a
52
+
53
+ --001a1140640e599177054b769e9a
54
+ Content-Type: multipart/alternative; boundary=001a1140640e59917b054b769e9b
55
+
56
+ --001a1140640e59917b054b769e9b
57
+ Content-Type: text/plain; charset=UTF-8
58
+
59
+
60
+ ** Address not found **
61
+
62
+ Your message wasn't delivered to kijitora@example.it because the address couldn't be found. Check for typos or unnecessary spaces and try again.
63
+
64
+
65
+
66
+
67
+ --001a1140640e59917b054b769e9b
68
+ Content-Type: text/html; charset=UTF-8
69
+
70
+
71
+ <html>
72
+ <head>
73
+ <style>
74
+ * {
75
+ font-family:Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
76
+ }
77
+ </style>
78
+ </head>
79
+ <body>
80
+ <table cellpadding="0" cellspacing="0" class="email-wrapper" style="padding-top:32px;background-color:#ffffff;"><tbody>
81
+ <tr><td>
82
+ <table cellpadding=0 cellspacing=0><tbody>
83
+ <tr><td style="max-width:560px;padding:24px 24px 32px;background-color:#fafafa;border:1px solid #e0e0e0;border-radius:2px">
84
+ <img style="padding:0 24px 16px 0;float:left" width=72 height=72 alt="Error Icon" src="cid:icon.png">
85
+ <table style="min-width:272px;padding-top:8px"><tbody>
86
+ <tr><td><h2 style="font-size:20px;color:#212121;font-weight:bold;margin:0">
87
+ Address not found
88
+ </h2></td></tr>
89
+ <tr><td style="padding-top:20px;color:#757575;font-size:16px;font-weight:normal;text-align:left">
90
+ Your message wasn't delivered to <a style='color:#212121;text-decoration:none'><b>kijitora@example.it</b></a> because the address couldn't be found. Check for typos or unnecessary spaces and try again.
91
+ </td></tr>
92
+ </tbody></table>
93
+ </td></tr>
94
+ </tbody></table>
95
+ </td></tr>
96
+ <tr style="border:none;background-color:#fff;font-size:12.8px;width:90%">
97
+ <td align="left" style="padding:48px 10px">
98
+ </td>
99
+ </tr>
100
+ </tbody></table>
101
+ </body>
102
+ </html>
103
+
104
+ --001a1140640e59917b054b769e9b--
105
+ --001a1140640e599177054b769e9a
106
+ Content-Type: image/png; name="icon.png"
107
+ Content-Disposition: attachment; filename="icon.png"
108
+ Content-Transfer-Encoding: base64
109
+ Content-ID: <icon.png>
110
+
111
+ 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
136
+ LK8FGADCTxYrr+EVJgAAAABJRU5ErkJggg==
137
+ --001a1140640e599177054b769e9a--
138
+ --001a1140640e599149054b769e99
139
+ Content-Type: message/delivery-status
140
+
141
+ Reporting-MTA: dns; googlemail.com
142
+ Received-From-MTA: dns; issue218@linux.example.de
143
+ Arrival-Date: Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
144
+ X-Original-Message-ID: <002b01d2a4bb$028be941$b756c59a@example>
145
+
146
+ Final-Recipient: rfc822; kijitora@example.it
147
+ Action: failed
148
+ Status: 5.0.0
149
+ Last-Attempt-Date: Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
150
+
151
+ --001a1140640e599149054b769e99
152
+ Content-Type: message/rfc822
153
+
154
+ X-Received: by 10.25.37.10 with SMTP id l10mr3508834lfl.17.1490347718262;
155
+ Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
156
+ Return-Path: <issue218@linux.example.de>
157
+ Received: from 222.2.0.192.neko.example.co.th ([192.0.2.222])
158
+ by mx.google.com with ESMTP id o66si992250lfg.117.2017.03.24.02.28.37
159
+ for <kijitora@example.it>;
160
+ Fri, 24 Mar 2017 02:28:38 -0700 (PDT)
161
+ Received-SPF: neutral (google.com: 192.0.2.222 is neither permitted nor denied by best guess record for domain of issue218@linux.example.de) client-ip=192.0.2.222;
162
+ Authentication-Results: mx.google.com;
163
+ spf=neutral (google.com: 192.0.2.222 is neither permitted nor denied by best guess record for domain of issue218@linux.example.de) smtp.mailfrom=issue218@linux.example.de
164
+ Message-ID: <002b01d2a4bb$028be941$b756c59a@example>
165
+ From: <issue218@linux.example.de>
166
+ To: <kijitora@example.it>
167
+ Subject: 5394
168
+ Date: 24 Mar 2017 22:01:42 +0600
169
+ MIME-Version: 1.0
170
+ Content-Type: multipart/alternative;
171
+ boundary="----=_NextPart_000_0028_01D2A4BB.02869201"
172
+ X-Priority: 3
173
+ X-MSMail-Priority: Normal
174
+ X-Mailer: Microsoft Outlook Express 6.00.2800.1106
175
+ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
176
+
177
+ Nyaan
178
+
179
+ --001a1140640e599149054b769e99--
180
+
data/sisimai-java.gemspec CHANGED
@@ -25,10 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'bundler', '~> 1.8'
26
26
  spec.add_development_dependency 'rake', '~> 10.0'
27
27
  spec.add_development_dependency 'rspec', '~> 0'
28
-
29
- if RUBY_PLATFORM == 'java'
30
- spec.add_runtime_dependency 'jrjackson','~> 0.3', '>= 0.3.8'
31
- else
32
- spec.add_runtime_dependency 'oj', '~> 2.14', '>= 2.14.4'
33
- end
28
+ spec.add_runtime_dependency 'jrjackson','~> 0.3', '>= 0.3.8'
34
29
  end
data/sisimai.gemspec CHANGED
@@ -24,10 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency 'bundler', '~> 1.8'
25
25
  spec.add_development_dependency 'rake', '~> 10.0'
26
26
  spec.add_development_dependency 'rspec', '~> 0'
27
-
28
- if RUBY_PLATFORM == 'java'
29
- spec.add_runtime_dependency 'jrjackson','~> 0.3', '>= 0.3.8'
30
- else
31
- spec.add_runtime_dependency 'oj', '~> 2.14', '>= 2.14.4'
32
- end
27
+ spec.add_runtime_dependency 'oj', '~> 2.14', '>= 2.14.4'
33
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sisimai
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.20.2
4
+ version: 4.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - azumakuniyuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-11 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -132,6 +132,7 @@ files:
132
132
  - lib/sisimai/msp/us/bigfoot.rb
133
133
  - lib/sisimai/msp/us/facebook.rb
134
134
  - lib/sisimai/msp/us/google.rb
135
+ - lib/sisimai/msp/us/gsuite.rb
135
136
  - lib/sisimai/msp/us/office365.rb
136
137
  - lib/sisimai/msp/us/outlook.rb
137
138
  - lib/sisimai/msp/us/receivingses.rb
@@ -316,6 +317,8 @@ files:
316
317
  - set-of-emails/maildir/bsd/msp-us-google-15.eml
317
318
  - set-of-emails/maildir/bsd/msp-us-google-16.eml
318
319
  - set-of-emails/maildir/bsd/msp-us-google-17.eml
320
+ - set-of-emails/maildir/bsd/msp-us-gsuite-01.eml
321
+ - set-of-emails/maildir/bsd/msp-us-gsuite-02.eml
319
322
  - set-of-emails/maildir/bsd/msp-us-office365-01.eml
320
323
  - set-of-emails/maildir/bsd/msp-us-office365-02.eml
321
324
  - set-of-emails/maildir/bsd/msp-us-outlook-01.eml