sisimai 4.22.1 → 4.22.2
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 +4 -4
- data/ChangeLog.md +21 -0
- data/README-JA.md +2 -2
- data/README.md +2 -2
- data/lib/sisimai.rb +2 -3
- data/lib/sisimai/address.rb +20 -40
- data/lib/sisimai/arf.rb +4 -4
- data/lib/sisimai/bite.rb +1 -0
- data/lib/sisimai/bite/email.rb +3 -4
- data/lib/sisimai/bite/email/activehunter.rb +7 -7
- data/lib/sisimai/bite/email/amazonses.rb +14 -14
- data/lib/sisimai/bite/email/amazonworkmail.rb +7 -7
- data/lib/sisimai/bite/email/aol.rb +8 -8
- data/lib/sisimai/bite/email/apachejames.rb +7 -7
- data/lib/sisimai/bite/email/bigfoot.rb +7 -7
- data/lib/sisimai/bite/email/biglobe.rb +7 -7
- data/lib/sisimai/bite/email/courier.rb +9 -9
- data/lib/sisimai/bite/email/domino.rb +8 -8
- data/lib/sisimai/bite/email/einsundeins.rb +7 -7
- data/lib/sisimai/bite/email/exchange2003.rb +10 -10
- data/lib/sisimai/bite/email/exchange2007.rb +10 -10
- data/lib/sisimai/bite/email/exim.rb +18 -19
- data/lib/sisimai/bite/email/ezweb.rb +9 -11
- data/lib/sisimai/bite/email/facebook.rb +22 -23
- data/lib/sisimai/bite/email/gmx.rb +7 -7
- data/lib/sisimai/bite/email/google.rb +22 -25
- data/lib/sisimai/bite/email/gsuite.rb +17 -19
- data/lib/sisimai/bite/email/imailserver.rb +13 -13
- data/lib/sisimai/bite/email/interscanmss.rb +7 -7
- data/lib/sisimai/bite/email/kddi.rb +7 -7
- data/lib/sisimai/bite/email/mailfoundry.rb +6 -6
- data/lib/sisimai/bite/email/mailmarshalsmtp.rb +13 -13
- data/lib/sisimai/bite/email/mailru.rb +10 -10
- data/lib/sisimai/bite/email/mcafee.rb +7 -7
- data/lib/sisimai/bite/email/messagelabs.rb +9 -9
- data/lib/sisimai/bite/email/messagingserver.rb +8 -8
- data/lib/sisimai/bite/email/mfilter.rb +7 -7
- data/lib/sisimai/bite/email/mxlogic.rb +9 -9
- data/lib/sisimai/bite/email/notes.rb +12 -12
- data/lib/sisimai/bite/email/office365.rb +14 -15
- data/lib/sisimai/bite/email/opensmtpd.rb +7 -7
- data/lib/sisimai/bite/email/outlook.rb +9 -9
- data/lib/sisimai/bite/email/postfix.rb +13 -13
- data/lib/sisimai/bite/email/qmail.rb +9 -9
- data/lib/sisimai/bite/email/receivingses.rb +9 -9
- data/lib/sisimai/bite/email/sendgrid.rb +9 -9
- data/lib/sisimai/bite/email/sendmail.rb +7 -7
- data/lib/sisimai/bite/email/surfcontrol.rb +7 -7
- data/lib/sisimai/bite/email/userdefined.rb +7 -7
- data/lib/sisimai/bite/email/v5sendmail.rb +21 -22
- data/lib/sisimai/bite/email/verizon.rb +8 -8
- data/lib/sisimai/bite/email/x1.rb +6 -6
- data/lib/sisimai/bite/email/x2.rb +6 -6
- data/lib/sisimai/bite/email/x3.rb +6 -6
- data/lib/sisimai/bite/email/x4.rb +9 -9
- data/lib/sisimai/bite/email/x5.rb +6 -6
- data/lib/sisimai/bite/email/yahoo.rb +7 -7
- data/lib/sisimai/bite/email/yandex.rb +7 -7
- data/lib/sisimai/bite/email/zoho.rb +8 -8
- data/lib/sisimai/bite/json.rb +10 -11
- data/lib/sisimai/bite/json/amazonses.rb +11 -11
- data/lib/sisimai/bite/json/sendgrid.rb +67 -17
- data/lib/sisimai/data.rb +19 -21
- data/lib/sisimai/data/json.rb +3 -3
- data/lib/sisimai/data/yaml.rb +3 -3
- data/lib/sisimai/datetime.rb +18 -21
- data/lib/sisimai/mail.rb +1 -1
- data/lib/sisimai/mail/stdin.rb +2 -2
- data/lib/sisimai/mda.rb +4 -4
- data/lib/sisimai/message.rb +1 -1
- data/lib/sisimai/message/email.rb +32 -35
- data/lib/sisimai/message/json.rb +3 -3
- data/lib/sisimai/mime.rb +5 -6
- data/lib/sisimai/order/email.rb +11 -11
- data/lib/sisimai/order/json.rb +3 -3
- data/lib/sisimai/reason.rb +2 -2
- data/lib/sisimai/reason/userunknown.rb +4 -5
- data/lib/sisimai/rfc3464.rb +14 -16
- data/lib/sisimai/rfc3834.rb +5 -5
- data/lib/sisimai/rfc5322.rb +2 -2
- data/lib/sisimai/rhost.rb +6 -5
- data/lib/sisimai/rhost/exchangeonline.rb +1 -1
- data/lib/sisimai/rhost/godaddy.rb +87 -0
- data/lib/sisimai/rhost/googleapps.rb +1 -1
- data/lib/sisimai/smtp/error.rb +21 -27
- data/lib/sisimai/smtp/status.rb +2 -2
- data/lib/sisimai/string.rb +7 -7
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/jsonobj/json-sendgrid-12.json +1 -0
- data/set-of-emails/jsonobj/json-sendgrid-13.json +1 -0
- data/set-of-emails/jsonobj/json-sendgrid-14.json +1 -0
- data/set-of-emails/jsonobj/json-sendgrid-15.json +1 -0
- data/set-of-emails/jsonobj/json-sendgrid-16.json +1 -0
- data/set-of-emails/jsonobj/json-sendgrid-17.json +1 -0
- data/set-of-emails/maildir/bsd/rhost-godaddy-01.eml +83 -0
- data/set-of-emails/maildir/bsd/rhost-godaddy-02.eml +69 -0
- metadata +12 -6
- data/lib/sisimai/ced.rb +0 -48
- data/lib/sisimai/msp.rb +0 -39
- data/lib/sisimai/mta.rb +0 -39
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Aol parses a bounce email which created by Aol Mail.
|
3
|
+
# Methods in the module are called from only Sisimai::Message.
|
2
4
|
module Aol
|
3
|
-
# Sisimai::Bite::Email::Aol parses a bounce email which created by Aol Mail.
|
4
|
-
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Aol.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -9,16 +9,16 @@ module Sisimai::Bite::Email
|
|
9
9
|
Re0 = {
|
10
10
|
:from => %r/\APostmaster [<]Postmaster[@]AOL[.]com[>]\z/,
|
11
11
|
:subject => %r/\AUndeliverable: /,
|
12
|
-
}
|
12
|
+
}.freeze
|
13
13
|
Re1 = {
|
14
14
|
:begin => %r|\AContent-Type: message/delivery-status|,
|
15
15
|
:rfc822 => %r|\AContent-Type: message/rfc822|,
|
16
16
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
17
|
-
}
|
17
|
+
}.freeze
|
18
18
|
ReFailure = {
|
19
19
|
hostunknown: %r/Host[ ]or[ ]domain[ ]name[ ]not[ ]found/,
|
20
20
|
notaccept: %r/type=MX:[ ]Malformed[ ]or[ ]unexpected[ ]name[ ]server[ ]reply/,
|
21
|
-
}
|
21
|
+
}.freeze
|
22
22
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
23
23
|
|
24
24
|
def description; return 'Aol Mail: http://www.aol.com'; end
|
@@ -60,7 +60,7 @@ module Sisimai::Bite::Email
|
|
60
60
|
blanklines = 0 # (Integer) The number of blank lines
|
61
61
|
readcursor = 0 # (Integer) Points the current cursor position
|
62
62
|
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
63
|
-
connvalues = 0 # (Integer) Flag, 1 if all the value of
|
63
|
+
connvalues = 0 # (Integer) Flag, 1 if all the value of connheader have been set
|
64
64
|
connheader = {
|
65
65
|
'date' => '', # The value of Arrival-Date header
|
66
66
|
'lhost' => '', # The value of Reporting-MTA header
|
@@ -80,7 +80,7 @@ module Sisimai::Bite::Email
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
if readcursor & Indicators[:'message-rfc822']
|
83
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
84
84
|
# Beginning of the original message part
|
85
85
|
if e =~ Re1[:rfc822]
|
86
86
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -99,7 +99,7 @@ module Sisimai::Bite::Email
|
|
99
99
|
|
100
100
|
else
|
101
101
|
# Before "message/rfc822"
|
102
|
-
next if readcursor & Indicators[:deliverystatus]
|
102
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
103
103
|
next if e.empty?
|
104
104
|
|
105
105
|
if connvalues == connheader.keys.size
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::::Email::ApacheJames parses a bounce email which created by
|
3
|
+
# ApacheJames. Methods in the module are called from only Sisimai::Message.
|
2
4
|
module ApacheJames
|
3
|
-
# Sisimai::Bite::::Email::ApacheJames parses a bounce email which created by
|
4
|
-
# ApacheJames. Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/ApacheJames.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -10,7 +10,7 @@ module Sisimai::Bite::Email
|
|
10
10
|
:'subject' => %r/\A\[BOUNCE\]\z/,
|
11
11
|
:'received' => %r/JAMES SMTP Server/,
|
12
12
|
:'message-id' => %r/\d+[.]JavaMail[.].+[@]/,
|
13
|
-
}
|
13
|
+
}.freeze
|
14
14
|
Re1 = {
|
15
15
|
# apache-james-2.3.2/src/java/org/apache/james/transport/mailets/
|
16
16
|
# AbstractNotify.java|124: out.println("Error message below:");
|
@@ -19,7 +19,7 @@ module Sisimai::Bite::Email
|
|
19
19
|
:error => %r/\AError message below:\z/,
|
20
20
|
:rfc822 => %r|\AContent-Type: message/rfc822|,
|
21
21
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
22
|
-
}
|
22
|
+
}.freeze
|
23
23
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
24
24
|
|
25
25
|
def description; return 'Java Apache Mail Enterprise Server'; end
|
@@ -68,7 +68,7 @@ module Sisimai::Bite::Email
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
if readcursor & Indicators[:'message-rfc822']
|
71
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
72
72
|
# Beginning of the original message part
|
73
73
|
if e =~ Re1[:rfc822]
|
74
74
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -87,7 +87,7 @@ module Sisimai::Bite::Email
|
|
87
87
|
|
88
88
|
else
|
89
89
|
# Before "message/rfc822"
|
90
|
-
next if readcursor & Indicators[:deliverystatus]
|
90
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
91
91
|
next if e.empty?
|
92
92
|
|
93
93
|
# Message details:
|
@@ -148,7 +148,7 @@ module Sisimai::Bite::Email
|
|
148
148
|
require 'sisimai/string'
|
149
149
|
|
150
150
|
unless rfc822list.find { |a| a =~ /^Subject:/ }
|
151
|
-
# Set the value of
|
151
|
+
# Set the value of subjecttxt as a Subject if there is no original
|
152
152
|
# message in the bounce mail.
|
153
153
|
rfc822list << sprintf('Subject: %s', subjecttxt)
|
154
154
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Bigfoot parses a bounce email which created by Bigfoot.
|
3
|
+
# Methods in the module are called from only Sisimai::Message.
|
2
4
|
module Bigfoot
|
3
|
-
# Sisimai::Bite::Email::Bigfoot parses a bounce email which created by Bigfoot.
|
4
|
-
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Bigfoot.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -10,12 +10,12 @@ module Sisimai::Bite::Email
|
|
10
10
|
:from => %r/[@]bigfoot[.]com[>]/,
|
11
11
|
:subject => %r/\AReturned mail: /,
|
12
12
|
:received => %r/\w+[.]bigfoot[.]com\b/,
|
13
|
-
}
|
13
|
+
}.freeze
|
14
14
|
Re1 = {
|
15
15
|
:begin => %r/\A[ \t]+[-]+[ \t]*Transcript of session follows/,
|
16
16
|
:rfc822 => %r|\AContent-Type: message/partial|,
|
17
17
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
18
|
-
}
|
18
|
+
}.freeze
|
19
19
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
20
20
|
|
21
21
|
def description; return 'Bigfoot: http://www.bigfoot.com'; end
|
@@ -53,7 +53,7 @@ module Sisimai::Bite::Email
|
|
53
53
|
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
54
54
|
commandtxt = '' # (String) SMTP Command name begin with the string '>>>'
|
55
55
|
esmtpreply = '' # (String) Reply from remote server on SMTP session
|
56
|
-
connvalues = 0 # (Integer) Flag, 1 if all the value of
|
56
|
+
connvalues = 0 # (Integer) Flag, 1 if all the value of connheader have been set
|
57
57
|
connheader = {
|
58
58
|
'date' => '', # The value of Arrival-Date header
|
59
59
|
'lhost' => '', # The value of Reporting-MTA header
|
@@ -73,7 +73,7 @@ module Sisimai::Bite::Email
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
if readcursor & Indicators[:'message-rfc822']
|
76
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
77
77
|
# Beginning of the original message part
|
78
78
|
if e =~ Re1[:rfc822]
|
79
79
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -92,7 +92,7 @@ module Sisimai::Bite::Email
|
|
92
92
|
|
93
93
|
else
|
94
94
|
# Before "message/rfc822"
|
95
|
-
next if readcursor & Indicators[:deliverystatus]
|
95
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
96
96
|
next if e.empty?
|
97
97
|
|
98
98
|
if connvalues == connheader.keys.size
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Biglobe parses a bounce email which created by BIGLOBE.
|
3
|
+
# Methods in the module are called from only Sisimai::Message.
|
2
4
|
module Biglobe
|
3
|
-
# Sisimai::Bite::Email::Biglobe parses a bounce email which created by BIGLOBE.
|
4
|
-
# Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Biglobe.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -9,17 +9,17 @@ module Sisimai::Bite::Email
|
|
9
9
|
Re0 = {
|
10
10
|
:subject => %r/\AReturned mail:/,
|
11
11
|
:from => %r/postmaster[@](?:biglobe|inacatv|tmtv|ttv)[.]ne[.]jp/,
|
12
|
-
}
|
12
|
+
}.freeze
|
13
13
|
Re1 = {
|
14
14
|
:begin => %r/\A ----- The following addresses had delivery problems -----\z/,
|
15
15
|
:error => %r/\A ----- Non-delivered information -----\z/,
|
16
16
|
:rfc822 => %r|\AContent-Type: message/rfc822\z|,
|
17
17
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
18
|
-
}
|
18
|
+
}.freeze
|
19
19
|
ReFailure = {
|
20
20
|
filtered: %r/Mail Delivery Failed[.]+ User unknown/,
|
21
21
|
mailboxfull: %r/The number of messages in recipient's mailbox exceeded the local limit[.]/,
|
22
|
-
}
|
22
|
+
}.freeze
|
23
23
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
24
24
|
|
25
25
|
def description; return 'BIGLOBE: http://www.biglobe.ne.jp'; end
|
@@ -62,7 +62,7 @@ module Sisimai::Bite::Email
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
if readcursor & Indicators[:'message-rfc822']
|
65
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
66
66
|
# Beginning of the original message part
|
67
67
|
if e =~ Re1[:rfc822]
|
68
68
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -81,7 +81,7 @@ module Sisimai::Bite::Email
|
|
81
81
|
|
82
82
|
else
|
83
83
|
# Before "message/rfc822"
|
84
|
-
next if readcursor & Indicators[:deliverystatus]
|
84
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
85
85
|
next if e.empty?
|
86
86
|
|
87
87
|
# This is a MIME-encapsulated message.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Courier parses a bounce email which created by Courier
|
3
|
+
# MTA. Methods in the module are called from only Sisimai::Message.
|
2
4
|
module Courier
|
3
|
-
# Sisimai::Bite::Email::Courier parses a bounce email which created by Courier
|
4
|
-
# MTA. Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Courier.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -16,7 +16,7 @@ module Sisimai::Bite::Email
|
|
16
16
|
)
|
17
17
|
}x,
|
18
18
|
:'message-id' => %r/\A[<]courier[.][0-9A-F]+[.]/,
|
19
|
-
}
|
19
|
+
}.freeze
|
20
20
|
Re1 = {
|
21
21
|
:begin => %r{(?:
|
22
22
|
DELAYS[ ]IN[ ]DELIVERING[ ]YOUR[ ]MESSAGE
|
@@ -29,18 +29,18 @@ module Sisimai::Bite::Email
|
|
29
29
|
)\z
|
30
30
|
}x,
|
31
31
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
32
|
-
}
|
32
|
+
}.freeze
|
33
33
|
ReFailure = {
|
34
34
|
# courier/module.esmtp/esmtpclient.c:526| hard_error(del, ctf, "No such domain.");
|
35
35
|
hostunknown: %r/\ANo[ ]such[ ]domain[.]\z/x,
|
36
36
|
# courier/module.esmtp/esmtpclient.c:531| hard_error(del, ctf,
|
37
37
|
# courier/module.esmtp/esmtpclient.c:532| "This domain's DNS violates RFC 1035.");
|
38
38
|
systemerror: %r/\AThis[ ]domain's[ ]DNS[ ]violates[ ]RFC[ ]1035[.]\z/x,
|
39
|
-
}
|
39
|
+
}.freeze
|
40
40
|
ReDelayed = {
|
41
41
|
# courier/module.esmtp/esmtpclient.c:535| soft_error(del, ctf, "DNS lookup failed.");
|
42
42
|
networkerror: %r/\ADNS[ ]lookup[ ]failed[.]\z/x,
|
43
|
-
}
|
43
|
+
}.freeze
|
44
44
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
45
45
|
|
46
46
|
def description; return 'Courier MTA'; end
|
@@ -80,7 +80,7 @@ module Sisimai::Bite::Email
|
|
80
80
|
readcursor = 0 # (Integer) Points the current cursor position
|
81
81
|
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
82
82
|
commandtxt = '' # (String) SMTP Command name begin with the string '>>>'
|
83
|
-
connvalues = 0 # (Integer) Flag, 1 if all the value of
|
83
|
+
connvalues = 0 # (Integer) Flag, 1 if all the value of connheader have been set
|
84
84
|
connheader = {
|
85
85
|
'date' => '', # The value of Arrival-Date header
|
86
86
|
'rhost' => '', # The value of Reporting-MTA header
|
@@ -101,7 +101,7 @@ module Sisimai::Bite::Email
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
-
if readcursor & Indicators[:'message-rfc822']
|
104
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
105
105
|
# Beginning of the original message part
|
106
106
|
if e =~ Re1[:rfc822]
|
107
107
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -120,7 +120,7 @@ module Sisimai::Bite::Email
|
|
120
120
|
|
121
121
|
else
|
122
122
|
# Before "message/rfc822"
|
123
|
-
next if readcursor & Indicators[:deliverystatus]
|
123
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
124
124
|
next if e.empty?
|
125
125
|
|
126
126
|
if connvalues == connheader.keys.size
|
@@ -1,19 +1,19 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Domino parses a bounce email which created by IBM
|
3
|
+
# Domino Server. Methods in the module are called from only Sisimai::Message.
|
2
4
|
module Domino
|
3
|
-
# Sisimai::Bite::Email::Domino parses a bounce email which created by IBM
|
4
|
-
# Domino Server. Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Domino.pm
|
7
7
|
require 'sisimai/bite/email'
|
8
8
|
|
9
9
|
Re0 = {
|
10
10
|
:subject => %r/\ADELIVERY FAILURE:/,
|
11
|
-
}
|
11
|
+
}.freeze
|
12
12
|
Re1 = {
|
13
13
|
:begin => %r/\AYour message/,
|
14
14
|
:rfc822 => %r|\AContent-Type: message/delivery-status\z|,
|
15
15
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
16
|
-
}
|
16
|
+
}.freeze
|
17
17
|
ReFailure = {
|
18
18
|
userunknown: %r{(?>
|
19
19
|
not[ ]listed[ ]in[ ](?:
|
@@ -25,7 +25,7 @@ module Sisimai::Bite::Email
|
|
25
25
|
}x,
|
26
26
|
filtered: %r/Cannot[ ]route[ ]mail[ ]to[ ]user/x,
|
27
27
|
systemerror: %r/Several[ ]matches[ ]found[ ]in[ ]Domino[ ]Directory/x,
|
28
|
-
}
|
28
|
+
}.freeze
|
29
29
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
30
30
|
|
31
31
|
def description; return 'IBM Domino Server'; end
|
@@ -70,7 +70,7 @@ module Sisimai::Bite::Email
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
if readcursor & Indicators[:'message-rfc822']
|
73
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
74
74
|
# Beginning of the original message part
|
75
75
|
if e =~ Re1[:rfc822]
|
76
76
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -89,7 +89,7 @@ module Sisimai::Bite::Email
|
|
89
89
|
|
90
90
|
else
|
91
91
|
# Before "message/rfc822"
|
92
|
-
next if readcursor & Indicators[:deliverystatus]
|
92
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
93
93
|
|
94
94
|
# Your message
|
95
95
|
#
|
@@ -159,7 +159,7 @@ module Sisimai::Bite::Email
|
|
159
159
|
end
|
160
160
|
|
161
161
|
unless rfc822list.find { |a| a =~ /^Subject:/ }
|
162
|
-
# Set the value of
|
162
|
+
# Set the value of subjecttxt as a Subject if there is no original
|
163
163
|
# message in the bounce mail.
|
164
164
|
rfc822list << sprintf('Subject: %s', subjecttxt)
|
165
165
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::EinsUndEins parses a bounce email which created by
|
3
|
+
# 1&1. Methods in the module are called from only Sisimai::Message.
|
2
4
|
module EinsUndEins
|
3
|
-
# Sisimai::Bite::Email::EinsUndEins parses a bounce email which created by
|
4
|
-
# 1&1. Methods in the module are called from only Sisimai::Message.
|
5
5
|
class << self
|
6
6
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/EinsUndEins.pm
|
7
7
|
require 'sisimai/bite/email'
|
@@ -9,16 +9,16 @@ module Sisimai::Bite::Email
|
|
9
9
|
Re0 = {
|
10
10
|
:from => %r/\A["]Mail Delivery System["]/,
|
11
11
|
:subject => %r/\AMail delivery failed: returning message to sender\z/,
|
12
|
-
}
|
12
|
+
}.freeze
|
13
13
|
Re1 = {
|
14
14
|
:begin => %r/\AThis message was created automatically by mail delivery software/,
|
15
15
|
:error => %r/\AFor the following reason:/,
|
16
16
|
:rfc822 => %r/\A--- The header of the original message is following/,
|
17
17
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
18
|
-
}
|
18
|
+
}.freeze
|
19
19
|
ReFailure = {
|
20
20
|
mesgtoobig: %r/Mail[ ]size[ ]limit[ ]exceeded/x,
|
21
|
-
}
|
21
|
+
}.freeze
|
22
22
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
23
23
|
|
24
24
|
def description; return '1&1: http://www.1and1.de'; end
|
@@ -61,7 +61,7 @@ module Sisimai::Bite::Email
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
if readcursor & Indicators[:'message-rfc822']
|
64
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
65
65
|
# Beginning of the original message part
|
66
66
|
if e =~ Re1[:rfc822]
|
67
67
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -80,7 +80,7 @@ module Sisimai::Bite::Email
|
|
80
80
|
|
81
81
|
else
|
82
82
|
# Before "message/rfc822"
|
83
|
-
next if readcursor & Indicators[:deliverystatus]
|
83
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
84
84
|
next if e.empty?
|
85
85
|
|
86
86
|
# The following address failed:
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Sisimai::Bite::Email
|
2
|
+
# Sisimai::Bite::Email::Exchange2003 parses a bounce email which created by
|
3
|
+
# Microsoft Exchange Server 2003.
|
4
|
+
# Methods in the module are called from only Sisimai::Message.
|
2
5
|
module Exchange2003
|
3
|
-
# Sisimai::Bite::Email::Exchange2003 parses a bounce email which created by
|
4
|
-
# Microsoft Exchange Server 2003.
|
5
|
-
# Methods in the module are called from only Sisimai::Message.
|
6
6
|
class << self
|
7
7
|
# Imported from p5-Sisimail/lib/Sisimai/Bite/Email/Exchange2003.pm
|
8
8
|
require 'sisimai/bite/email'
|
@@ -18,13 +18,13 @@ module Sisimai::Bite::Email
|
|
18
18
|
:'x-mimeole' => %r/\AProduced By Microsoft Exchange/,
|
19
19
|
# Received: by ***.**.** with Internet Mail Service (5.5.2657.72)
|
20
20
|
:'received' => %r/\Aby .+ with Internet Mail Service [(][\d.]+[)]/,
|
21
|
-
}
|
21
|
+
}.freeze
|
22
22
|
Re1 = {
|
23
23
|
:begin => %r/\AYour message/,
|
24
24
|
:error => %r/\Adid not reach the following recipient[(]s[)]:/,
|
25
25
|
:rfc822 => %r|\AContent-Type: message/rfc822|,
|
26
26
|
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
27
|
-
}
|
27
|
+
}.freeze
|
28
28
|
CodeTable = {
|
29
29
|
onhold: [
|
30
30
|
'000B099C', # Host Unknown, Message exceeds size limit, ...
|
@@ -51,7 +51,7 @@ module Sisimai::Bite::Email
|
|
51
51
|
filtered: [
|
52
52
|
'000C0595', # Ambiguous Recipient
|
53
53
|
],
|
54
|
-
}
|
54
|
+
}.freeze
|
55
55
|
Indicators = Sisimai::Bite::Email.INDICATORS
|
56
56
|
|
57
57
|
def description; return 'Microsoft Exchange Server 2003'; end
|
@@ -112,7 +112,7 @@ module Sisimai::Bite::Email
|
|
112
112
|
readcursor = 0 # (Integer) Points the current cursor position
|
113
113
|
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
114
114
|
statuspart = false # (Boolean) Flag, true = have got delivery status part.
|
115
|
-
connvalues = 0 # (Integer) Flag, 1 if all the value of
|
115
|
+
connvalues = 0 # (Integer) Flag, 1 if all the value of connheader have been set
|
116
116
|
connheader = {
|
117
117
|
'to' => '', # The value of "To"
|
118
118
|
'date' => '', # The value of "Date"
|
@@ -129,7 +129,7 @@ module Sisimai::Bite::Email
|
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
|
-
if readcursor & Indicators[:'message-rfc822']
|
132
|
+
if (readcursor & Indicators[:'message-rfc822']).zero?
|
133
133
|
# Beginning of the original message part
|
134
134
|
if e =~ Re1[:rfc822]
|
135
135
|
readcursor |= Indicators[:'message-rfc822']
|
@@ -148,7 +148,7 @@ module Sisimai::Bite::Email
|
|
148
148
|
|
149
149
|
else
|
150
150
|
# Before "message/rfc822"
|
151
|
-
next if readcursor & Indicators[:deliverystatus]
|
151
|
+
next if (readcursor & Indicators[:deliverystatus]).zero?
|
152
152
|
next if statuspart
|
153
153
|
|
154
154
|
if connvalues == connheader.keys.size
|
@@ -220,7 +220,7 @@ module Sisimai::Bite::Email
|
|
220
220
|
connvalues += 1
|
221
221
|
|
222
222
|
elsif cv = e.match(%r|\A[ \t]+Sent:[ \t]+([A-Z][a-z]{2},.+[-+]\d{4})\z|) ||
|
223
|
-
|
223
|
+
e.match(%r|\A[ \t]+Sent:[ \t]+(\d+[/]\d+[/]\d+[ \t]+\d+:\d+:\d+[ \t].+)|)
|
224
224
|
# Sent: Thu, 29 Apr 2010 18:14:35 +0000
|
225
225
|
# Sent: 4/29/99 9:19:59 AM
|
226
226
|
next if connheader['date'].size > 0
|