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,17 +1,17 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::mFILTER parses a bounce email which created by
|
3
3
|
# Digital Arts m-FILTER.
|
4
4
|
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
module MFILTER
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/mFILTER.pm
|
8
|
+
require 'sisimai/lhost'
|
9
9
|
|
10
|
-
Indicators = Sisimai::
|
10
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
11
11
|
StartingOf = {
|
12
12
|
error: ['-------server message'],
|
13
13
|
command: ['-------SMTP command'],
|
14
|
-
rfc822: ['-------original message', '
|
14
|
+
rfc822: ['-------original message', '-------original mail info'],
|
15
15
|
}.freeze
|
16
16
|
MarkingsOf = { message: %r/\A[^ ]+[@][^ ]+[.][a-zA-Z]+\z/ }.freeze
|
17
17
|
|
@@ -30,12 +30,12 @@ module Sisimai::Bite::Email
|
|
30
30
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
31
31
|
# part or nil if it failed to parse or
|
32
32
|
# the arguments are missing
|
33
|
-
def
|
33
|
+
def make(mhead, mbody)
|
34
34
|
# :'from' => %r/\AMailer Daemon [<]MAILER-DAEMON[@]/,
|
35
35
|
return nil unless mhead['x-mailer'].to_s == 'm-FILTER'
|
36
36
|
return nil unless mhead['subject'] == 'failure notice'
|
37
37
|
|
38
|
-
dscontents = [Sisimai::
|
38
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
39
39
|
hasdivided = mbody.split("\n")
|
40
40
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
41
41
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -93,7 +93,7 @@ module Sisimai::Bite::Email
|
|
93
93
|
# kijitora@example.jp
|
94
94
|
if v['recipient']
|
95
95
|
# There are multiple recipient addresses in the message body.
|
96
|
-
dscontents << Sisimai::
|
96
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
97
97
|
v = dscontents[-1]
|
98
98
|
end
|
99
99
|
v['recipient'] = cv[1]
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::MXLogic parses a bounce email which created by
|
3
3
|
# McAfee SaaS (formerly MX Logic).
|
4
4
|
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
module MXLogic
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
# Based on Sisimai::
|
9
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/MXLogic.pm
|
8
|
+
# Based on Sisimai::Lhost::Exim
|
9
|
+
require 'sisimai/lhost'
|
10
10
|
|
11
|
-
Indicators = Sisimai::
|
11
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
12
12
|
StartingOf = {
|
13
13
|
message: ['This message was created automatically by mail delivery software.'],
|
14
14
|
rfc822: ['Included is a copy of the message header:'],
|
@@ -73,7 +73,7 @@ module Sisimai::Bite::Email
|
|
73
73
|
].freeze
|
74
74
|
|
75
75
|
def description; return 'McAfee SaaS'; end
|
76
|
-
def smtpagent; return Sisimai::
|
76
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
77
77
|
# X-MX-Bounce: mta/src/queue/bounce
|
78
78
|
# X-MXL-NoteHash: ffffffffffffffff-0000000000000000000000000000000000000000
|
79
79
|
# X-MXL-Hash: 4c9d4d411993da17-bbd4212b6c887f6c23bab7db4bd87ef5edc00758
|
@@ -90,7 +90,7 @@ module Sisimai::Bite::Email
|
|
90
90
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
91
91
|
# part or nil if it failed to parse or
|
92
92
|
# the arguments are missing
|
93
|
-
def
|
93
|
+
def make(mhead, mbody)
|
94
94
|
# :'message-id' => %r/\A[<]mxl[~][0-9a-f]+/,
|
95
95
|
match = 0
|
96
96
|
match += 1 if mhead['x-mx-bounce']
|
@@ -105,7 +105,7 @@ module Sisimai::Bite::Email
|
|
105
105
|
}x
|
106
106
|
return nil unless match > 0
|
107
107
|
|
108
|
-
dscontents = [Sisimai::
|
108
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
109
109
|
hasdivided = mbody.split("\n")
|
110
110
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
111
111
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -161,7 +161,7 @@ module Sisimai::Bite::Email
|
|
161
161
|
# <kijitora@example.co.jp>: 550 5.1.1 ...
|
162
162
|
if v['recipient']
|
163
163
|
# There are multiple recipient addresses in the message body.
|
164
|
-
dscontents << Sisimai::
|
164
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
165
165
|
v = dscontents[-1]
|
166
166
|
end
|
167
167
|
v['recipient'] = cv[1]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::::Email::Notes parses a bounce email which created by Lotus
|
3
3
|
# Notes Server. Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Notes
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Notes.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
message: ['------- Failure Reasons '],
|
12
12
|
rfc822: ['------- Returned Message '],
|
@@ -20,7 +20,7 @@ module Sisimai::Bite::Email
|
|
20
20
|
}.freeze
|
21
21
|
|
22
22
|
def description; return 'Lotus Notes'; end
|
23
|
-
def smtpagent; return Sisimai::
|
23
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
24
24
|
def headerlist; return []; end
|
25
25
|
|
26
26
|
# Parse bounce messages from Lotus Notes
|
@@ -34,10 +34,10 @@ 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['subject'].start_with?('Undeliverable message')
|
39
39
|
|
40
|
-
dscontents = [Sisimai::
|
40
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
41
41
|
hasdivided = mbody.split("\n")
|
42
42
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
43
43
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -96,7 +96,7 @@ module Sisimai::Bite::Email
|
|
96
96
|
# kijitora@notes.example.jp
|
97
97
|
if v['recipient']
|
98
98
|
# There are multiple recipient addresses in the message body.
|
99
|
-
dscontents << Sisimai::
|
99
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
100
100
|
v = dscontents[-1]
|
101
101
|
end
|
102
102
|
v['recipient'] ||= e
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Office365 parses a bounce email which created by
|
3
3
|
# Microsoft Office 365.
|
4
4
|
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
module Office365
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Office365.pm
|
8
|
+
require 'sisimai/lhost'
|
9
9
|
|
10
|
-
Indicators = Sisimai::
|
10
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
11
11
|
StartingOf = {
|
12
12
|
rfc822: ['Content-Type: message/rfc822'],
|
13
13
|
error: ['Diagnostic information for administrators:'],
|
@@ -54,8 +54,8 @@ module Sisimai::Bite::Email
|
|
54
54
|
RCPT: %r/unknown recipient or mailbox unavailable ->.+[<]?.+[@].+[.][a-zA-Z]+[>]?/,
|
55
55
|
}.freeze
|
56
56
|
|
57
|
-
def description; return 'Microsoft Office 365:
|
58
|
-
def smtpagent; return Sisimai::
|
57
|
+
def description; return 'Microsoft Office 365: https://office.microsoft.com/'; end
|
58
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
59
59
|
|
60
60
|
def headerlist
|
61
61
|
# X-MS-Exchange-Message-Is-Ndr:
|
@@ -88,7 +88,7 @@ module Sisimai::Bite::Email
|
|
88
88
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
89
89
|
# part or nil if it failed to parse or
|
90
90
|
# the arguments are missing
|
91
|
-
def
|
91
|
+
def make(mhead, mbody)
|
92
92
|
tryto = %r/.+[.](?:outbound[.]protection|prod)[.]outlook[.]com\b/
|
93
93
|
match = 0
|
94
94
|
match += 1 if mhead['subject'].include?('Undeliverable:')
|
@@ -110,7 +110,7 @@ module Sisimai::Bite::Email
|
|
110
110
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
111
111
|
permessage = {} # (Hash) Store values of each Per-Message field
|
112
112
|
|
113
|
-
dscontents = [Sisimai::
|
113
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
114
114
|
hasdivided = mbody.split("\n")
|
115
115
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
116
116
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -161,7 +161,7 @@ module Sisimai::Bite::Email
|
|
161
161
|
# kijitora@example.com<mailto:kijitora@example.com>
|
162
162
|
if v['recipient']
|
163
163
|
# There are multiple recipient addresses in the message body.
|
164
|
-
dscontents << Sisimai::
|
164
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
165
165
|
v = dscontents[-1]
|
166
166
|
end
|
167
167
|
v['recipient'] = cv[1]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::OpenSMTPD parses a bounce email which created by
|
3
3
|
# OpenSMTPD. Methods in the module are called from only Sisimai::Message.
|
4
4
|
module OpenSMTPD
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/OpenSMTPD.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
# http://www.openbsd.org/cgi-bin/man.cgi?query=smtpd&sektion=8
|
12
12
|
# opensmtpd-5.4.2p1/smtpd/
|
@@ -66,7 +66,7 @@ module Sisimai::Bite::Email
|
|
66
66
|
}.freeze
|
67
67
|
|
68
68
|
def description; return 'OpenSMTPD'; end
|
69
|
-
def smtpagent; return Sisimai::
|
69
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
70
70
|
def headerlist; return []; end
|
71
71
|
|
72
72
|
# Parse bounce messages from OpenSMTPD
|
@@ -80,12 +80,12 @@ module Sisimai::Bite::Email
|
|
80
80
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
81
81
|
# part or nil if it failed to parse or
|
82
82
|
# the arguments are missing
|
83
|
-
def
|
83
|
+
def make(mhead, mbody)
|
84
84
|
return nil unless mhead['subject'].start_with?('Delivery status notification')
|
85
85
|
return nil unless mhead['from'].start_with?('Mailer Daemon <')
|
86
86
|
return nil unless mhead['received'].any? { |a| a.include?(' (OpenSMTPD) with ') }
|
87
87
|
|
88
|
-
dscontents = [Sisimai::
|
88
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
89
89
|
hasdivided = mbody.split("\n")
|
90
90
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
91
91
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -139,7 +139,7 @@ module Sisimai::Bite::Email
|
|
139
139
|
# kijitora@example.jp: 550 5.2.2 <kijitora@example>... Mailbox Full
|
140
140
|
if v['recipient']
|
141
141
|
# There are multiple recipient addresses in the message body.
|
142
|
-
dscontents << Sisimai::
|
142
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
143
143
|
v = dscontents[-1]
|
144
144
|
end
|
145
145
|
v['recipient'] = cv[1]
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Outlook parses a bounce email which created by
|
3
3
|
# Microsoft Outlook.com.
|
4
4
|
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
module Outlook
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/US/Outlook.pm
|
8
|
+
require 'sisimai/lhost'
|
9
9
|
|
10
|
-
Indicators = Sisimai::
|
10
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
11
11
|
StartingOf = {
|
12
12
|
message: ['This is an automatically generated Delivery Status Notification'],
|
13
13
|
rfc822: ['Content-Type: message/rfc822'],
|
@@ -18,7 +18,7 @@ module Sisimai::Bite::Email
|
|
18
18
|
}.freeze
|
19
19
|
|
20
20
|
def description; return 'Microsoft Outlook.com: https://www.outlook.com/'; end
|
21
|
-
def smtpagent; return Sisimai::
|
21
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
22
22
|
|
23
23
|
# X-Message-Delivery: Vj0xLjE7RD0wO0dEPTA7U0NMPTk7bD0xO3VzPTE=
|
24
24
|
# X-Message-Info: AuEzbeVr9u5fkDpn2vR5iCu5wb6HBeY4iruBjnutBzpStnUabbM...
|
@@ -35,7 +35,7 @@ module Sisimai::Bite::Email
|
|
35
35
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
36
36
|
# part or nil if it failed to parse or
|
37
37
|
# the arguments are missing
|
38
|
-
def
|
38
|
+
def make(mhead, mbody)
|
39
39
|
# :from => %r/postmaster[@]/,
|
40
40
|
match = 0
|
41
41
|
match += 1 if mhead['subject'].start_with?('Delivery Status Notification')
|
@@ -48,7 +48,7 @@ module Sisimai::Bite::Email
|
|
48
48
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
49
49
|
permessage = {} # (Hash) Store values of each Per-Message field
|
50
50
|
|
51
|
-
dscontents = [Sisimai::
|
51
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
52
52
|
hasdivided = mbody.split("\n")
|
53
53
|
havepassed = ['']
|
54
54
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
@@ -103,7 +103,7 @@ module Sisimai::Bite::Email
|
|
103
103
|
# Final-Recipient: rfc822; kijitora@example.jp
|
104
104
|
if v['recipient']
|
105
105
|
# There are multiple recipient addresses in the message body.
|
106
|
-
dscontents << Sisimai::
|
106
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
107
107
|
v = dscontents[-1]
|
108
108
|
end
|
109
109
|
v['recipient'] = o[2]
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Postfix parses a bounce email which created by
|
3
3
|
# Postfix. Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Postfix
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/Postfix.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
9
|
# Postfix manual - bounce(5) - http://www.postfix.org/bounce.5.html
|
10
|
-
Indicators = Sisimai::
|
10
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
11
11
|
StartingOf = { rfc822: ['Content-Type: message/rfc822', 'Content-Type: text/rfc822-headers'] }.freeze
|
12
12
|
MarkingsOf = {
|
13
13
|
message: %r{\A(?>
|
@@ -31,7 +31,7 @@ module Sisimai::Bite::Email
|
|
31
31
|
}.freeze
|
32
32
|
|
33
33
|
def description; return 'Postfix'; end
|
34
|
-
def smtpagent; return Sisimai::
|
34
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
35
35
|
def headerlist; return []; end
|
36
36
|
|
37
37
|
# Parse bounce messages from Postfix
|
@@ -45,7 +45,7 @@ module Sisimai::Bite::Email
|
|
45
45
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
46
46
|
# part or nil if it failed to parse or
|
47
47
|
# the arguments are missing
|
48
|
-
def
|
48
|
+
def make(mhead, mbody)
|
49
49
|
# :from => %r/ [(]Mail Delivery System[)]\z/,
|
50
50
|
return nil unless mhead['subject'] == 'Undelivered Mail Returned to Sender'
|
51
51
|
|
@@ -53,7 +53,7 @@ module Sisimai::Bite::Email
|
|
53
53
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
54
54
|
permessage = {} # (Hash) Store values of each Per-Message field
|
55
55
|
|
56
|
-
dscontents = [Sisimai::
|
56
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
57
57
|
hasdivided = mbody.split("\n")
|
58
58
|
havepassed = ['']
|
59
59
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
@@ -110,7 +110,7 @@ module Sisimai::Bite::Email
|
|
110
110
|
# Final-Recipient: rfc822; kijitora@example.jp
|
111
111
|
if v['recipient']
|
112
112
|
# There are multiple recipient addresses in the message body.
|
113
|
-
dscontents << Sisimai::
|
113
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
114
114
|
v = dscontents[-1]
|
115
115
|
end
|
116
116
|
v['recipient'] = o[2]
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::Qmail parses a bounce email which created by qmail.
|
3
3
|
# Methods in the module are called from only Sisimai::Message.
|
4
4
|
module Qmail
|
5
5
|
class << self
|
6
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
7
|
-
require 'sisimai/
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/qmail.pm
|
7
|
+
require 'sisimai/lhost'
|
8
8
|
|
9
|
-
Indicators = Sisimai::
|
9
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
10
10
|
StartingOf = {
|
11
11
|
# qmail-remote.c:248| if (code >= 500) {
|
12
12
|
# qmail-remote.c:249| out("h"); outhost(); out(" does not like recipient.\n");
|
@@ -114,9 +114,9 @@ module Sisimai::Bite::Email
|
|
114
114
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
115
115
|
# part or nil if it failed to parse or
|
116
116
|
# the arguments are missing
|
117
|
-
def
|
117
|
+
def make(mhead, mbody)
|
118
118
|
# Pre process email headers and the body part of the message which generated
|
119
|
-
# by qmail, see
|
119
|
+
# by qmail, see https://cr.yp.to/qmail.html
|
120
120
|
# e.g.) Received: (qmail 12345 invoked for bounce); 29 Apr 2009 12:34:56 -0000
|
121
121
|
# Subject: failure notice
|
122
122
|
tryto = /\A[(]qmail[ ]+\d+[ ]+invoked[ ]+(?:for[ ]+bounce|from[ ]+network)[)]/
|
@@ -125,7 +125,7 @@ module Sisimai::Bite::Email
|
|
125
125
|
match += 1 if mhead['received'].any? { |a| a =~ tryto }
|
126
126
|
return nil unless match > 0
|
127
127
|
|
128
|
-
dscontents = [Sisimai::
|
128
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
129
129
|
hasdivided = mbody.split("\n")
|
130
130
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
131
131
|
blanklines = 0 # (Integer) The number of blank lines
|
@@ -173,7 +173,7 @@ module Sisimai::Bite::Email
|
|
173
173
|
# <kijitora@example.jp>:
|
174
174
|
if v['recipient']
|
175
175
|
# There are multiple recipient addresses in the message body.
|
176
|
-
dscontents << Sisimai::
|
176
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
177
177
|
v = dscontents[-1]
|
178
178
|
end
|
179
179
|
v['recipient'] = cv[1]
|
@@ -1,14 +1,14 @@
|
|
1
|
-
module Sisimai::
|
2
|
-
# Sisimai::
|
1
|
+
module Sisimai::Lhost
|
2
|
+
# Sisimai::Lhost::ReceivingSES parses a bounce email which created
|
3
3
|
# by Amazon Simple Email Service. Methods in the module are called from
|
4
4
|
# only Sisimai::Message.
|
5
5
|
module ReceivingSES
|
6
6
|
class << self
|
7
|
-
# Imported from p5-Sisimail/lib/Sisimai/
|
8
|
-
require 'sisimai/
|
7
|
+
# Imported from p5-Sisimail/lib/Sisimai/Lhost/ReceivingSES.pm
|
8
|
+
require 'sisimai/lhost'
|
9
9
|
|
10
|
-
#
|
11
|
-
Indicators = Sisimai::
|
10
|
+
# https://aws.amazon.com/ses/
|
11
|
+
Indicators = Sisimai::Lhost.INDICATORS
|
12
12
|
StartingOf = {
|
13
13
|
message: ['This message could not be delivered.'],
|
14
14
|
rfc822: ['content-type: text/rfc822-headers'],
|
@@ -21,8 +21,8 @@ module Sisimai::Bite::Email
|
|
21
21
|
'contenterror' => ['Message content rejected'],
|
22
22
|
}.freeze
|
23
23
|
|
24
|
-
def description; return 'Amazon SES(Receiving):
|
25
|
-
def smtpagent; return Sisimai::
|
24
|
+
def description; return 'Amazon SES(Receiving): https://aws.amazon.com/ses/'; end
|
25
|
+
def smtpagent; return Sisimai::Lhost.smtpagent(self); end
|
26
26
|
|
27
27
|
# X-SES-Outgoing: 2015.10.01-54.240.27.7
|
28
28
|
# Feedback-ID: 1.us-west-2.HX6/J9OVlHTadQhEu1+wdF9DBj6n6Pa9sW5Y/0pSOi8=:AmazonSES
|
@@ -39,7 +39,7 @@ module Sisimai::Bite::Email
|
|
39
39
|
# @return [Hash, Nil] Bounce data list and message/rfc822
|
40
40
|
# part or nil if it failed to parse or
|
41
41
|
# the arguments are missing
|
42
|
-
def
|
42
|
+
def make(mhead, mbody)
|
43
43
|
# :subject => %r/\ADelivery Status Notification [(]Failure[)]\z/,
|
44
44
|
# :received => %r/.+[.]smtp-out[.].+[.]amazonses[.]com\b/,
|
45
45
|
return nil unless mhead['x-ses-outgoing']
|
@@ -48,7 +48,7 @@ module Sisimai::Bite::Email
|
|
48
48
|
fieldtable = Sisimai::RFC1894.FIELDTABLE
|
49
49
|
permessage = {} # (Hash) Store values of each Per-Message field
|
50
50
|
|
51
|
-
dscontents = [Sisimai::
|
51
|
+
dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
|
52
52
|
hasdivided = mbody.split("\n")
|
53
53
|
havepassed = ['']
|
54
54
|
rfc822list = [] # (Array) Each line in message/rfc822 part string
|
@@ -103,7 +103,7 @@ module Sisimai::Bite::Email
|
|
103
103
|
# Final-Recipient: rfc822; kijitora@example.jp
|
104
104
|
if v['recipient']
|
105
105
|
# There are multiple recipient addresses in the message body.
|
106
|
-
dscontents << Sisimai::
|
106
|
+
dscontents << Sisimai::Lhost.DELIVERYSTATUS
|
107
107
|
v = dscontents[-1]
|
108
108
|
end
|
109
109
|
v['recipient'] = o[2]
|