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
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Exchange2007 parses a bounce email which created by
|
3
3
|
# Microsoft Exchange Server 2007.
|
4
4
|
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
module Exchange2007
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Exchange2007.pm
|
8
|
+
require 'sisimai/lhost'
|
9
9
|
|
10
|
-
Indicators = Sisimai::
|
10
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
11
11
|
StartingOf = { rfc822: ['Original message headers:'] }.freeze
|
12
12
|
MarkingsOf = {
|
13
13
|
message: %r/\ADiagnostic[ ]information[ ]for[ ]administrators:/,
|
@@ -30,7 +30,7 @@ module Sisimai::Bite::Email
|
|
30
30
|
}.freeze
|
31
31
|
|
32
32
|
def description; return 'Microsoft Exchange Server 2007'; end
|
33
|
-
def smtpagent; return Sisimai::
|
33
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
34
34
|
def headerlist; return %w[content-language]; end
|
35
35
|
|
36
36
|
# Parse bounce messages from Microsoft Exchange Server 2007
|
@@ -44,12 +44,12 @@ module Sisimai::Bite::Email
|
|
44
44
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
45
45
|
# part or nil if it failed to parse or
|
46
46
|
# the arguments are missing
|
47
|
-
def
|
47
|
+
def make(mhead, mbody)
|
48
48
|
return nil unless mhead['subject'].start_with?('Undeliverable:')
|
49
49
|
return nil unless mhead['content-language']
|
50
50
|
return nil unless mhead['content-language'] =~ /\A[a-z]{2}(?:[-][A-Z]{2})?\z/
|
51
51
|
|
52
|
-
dscontents = [Sisimai::
|
52
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
53
53
|
hasdivided = mbody.split("\n")
|
54
54
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
55
55
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -105,7 +105,7 @@ module Sisimai::Bite::Email
|
|
105
105
|
# kijitora@example.jp
|
106
106
|
if v['recipient']
|
107
107
|
# There are multiple recipient addresses in the message body.
|
108
|
-
dscontents << Sisimai::
|
108
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
109
109
|
v = dscontents[-1]
|
110
110
|
end
|
111
111
|
v['recipient'] = cv[1]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Exim parses a bounce email which created by Exim.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Exim
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Exim.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
deliverystatus: ['Content-type: message/delivery-status'],
|
12
12
|
endof: ['__END_OF_EMAIL_MESSAGE__'],
|
@@ -124,7 +124,7 @@ module Sisimai::Bite::Email
|
|
124
124
|
].freeze
|
125
125
|
|
126
126
|
def description; return 'Exim'; end
|
127
|
-
def smtpagent; return Sisimai::
|
127
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
128
128
|
def headerlist; return %w[x-failed-recipients]; end
|
129
129
|
|
130
130
|
# Parse bounce messages from Exim
|
@@ -138,7 +138,7 @@ module Sisimai::Bite::Email
|
|
138
138
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
139
139
|
# part or nil if it failed to parse or
|
140
140
|
# the arguments are missing
|
141
|
-
def
|
141
|
+
def make(mhead, mbody)
|
142
142
|
return nil if mhead['from'] =~ /[@].+[.]mail[.]ru[>]?/
|
143
143
|
|
144
144
|
# Message-Id: <E1P1YNN-0003AD-Ga@example.org>
|
@@ -158,7 +158,7 @@ module Sisimai::Bite::Email
|
|
158
158
|
|
159
159
|
require 'sisimai/rfc1894'
|
160
160
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
161
|
-
dscontents = [Sisimai::
|
161
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
162
162
|
hasdivided = mbody.split("\n")
|
163
163
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
164
164
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -233,7 +233,7 @@ module Sisimai::Bite::Email
|
|
233
233
|
|
234
234
|
if v['recipient']
|
235
235
|
# There are multiple recipient addresses in the message body.
|
236
|
-
dscontents << Sisimai::
|
236
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
237
237
|
v = dscontents[-1]
|
238
238
|
end
|
239
239
|
# v['recipient'] = cv[1]
|
@@ -353,7 +353,7 @@ module Sisimai::Bite::Email
|
|
353
353
|
# Insert each recipient address into dscontents
|
354
354
|
dscontents[-1]['recipient'] = e
|
355
355
|
next if dscontents.size == recipients
|
356
|
-
dscontents << Sisimai::
|
356
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
357
357
|
end
|
358
358
|
end
|
359
359
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::EZweb parses a bounce email which created by au EZweb.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module EZweb
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/EZweb.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
MarkingsOf = {
|
11
11
|
message: %r{\A(?:
|
12
12
|
The[ ]user[(]s[)][ ]
|
@@ -39,7 +39,7 @@ module Sisimai::Bite::Email
|
|
39
39
|
}.freeze
|
40
40
|
|
41
41
|
def description; return 'au EZweb: http://www.au.kddi.com/mobile/'; end
|
42
|
-
def smtpagent; return Sisimai::
|
42
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
43
43
|
def headerlist; return %w[x-spasign]; end
|
44
44
|
|
45
45
|
# Parse bounce messages from au EZweb
|
@@ -53,7 +53,7 @@ module Sisimai::Bite::Email
|
|
53
53
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
54
54
|
# part or nil if it failed to parse or
|
55
55
|
# the arguments are missing
|
56
|
-
def
|
56
|
+
def make(mhead, mbody)
|
57
57
|
match = 0
|
58
58
|
match += 1 if mhead['from'].include?('Postmaster@ezweb.ne.jp')
|
59
59
|
match += 1 if mhead['from'].include?('Postmaster@au.com')
|
@@ -67,7 +67,7 @@ module Sisimai::Bite::Email
|
|
67
67
|
|
68
68
|
require 'sisimai/rfc1894'
|
69
69
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
70
|
-
dscontents = [Sisimai::
|
70
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
71
71
|
hasdivided = mbody.split("\n")
|
72
72
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
73
73
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -131,7 +131,7 @@ module Sisimai::Bite::Email
|
|
131
131
|
|
132
132
|
if v['recipient']
|
133
133
|
# There are multiple recipient addresses in the message body.
|
134
|
-
dscontents << Sisimai::
|
134
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
135
135
|
v = dscontents[-1]
|
136
136
|
end
|
137
137
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Facebook parses a bounce email which created by Facebook.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Facebook
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Facebook.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
message: ['This message was created automatically by Facebook.'],
|
12
12
|
rfc822: ['Content-Disposition: inline'],
|
@@ -72,7 +72,7 @@ module Sisimai::Bite::Email
|
|
72
72
|
}.freeze
|
73
73
|
|
74
74
|
def description; return 'Facebook: https://www.facebook.com'; end
|
75
|
-
def smtpagent; return Sisimai::
|
75
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
76
76
|
def headerlist; return []; end
|
77
77
|
|
78
78
|
# Parse bounce messages from Facebook
|
@@ -86,7 +86,7 @@ module Sisimai::Bite::Email
|
|
86
86
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
87
87
|
# part or nil if it failed to parse or
|
88
88
|
# the arguments are missing
|
89
|
-
def
|
89
|
+
def make(mhead, mbody)
|
90
90
|
return nil unless mhead['from'] == 'Facebook <mailer-daemon@mx.facebook.com>'
|
91
91
|
return nil unless mhead['subject'] == 'Sorry, your message could not be delivered'
|
92
92
|
|
@@ -94,7 +94,7 @@ module Sisimai::Bite::Email
|
|
94
94
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
95
95
|
permessage = {} # (Hash) Store values of each Per-Message field
|
96
96
|
|
97
|
-
dscontents = [Sisimai::
|
97
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
98
98
|
hasdivided = mbody.split("\n")
|
99
99
|
havepassed = ['']
|
100
100
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
@@ -150,7 +150,7 @@ module Sisimai::Bite::Email
|
|
150
150
|
# Final-Recipient: rfc822; kijitora@example.jp
|
151
151
|
if v['recipient']
|
152
152
|
# There are multiple recipient addresses in the message body.
|
153
|
-
dscontents << Sisimai::
|
153
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
154
154
|
v = dscontents[-1]
|
155
155
|
end
|
156
156
|
v['recipient'] = o[2]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::FML parses a bounce email which created by fml.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module FML
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/FML.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = { rfc822: ['Original mail as follows:'] }.freeze
|
11
11
|
ErrorTitle = {
|
12
12
|
'rejected' => %r{(?>
|
@@ -46,7 +46,7 @@ module Sisimai::Bite::Email
|
|
46
46
|
}.freeze
|
47
47
|
|
48
48
|
def description; return 'fml mailing list server/manager'; end
|
49
|
-
def smtpagent; return Sisimai::
|
49
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
50
50
|
def headerlist; return %w[x-mlserver]; end
|
51
51
|
|
52
52
|
# Parse bounce messages from fml mailling list server/manager
|
@@ -60,12 +60,12 @@ module Sisimai::Bite::Email
|
|
60
60
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
61
61
|
# part or nil if it failed to parse or
|
62
62
|
# the arguments are missing
|
63
|
-
def
|
63
|
+
def make(mhead, mbody)
|
64
64
|
return nil unless mhead['x-mlserver']
|
65
65
|
return nil unless mhead['from'] =~ /.+[-]admin[@].+/
|
66
66
|
return nil unless mhead['message-id'] =~ /\A[<]\d+[.]FML.+[@].+[>]\z/
|
67
67
|
|
68
|
-
dscontents = [Sisimai::
|
68
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
69
69
|
hasdivided = mbody.split("\n")
|
70
70
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
71
71
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -109,7 +109,7 @@ module Sisimai::Bite::Email
|
|
109
109
|
# Duplicated Message-ID in <2ndml@example.com>.
|
110
110
|
if v['recipient']
|
111
111
|
# There are multiple recipient addresses in the message body.
|
112
|
-
dscontents << Sisimai::
|
112
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
113
113
|
v = dscontents[-1]
|
114
114
|
end
|
115
115
|
v['recipient'] = cv[1]
|
@@ -117,7 +117,7 @@ module Sisimai::Bite::Email
|
|
117
117
|
recipients += 1
|
118
118
|
else
|
119
119
|
# If you know the general guide of this list, please send mail with
|
120
|
-
# the mail body
|
120
|
+
# the mail body
|
121
121
|
v['diagnosis'] ||= ''
|
122
122
|
v['diagnosis'] << e
|
123
123
|
end
|
@@ -1,20 +1,20 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::GMX parses a bounce email which created by GMX.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module GMX
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/GMX.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
message: ['This message was created automatically by mail delivery software'],
|
12
12
|
rfc822: ['--- The header of the original message is following'],
|
13
13
|
}.freeze
|
14
14
|
MessagesOf = { 'expired' => ['delivery retry timeout exceeded'] }.freeze
|
15
15
|
|
16
|
-
def description; return 'GMX:
|
17
|
-
def smtpagent; return Sisimai::
|
16
|
+
def description; return 'GMX: https://www.gmx.net'; end
|
17
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
18
18
|
|
19
19
|
# Envelope-To: <kijitora@mail.example.com>
|
20
20
|
# X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3;
|
@@ -33,12 +33,12 @@ module Sisimai::Bite::Email
|
|
33
33
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
34
34
|
# part or nil if it failed to parse or
|
35
35
|
# the arguments are missing
|
36
|
-
def
|
36
|
+
def make(mhead, mbody)
|
37
37
|
# :from => %r/\AMAILER-DAEMON[@]/,
|
38
38
|
# :subject => %r/\AMail delivery failed: returning message to sender\z/,
|
39
39
|
return nil unless mhead['x-gmx-antispam']
|
40
40
|
|
41
|
-
dscontents = [Sisimai::
|
41
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
42
42
|
hasdivided = mbody.split("\n")
|
43
43
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
44
44
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -97,7 +97,7 @@ module Sisimai::Bite::Email
|
|
97
97
|
# delivery retry timeout exceeded
|
98
98
|
if v['recipient']
|
99
99
|
# There are multiple recipient addresses in the message body.
|
100
|
-
dscontents << Sisimai::
|
100
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
101
101
|
v = dscontents[-1]
|
102
102
|
end
|
103
103
|
v['recipient'] = cv[1]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Google parses a bounce email which created by Gmail.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Google
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Google.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
message: ['Delivery to the following recipient'],
|
12
12
|
error: ['The error that the other server returned was:'],
|
@@ -39,7 +39,7 @@ module Sisimai::Bite::Email
|
|
39
39
|
# 500 Remote server does not support TLS (state 6).
|
40
40
|
'6' => { 'command' => 'MAIL', 'reason' => 'systemerror' },
|
41
41
|
|
42
|
-
#
|
42
|
+
# https://www.google.td/support/forum/p/gmail/thread?tid=08a60ebf5db24f7b&hl=en
|
43
43
|
# Technical details of permanent failure:
|
44
44
|
# Google tried to deliver your message, but it was rejected by the recipient domain.
|
45
45
|
# We recommend contacting the other email provider for further information about the
|
@@ -47,7 +47,7 @@ module Sisimai::Bite::Email
|
|
47
47
|
# 535 SMTP AUTH failed with the remote server. (state 8).
|
48
48
|
'8' => { 'command' => 'AUTH', 'reason' => 'systemerror' },
|
49
49
|
|
50
|
-
#
|
50
|
+
# https://www.google.co.nz/support/forum/p/gmail/thread?tid=45208164dbca9d24&hl=en
|
51
51
|
# Technical details of temporary failure:
|
52
52
|
# Google tried to deliver your message, but it was rejected by the recipient domain.
|
53
53
|
# We recommend contacting the other email provider for further information about the
|
@@ -55,7 +55,7 @@ module Sisimai::Bite::Email
|
|
55
55
|
# 454 454 TLS missing certificate: error:0200100D:system library:fopen:Permission denied (#4.3.0) (state 9).
|
56
56
|
'9' => { 'command' => 'AUTH', 'reason' => 'systemerror' },
|
57
57
|
|
58
|
-
#
|
58
|
+
# https://www.google.com/support/forum/p/gmail/thread?tid=5cfab8c76ec88638&hl=en
|
59
59
|
# Technical details of permanent failure:
|
60
60
|
# Google tried to deliver your message, but it was rejected by the recipient domain.
|
61
61
|
# We recommend contacting the other email provider for further information about the
|
@@ -79,7 +79,7 @@ module Sisimai::Bite::Email
|
|
79
79
|
#
|
80
80
|
'14' => { 'command' => 'RCPT', 'reason' => 'userunknown' },
|
81
81
|
|
82
|
-
#
|
82
|
+
# https://www.google.cz/support/forum/p/gmail/thread?tid=7090cbfd111a24f9&hl=en
|
83
83
|
# Technical details of permanent failure:
|
84
84
|
# Google tried to deliver your message, but it was rejected by the recipient domain.
|
85
85
|
# We recommend contacting the other email provider for further information about the
|
@@ -88,7 +88,7 @@ module Sisimai::Bite::Email
|
|
88
88
|
# 554 554 Error: no valid recipients (state 15).
|
89
89
|
'15' => { 'command' => 'DATA', 'reason' => 'filtered' },
|
90
90
|
|
91
|
-
#
|
91
|
+
# https://www.google.com/support/forum/p/Google%20Apps/thread?tid=0aac163bc9c65d8e&hl=en
|
92
92
|
# Technical details of permanent failure:
|
93
93
|
# Google tried to deliver your message, but it was rejected by the recipient domain.
|
94
94
|
# We recommend contacting the other email provider for further information about the
|
@@ -106,7 +106,7 @@ module Sisimai::Bite::Email
|
|
106
106
|
}.freeze
|
107
107
|
|
108
108
|
def description; return 'Google Gmail: https://mail.google.com'; end
|
109
|
-
def smtpagent; return Sisimai::
|
109
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
110
110
|
def headerlist; return %w[x-failed-recipients]; end
|
111
111
|
|
112
112
|
# Parse bounce messages from Google Gmail
|
@@ -120,7 +120,7 @@ module Sisimai::Bite::Email
|
|
120
120
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
121
121
|
# part or nil if it failed to parse or
|
122
122
|
# the arguments are missing
|
123
|
-
def
|
123
|
+
def make(mhead, mbody)
|
124
124
|
# Google Mail
|
125
125
|
# From: Mail Delivery Subsystem <mailer-daemon@googlemail.com>
|
126
126
|
# Received: from vw-in-f109.1e100.net [74.125.113.109] by ...
|
@@ -171,7 +171,7 @@ module Sisimai::Bite::Email
|
|
171
171
|
return nil unless mhead['from'].end_with?('<mailer-daemon@googlemail.com>')
|
172
172
|
return nil unless mhead['subject'].start_with?('Delivery Status Notification')
|
173
173
|
|
174
|
-
dscontents = [Sisimai::
|
174
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
175
175
|
hasdivided = mbody.split("\n")
|
176
176
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
177
177
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -228,7 +228,7 @@ module Sisimai::Bite::Email
|
|
228
228
|
# kijitora@example.jp: 550 5.2.2 <kijitora@example>... Mailbox Full
|
229
229
|
if v['recipient']
|
230
230
|
# There are multiple recipient addresses in the message body.
|
231
|
-
dscontents << Sisimai::
|
231
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
232
232
|
v = dscontents[-1]
|
233
233
|
end
|
234
234
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::GSuite parses a bounce email which created by G Suite.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module GSuite
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/GSuite.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
MarkingsOf = {
|
11
11
|
message: %r/\A[*][*][ ].+[ ][*][*]\z/,
|
12
12
|
rfc822: %r{\AContent-Type:[ ]*(?:message/rfc822|text/rfc822-headers)\z},
|
@@ -16,11 +16,11 @@ module Sisimai::Bite::Email
|
|
16
16
|
MessagesOf = {
|
17
17
|
'userunknown' => ["because the address couldn't be found. Check for typos or unnecessary spaces and try again."],
|
18
18
|
'notaccept' => ['Null MX'],
|
19
|
-
'networkerror' => [' responded with code NXDOMAIN'],
|
19
|
+
'networkerror' => [' had no relevant answers.', ' responded with code NXDOMAIN'],
|
20
20
|
}.freeze
|
21
21
|
|
22
22
|
def description; return 'G Suite: https://gsuite.google.com'; end
|
23
|
-
def smtpagent; return Sisimai::
|
23
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
24
24
|
def headerlist; return %w[x-gm-message-state]; end
|
25
25
|
|
26
26
|
# Parse bounce messages from G Suite (Transfer from G Suite to a destinaion host)
|
@@ -34,7 +34,7 @@ module Sisimai::Bite::Email
|
|
34
34
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
35
35
|
# part or nil if it failed to parse or
|
36
36
|
# the arguments are missing
|
37
|
-
def
|
37
|
+
def make(mhead, mbody)
|
38
38
|
return nil unless mhead['from'].end_with?('<mailer-daemon@googlemail.com>')
|
39
39
|
return nil unless mhead['subject'].start_with?('Delivery Status Notification')
|
40
40
|
return nil unless mhead['x-gm-message-state']
|
@@ -43,7 +43,7 @@ module Sisimai::Bite::Email
|
|
43
43
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
44
44
|
permessage = {} # (Hash) Store values of each Per-Message field
|
45
45
|
|
46
|
-
dscontents = [Sisimai::
|
46
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
47
47
|
hasdivided = mbody.split("\n")
|
48
48
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
49
49
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -92,7 +92,7 @@ module Sisimai::Bite::Email
|
|
92
92
|
# Final-Recipient: rfc822; kijitora@example.jp
|
93
93
|
if v['recipient']
|
94
94
|
# There are multiple recipient addresses in the message body.
|
95
|
-
dscontents << Sisimai::
|
95
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
96
96
|
v = dscontents[-1]
|
97
97
|
end
|
98
98
|
v['recipient'] = o[2]
|