sisimai 5.0.3 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codecovio.yml +3 -1
- data/.github/workflows/rake-test.yml +7 -3
- data/ChangeLog.md +136 -0
- data/Makefile +4 -2
- data/README-JA.md +32 -22
- data/README.md +31 -21
- data/lib/sisimai/arf.rb +124 -213
- data/lib/sisimai/fact/json.rb +2 -2
- data/lib/sisimai/fact/yaml.rb +2 -2
- data/lib/sisimai/fact.rb +208 -173
- data/lib/sisimai/lda.rb +98 -0
- data/lib/sisimai/lhost/activehunter.rb +5 -4
- data/lib/sisimai/lhost/amazonses.rb +189 -305
- data/lib/sisimai/lhost/apachejames.rb +52 -55
- data/lib/sisimai/lhost/biglobe.rb +5 -6
- data/lib/sisimai/lhost/courier.rb +14 -12
- data/lib/sisimai/lhost/domino.rb +29 -29
- data/lib/sisimai/lhost/dragonfly.rb +113 -0
- data/lib/sisimai/lhost/einsundeins.rb +7 -8
- data/lib/sisimai/lhost/exchange2003.rb +10 -11
- data/lib/sisimai/lhost/exchange2007.rb +115 -104
- data/lib/sisimai/lhost/exim.rb +236 -246
- data/lib/sisimai/lhost/ezweb.rb +47 -55
- data/lib/sisimai/lhost/fml.rb +6 -7
- data/lib/sisimai/lhost/gmail.rb +36 -32
- data/lib/sisimai/lhost/gmx.rb +8 -20
- data/lib/sisimai/lhost/googlegroups.rb +13 -12
- data/lib/sisimai/lhost/googleworkspace.rb +94 -0
- data/lib/sisimai/lhost/imailserver.rb +11 -19
- data/lib/sisimai/lhost/interscanmss.rb +6 -5
- data/lib/sisimai/lhost/kddi.rb +7 -8
- data/lib/sisimai/lhost/mailfoundry.rb +6 -9
- data/lib/sisimai/lhost/mailmarshalsmtp.rb +6 -6
- data/lib/sisimai/lhost/messagingserver.rb +19 -17
- data/lib/sisimai/lhost/mfilter.rb +8 -7
- data/lib/sisimai/lhost/notes.rb +6 -8
- data/lib/sisimai/lhost/opensmtpd.rb +11 -9
- data/lib/sisimai/lhost/postfix.rb +29 -31
- data/lib/sisimai/lhost/qmail.rb +136 -112
- data/lib/sisimai/lhost/sendmail.rb +23 -22
- data/lib/sisimai/lhost/v5sendmail.rb +93 -64
- data/lib/sisimai/lhost/verizon.rb +6 -6
- data/lib/sisimai/lhost/x1.rb +4 -4
- data/lib/sisimai/lhost/x2.rb +4 -5
- data/lib/sisimai/lhost/x3.rb +5 -5
- data/lib/sisimai/lhost/x6.rb +4 -4
- data/lib/sisimai/lhost/zoho.rb +6 -6
- data/lib/sisimai/lhost.rb +21 -24
- data/lib/sisimai/mail/maildir.rb +1 -1
- data/lib/sisimai/mail/stdin.rb +1 -1
- data/lib/sisimai/message.rb +100 -153
- data/lib/sisimai/order.rb +22 -77
- data/lib/sisimai/reason/authfailure.rb +1 -4
- data/lib/sisimai/reason/badreputation.rb +3 -3
- data/lib/sisimai/reason/blocked.rb +7 -10
- data/lib/sisimai/reason/contenterror.rb +7 -1
- data/lib/sisimai/reason/exceedlimit.rb +1 -4
- data/lib/sisimai/reason/failedstarttls.rb +42 -0
- data/lib/sisimai/reason/filtered.rb +5 -4
- data/lib/sisimai/reason/hasmoved.rb +1 -2
- data/lib/sisimai/reason/hostunknown.rb +3 -3
- data/lib/sisimai/reason/mailboxfull.rb +2 -4
- data/lib/sisimai/reason/mailererror.rb +1 -2
- data/lib/sisimai/reason/mesgtoobig.rb +2 -4
- data/lib/sisimai/reason/norelaying.rb +3 -3
- data/lib/sisimai/reason/notaccept.rb +2 -3
- data/lib/sisimai/reason/notcompliantrfc.rb +10 -4
- data/lib/sisimai/reason/rejected.rb +2 -1
- data/lib/sisimai/reason/requireptr.rb +2 -2
- data/lib/sisimai/reason/securityerror.rb +1 -3
- data/lib/sisimai/reason/spamdetected.rb +6 -8
- data/lib/sisimai/reason/speeding.rb +1 -2
- data/lib/sisimai/reason/suppressed.rb +36 -0
- data/lib/sisimai/reason/suspend.rb +1 -3
- data/lib/sisimai/reason/systemerror.rb +5 -0
- data/lib/sisimai/reason/toomanyconn.rb +1 -2
- data/lib/sisimai/reason/userunknown.rb +1 -1
- data/lib/sisimai/reason/virusdetected.rb +5 -6
- data/lib/sisimai/reason.rb +82 -78
- data/lib/sisimai/rfc1123.rb +152 -0
- data/lib/sisimai/rfc1894.rb +102 -62
- data/lib/sisimai/rfc2045.rb +2 -1
- data/lib/sisimai/rfc3464/thirdparty.rb +102 -0
- data/lib/sisimai/rfc3464.rb +224 -345
- data/lib/sisimai/rfc3834.rb +3 -3
- data/lib/sisimai/rfc5322.rb +7 -17
- data/lib/sisimai/rfc791.rb +69 -0
- data/lib/sisimai/rhost/aol.rb +36 -0
- data/lib/sisimai/rhost/apple.rb +95 -0
- data/lib/sisimai/rhost/cox.rb +84 -34
- data/lib/sisimai/rhost/facebook.rb +100 -0
- data/lib/sisimai/rhost/franceptt.rb +87 -83
- data/lib/sisimai/rhost/godaddy.rb +208 -45
- data/lib/sisimai/rhost/google.rb +22 -22
- data/lib/sisimai/rhost/gsuite.rb +42 -0
- data/lib/sisimai/rhost/iua.rb +5 -5
- data/lib/sisimai/rhost/kddi.rb +9 -7
- data/lib/sisimai/rhost/messagelabs.rb +37 -0
- data/lib/sisimai/rhost/microsoft.rb +60 -54
- data/lib/sisimai/rhost/mimecast.rb +44 -31
- data/lib/sisimai/rhost/nttdocomo.rb +5 -4
- data/lib/sisimai/rhost/outlook.rb +36 -0
- data/lib/sisimai/rhost/spectrum.rb +102 -41
- data/lib/sisimai/rhost/tencent.rb +48 -26
- data/lib/sisimai/rhost/yahooinc.rb +111 -0
- data/lib/sisimai/rhost.rb +65 -42
- data/lib/sisimai/smtp/command.rb +31 -21
- data/lib/sisimai/smtp/failure.rb +103 -0
- data/lib/sisimai/smtp/reply.rb +29 -24
- data/lib/sisimai/smtp/status.rb +36 -19
- data/lib/sisimai/smtp/transcript.rb +18 -18
- data/lib/sisimai/string.rb +0 -46
- data/lib/sisimai/version.rb +1 -1
- data/lib/sisimai.rb +0 -6
- data/set-of-emails/maildir/bsd/lhost-dragonfly-01.eml +36 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-02.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-03.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-04.eml +31 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-05.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-06.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-07.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-08.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-09.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-10.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-11.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-12.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-13.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-14.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-15.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-16.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-17.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-18.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-19.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-20.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-21.eml +33 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-22.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-23.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-24.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-25.eml +33 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-26.eml +33 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-27.eml +47 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-28.eml +47 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-29.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-dragonfly-30.eml +32 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-10.eml +58 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-11.eml +58 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-12.eml +62 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-13.eml +62 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-14.eml +58 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-15.eml +63 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-16.eml +62 -0
- data/set-of-emails/maildir/bsd/lhost-opensmtpd-17.eml +63 -0
- data/set-of-emails/maildir/bsd/lhost-postfix-30.eml +81 -81
- data/set-of-emails/maildir/bsd/lhost-qmail-11.eml +29 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-12.eml +29 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-13.eml +29 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-14.eml +34 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-15.eml +30 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-16.eml +31 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-17.eml +38 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-18.eml +31 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-19.eml +31 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-20.eml +46 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-21.eml +41 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-22.eml +42 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-23.eml +43 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-24.eml +43 -0
- data/set-of-emails/maildir/bsd/lhost-qmail-25.eml +54 -0
- data/set-of-emails/maildir/bsd/{lhost-aol-03.eml → rhost-aol-03.eml} +1264 -1264
- data/set-of-emails/maildir/bsd/{lhost-aol-04.eml → rhost-aol-04.eml} +1260 -1260
- data/set-of-emails/maildir/bsd/{lhost-aol-05.eml → rhost-aol-05.eml} +105 -105
- data/set-of-emails/maildir/bsd/{lhost-aol-06.eml → rhost-aol-06.eml} +105 -105
- data/set-of-emails/maildir/bsd/rhost-apple-01.eml +79 -0
- data/set-of-emails/maildir/bsd/rhost-apple-02.eml +81 -0
- data/set-of-emails/maildir/bsd/rhost-apple-03.eml +75 -0
- data/set-of-emails/maildir/bsd/rhost-apple-04.eml +74 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-01.eml +189 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-02.eml +180 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-03.eml +251 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-04.eml +211 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-05.eml +226 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-06.eml +257 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-07.eml +289 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-08.eml +231 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-09.eml +231 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-10.eml +254 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-11.eml +228 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-12.eml +271 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-13.eml +261 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-14.eml +273 -0
- data/set-of-emails/maildir/bsd/rhost-gsuite-15.eml +229 -0
- data/set-of-emails/maildir/bsd/{lhost-messagelabs-01.eml → rhost-messagelabs-01.eml} +93 -93
- data/set-of-emails/maildir/bsd/rhost-outlook-01.eml +72 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-02.eml +72 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-03.eml +72 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-04.eml +79 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-06.eml +75 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-07.eml +70 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-08.eml +70 -0
- data/set-of-emails/maildir/bsd/rhost-outlook-09.eml +56 -0
- data/set-of-emails/maildir/bsd/rhost-yahooinc-01.eml +80 -0
- data/set-of-emails/maildir/bsd/rhost-yahooinc-02.eml +83 -0
- data/set-of-emails/maildir/bsd/rhost-yahooinc-03.eml +125 -0
- data/set-of-emails/maildir/tmp/arf-22.eml +49 -0
- data/set-of-emails/maildir/tmp/arf-23.eml +49 -0
- data/set-of-emails/maildir/tmp/arf-24.eml +50 -0
- data/set-of-emails/maildir/tmp/lhost-exim-07.eml +28 -0
- metadata +136 -56
- data/lib/sisimai/lhost/amavis.rb +0 -163
- data/lib/sisimai/lhost/amazonworkmail.rb +0 -127
- data/lib/sisimai/lhost/aol.rb +0 -125
- data/lib/sisimai/lhost/barracuda.rb +0 -92
- data/lib/sisimai/lhost/bigfoot.rb +0 -125
- data/lib/sisimai/lhost/facebook.rb +0 -188
- data/lib/sisimai/lhost/gsuite.rb +0 -194
- data/lib/sisimai/lhost/mailru.rb +0 -214
- data/lib/sisimai/lhost/mcafee.rb +0 -109
- data/lib/sisimai/lhost/messagelabs.rb +0 -119
- data/lib/sisimai/lhost/mxlogic.rb +0 -198
- data/lib/sisimai/lhost/office365.rb +0 -252
- data/lib/sisimai/lhost/outlook.rb +0 -129
- data/lib/sisimai/lhost/powermta.rb +0 -118
- data/lib/sisimai/lhost/receivingses.rb +0 -126
- data/lib/sisimai/lhost/sendgrid.rb +0 -150
- data/lib/sisimai/lhost/surfcontrol.rb +0 -105
- data/lib/sisimai/lhost/x4.rb +0 -269
- data/lib/sisimai/lhost/x5.rb +0 -112
- data/lib/sisimai/lhost/yahoo.rb +0 -102
- data/lib/sisimai/lhost/yandex.rb +0 -118
- data/lib/sisimai/mda.rb +0 -121
- data/lib/sisimai/smtp/error.rb +0 -119
- /data/set-of-emails/maildir/bsd/{lhost-googlegroups-15.eml → lhost-googleworkspace-01.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-x4-08.eml → lhost-x2-06.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-01.eml → rfc3464-51.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-03.eml → rfc3464-52.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-04.eml → rfc3464-53.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-05.eml → rfc3464-54.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-06.eml → rfc3464-55.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-07.eml → rfc3464-56.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-08.eml → rfc3464-57.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-09.eml → rfc3464-58.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-10.eml → rfc3464-59.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-11.eml → rfc3464-60.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-12.eml → rfc3464-61.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-13.eml → rfc3464-62.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-14.eml → rfc3464-63.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-15.eml → rfc3464-64.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-gsuite-02.eml → rfc3464-65.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-aol-01.eml → rhost-aol-01.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-aol-02.eml → rhost-aol-02.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-facebook-03.eml → rhost-facebook-03.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-facebook-04.eml → rhost-facebook-04.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-messagelabs-02.eml → rhost-messagelabs-02.eml} +0 -0
- /data/set-of-emails/maildir/bsd/{lhost-messagelabs-03.eml → rhost-messagelabs-03.eml} +0 -0
- /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-37.eml +0 -0
- /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-38.eml +0 -0
- /data/set-of-emails/maildir/{bsd → tmp}/rfc3464-39.eml +0 -0
data/lib/sisimai/message.rb
CHANGED
@@ -20,14 +20,17 @@ module Sisimai
|
|
20
20
|
Fields5965 = Sisimai::RFC5965.FIELDINDEX.freeze
|
21
21
|
FieldIndex = [Fields1894.flatten, Fields5322.flatten, Fields5965.flatten].flatten.freeze
|
22
22
|
FieldTable = FieldIndex.map { |e| [e.downcase, e] }.to_h.freeze
|
23
|
-
ReplacesAs = { 'Content-Type' => [%w[message/xdelivery-status message/delivery-status]] }.freeze
|
24
23
|
Boundaries = ['Content-Type: message/rfc822', 'Content-Type: text/rfc822-headers'].freeze
|
24
|
+
ReplacesAs = {
|
25
|
+
"Content-Type" => [
|
26
|
+
%w[message/xdelivery-status message/delivery-status],
|
27
|
+
%w[message/disposition-notification message/delivery-status],
|
28
|
+
]
|
29
|
+
}.freeze
|
25
30
|
|
26
31
|
# Read an email message and convert to structured format
|
27
32
|
# @param [Hash] argvs Module to be loaded
|
28
33
|
# @options argvs [String] :data Entire email message
|
29
|
-
# @options argvs [Array] :load User defined MTA module list
|
30
|
-
# @options argvs [Array] :order The order of MTA modules
|
31
34
|
# @options argvs [Code] :hook Reference to callback method
|
32
35
|
# @return [Sisimai::Message] Structured email data or nil if each
|
33
36
|
# value of the arguments are missing
|
@@ -37,16 +40,6 @@ module Sisimai
|
|
37
40
|
thing = { 'from' => '','header' => {}, 'rfc822' => '', 'ds' => [], 'catch' => nil }
|
38
41
|
param = {}
|
39
42
|
|
40
|
-
# 0. Load specified MTA modules
|
41
|
-
[:load, :order].each do |e|
|
42
|
-
# Order of MTA modules
|
43
|
-
next unless argvs[e]
|
44
|
-
next unless argvs[e].is_a? Array
|
45
|
-
next if argvs[e].empty?
|
46
|
-
param[e.to_s] = argvs[e]
|
47
|
-
end
|
48
|
-
tobeloaded = Sisimai::Message.load(param)
|
49
|
-
|
50
43
|
aftersplit = nil
|
51
44
|
beforefact = nil
|
52
45
|
parseagain = 0
|
@@ -71,7 +64,7 @@ module Sisimai
|
|
71
64
|
if p1
|
72
65
|
# Delete quoted strings, quote symbols(>)
|
73
66
|
cq = Sisimai::String.sweep(cq[cq.index(':') + 1, cq.size])
|
74
|
-
aftersplit[2] = aftersplit[2].gsub(/^[>]
|
67
|
+
aftersplit[2] = aftersplit[2].gsub(/^[>][ ]/, '').gsub(/^[>]$/, '')
|
75
68
|
end
|
76
69
|
thing['header']['subject'] = cq
|
77
70
|
end
|
@@ -81,7 +74,6 @@ module Sisimai
|
|
81
74
|
'hook' => argvs[:hook] || nil,
|
82
75
|
'mail' => thing,
|
83
76
|
'body' => aftersplit[2],
|
84
|
-
'tobeloaded' => tobeloaded,
|
85
77
|
'tryonfirst' => Sisimai::Order.make(thing['header']['subject'])
|
86
78
|
}
|
87
79
|
break if beforefact = Sisimai::Message.sift(param)
|
@@ -91,7 +83,7 @@ module Sisimai
|
|
91
83
|
# There is a bounce message inside of mutipart/*, try to sift the first message/rfc822
|
92
84
|
# part as a entire message body again.
|
93
85
|
parseagain += 1
|
94
|
-
email = Sisimai::RFC5322.part(aftersplit[2], Boundaries, true).pop.sub(/\A
|
86
|
+
email = Sisimai::RFC5322.part(aftersplit[2], Boundaries, true).pop.sub(/\A\s+/, '')
|
95
87
|
break unless email.size > 128
|
96
88
|
end
|
97
89
|
return nil unless beforefact
|
@@ -106,46 +98,7 @@ module Sisimai
|
|
106
98
|
return thing
|
107
99
|
end
|
108
100
|
|
109
|
-
|
110
|
-
# @param [Hash] argvs Module information to be loaded
|
111
|
-
# @options argvs [Array] load User defined MTA module list
|
112
|
-
# @options argvs [Array] order The order of MTA modules
|
113
|
-
# @return [Array] Module list
|
114
|
-
# @since v4.20.0
|
115
|
-
def load(argvs)
|
116
|
-
modulelist = []
|
117
|
-
tobeloaded = []
|
118
|
-
|
119
|
-
%w[load order].each do |e|
|
120
|
-
# The order of MTA modules specified by user
|
121
|
-
next unless argvs[e]
|
122
|
-
next unless argvs[e].is_a? Array
|
123
|
-
next if argvs[e].empty?
|
124
|
-
|
125
|
-
modulelist += argvs['order'] if e == 'order'
|
126
|
-
next unless e == 'load'
|
127
|
-
|
128
|
-
# Load user defined MTA module
|
129
|
-
argvs['load'].each do |v|
|
130
|
-
# Load user defined MTA module
|
131
|
-
begin
|
132
|
-
require v.to_s.gsub('::', '/').downcase
|
133
|
-
rescue LoadError
|
134
|
-
warn ' ***warning: Failed to load ' << v
|
135
|
-
next
|
136
|
-
end
|
137
|
-
tobeloaded << v
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
while e = modulelist.shift do
|
142
|
-
# Append the custom order of MTA modules
|
143
|
-
next if tobeloaded.index(e)
|
144
|
-
tobeloaded << e
|
145
|
-
end
|
146
|
-
|
147
|
-
return tobeloaded
|
148
|
-
end
|
101
|
+
def load(argvs); ' ***warning: Sisimai::Message.load will be removed at v5.3.0'; return []; end
|
149
102
|
|
150
103
|
# Divide email data up headers and a body part.
|
151
104
|
# @param [String] email Email data
|
@@ -199,20 +152,20 @@ module Sisimai
|
|
199
152
|
# https://gist.github.com/xtetsuji/b080e1f5551d17242f6415aba8a00239
|
200
153
|
headermaps = { 'subject' => '' }
|
201
154
|
receivedby = []
|
202
|
-
argv0.scan(/^([\w-]+):[ ]*(.*?)\n(
|
155
|
+
argv0.scan(/^([\w-]+):[ ]*(.*?)\n(?!\s)/m) { |e| headermaps[e[0].downcase] = e[1] }
|
203
156
|
headermaps.delete('received')
|
204
|
-
headermaps.each_key { |e| headermaps[e].gsub!(/\n
|
157
|
+
headermaps.each_key { |e| headermaps[e].gsub!(/\n\s+/, ' ') }
|
205
158
|
|
206
159
|
if argv0.include?('Received:')
|
207
160
|
# Capture values of each Received: header
|
208
|
-
re = argv0.scan(/^Received:[ ]*(.*?)\n(
|
161
|
+
re = argv0.scan(/^Received:[ ]*(.*?)\n(?!\s)/m).flatten
|
209
162
|
re.each do |e|
|
210
163
|
# 1. Exclude the Received header including "(qmail ** invoked from network)".
|
211
164
|
# 2. Convert all consecutive spaces and line breaks into a single space character.
|
212
165
|
next if e.include?(' invoked by uid')
|
213
166
|
next if e.include?(' invoked from network')
|
214
167
|
|
215
|
-
e.gsub!(/\n
|
168
|
+
e.gsub!(/\n\s+/, ' ')
|
216
169
|
e.squeeze!("\n\t ")
|
217
170
|
receivedby << e
|
218
171
|
end
|
@@ -252,93 +205,97 @@ module Sisimai
|
|
252
205
|
return '' if argv0.empty?
|
253
206
|
|
254
207
|
email = ''
|
255
|
-
argv0.split("\n")
|
208
|
+
lines = argv0.split("\n")
|
209
|
+
index = -1
|
210
|
+
lines.each do |e|
|
256
211
|
# Find and tidy up fields defined in RFC5322, RFC1894, and RFC5965
|
257
212
|
# 1. Find a field label defined in RFC5322, RFC1894, or RFC5965 from this line
|
258
|
-
p0 = e.index(':') ||
|
213
|
+
p0 = e.index(':') || -1
|
259
214
|
cf = e.downcase[0, p0]
|
215
|
+
fn = FieldTable[cf] || ''
|
260
216
|
|
261
|
-
|
217
|
+
index += 1
|
218
|
+
if fn == ''
|
219
|
+
# There is neither ":" character nor the field listed in $FieldTable
|
262
220
|
email << e + "\n"
|
263
221
|
next
|
264
222
|
end
|
265
223
|
|
266
|
-
# 2.
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
# - After: Message-Id: <...>
|
271
|
-
fieldlabel = FieldTable[cf]
|
272
|
-
substring0 = e[0, p0]
|
273
|
-
e[0, p0] = fieldlabel unless substring0.empty?
|
274
|
-
|
275
|
-
# 3. There is no " " (space character) immediately after ":"
|
276
|
-
# - before: Content-Type:text/plain
|
277
|
-
# - After: Content-Type: text/plain
|
278
|
-
substring0 = e[p0 + 1, 1]
|
279
|
-
e[p0, 1] = ': ' if substring0 != ' '
|
280
|
-
|
281
|
-
# 4. Remove redundant space characters after ":"
|
282
|
-
while true
|
283
|
-
# - Before: Message-Id: <...>
|
284
|
-
# - After: Message-Id: <...>
|
285
|
-
break unless p0 + 2 < e.size
|
286
|
-
break unless e[p0 + 2, 1] == ' '
|
287
|
-
e[p0 + 2, 1] = ''
|
288
|
-
end
|
289
|
-
|
290
|
-
# 5. Tidy up a sub type of each field defined in RFC1894 such as Reporting-MTA: DNS;...
|
291
|
-
p1 = e.index(';') || -1
|
224
|
+
# 2. Tidy up a sub type of each field defined in RFC1894 such as Reporting-MTA: DNS;...
|
225
|
+
ab = []
|
226
|
+
bf = e[p0 + 1, e.size - p0 - 1]
|
227
|
+
p1 = bf.index(';')
|
292
228
|
while true
|
293
229
|
# Such as Diagnostic-Code, Remote-MTA, and so on
|
294
230
|
# - Before: Diagnostic-Code: SMTP;550 User unknown
|
295
231
|
# - After: Diagnostic-Code: smtp; 550 User unknown
|
296
|
-
break unless
|
297
|
-
break unless ['Content-Type'].concat(Fields1894).any? { |a| a.start_with?(fieldlabel) }
|
232
|
+
break unless ['Content-Type'].concat(Fields1894).any? { |a| a == fn }
|
298
233
|
|
299
|
-
|
300
|
-
|
234
|
+
if p1
|
235
|
+
# The field including one or more ";"
|
236
|
+
bf.split(';').each do |f|
|
237
|
+
# 2-1. Trim leading and trailing space characters from the current buffer
|
238
|
+
f.strip!
|
239
|
+
ps = ''
|
240
|
+
|
241
|
+
# 2-2. Convert some parameters to the lower-cased string
|
242
|
+
while true
|
243
|
+
# For example,
|
244
|
+
# - Content-Type: Message/delivery-status => message/delivery-status
|
245
|
+
# - Content-Type: Charset=UTF8 => charset=utf8
|
246
|
+
# - Reporting-MTA: DNS; ... => dns
|
247
|
+
# - Final-Recipient: RFC822; ... => rfc822
|
248
|
+
break if f.include?(' ')
|
249
|
+
|
250
|
+
p2 = f.index('=')
|
251
|
+
if p2
|
252
|
+
# charset=, boundary=, and other pairs divided by "="
|
253
|
+
ps = f[0, p2].downcase
|
254
|
+
f[0, p2] = ps
|
255
|
+
end
|
256
|
+
f.downcase! unless ps == 'boundary'
|
257
|
+
break
|
258
|
+
end
|
259
|
+
ab << f
|
260
|
+
end
|
261
|
+
|
262
|
+
while true
|
263
|
+
# Diagnostic-Code: x-unix;
|
264
|
+
# /var/email/kijitora/Maildir/tmp/1000000000.A000000B00000.neko22:
|
265
|
+
# Disk quota exceeded
|
266
|
+
break unless fn == 'Diagnostic-Code'
|
267
|
+
break unless ab.size == 1
|
268
|
+
break unless lines[index + 1].start_with?(' ')
|
269
|
+
|
270
|
+
ab << ''
|
271
|
+
break
|
272
|
+
end
|
273
|
+
bf = ab.join('; ') # Insert " " (space characer) immediately after ";"
|
274
|
+
ab = []
|
275
|
+
|
276
|
+
else
|
277
|
+
# There is no ";" in the field
|
278
|
+
break if fn.end_with?('-Date') # Arrival-Date, Last-Attempt-Date
|
279
|
+
break if fn.end_with?('-Message-ID') # X-Original-Message-ID
|
280
|
+
bf.downcase!
|
281
|
+
end
|
301
282
|
break
|
302
283
|
end
|
303
284
|
|
304
|
-
#
|
305
|
-
|
306
|
-
# - Before: Diagnostic-Code: SMTP; 550 User unknown
|
307
|
-
# - After: Diagnostic-Code: SMTP; 550 User unknown
|
308
|
-
break unless p1 + 2 < e.size
|
309
|
-
break unless e[p1 + 2, 1] == ' '
|
310
|
-
e[p1 + 2, 1] = ''
|
311
|
-
end
|
312
|
-
|
313
|
-
# 7. Tidy up a value, and a parameter of Content-Type: field
|
314
|
-
while true
|
285
|
+
# 3. Tidy up a value, and a parameter of Content-Type: field
|
286
|
+
if ReplacesAs.has_key?(fn)
|
315
287
|
# Replace the value of "Content-Type" field
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
p2 = e.index(f[0]) || -1
|
322
|
-
next unless p2 > 1
|
323
|
-
|
324
|
-
e[p2, f[0].size] = f[1]
|
325
|
-
p1 = e.index(';')
|
326
|
-
break
|
288
|
+
ReplacesAs[fn].each do |f|
|
289
|
+
# - Before: Content-Type: message/xdelivery-status; ...
|
290
|
+
# - After: Content-Type: message/delivery-status; ...
|
291
|
+
p1 = bf.index(f[0]) || next
|
292
|
+
bf[p1, f[0].size] = f[1]
|
327
293
|
end
|
328
|
-
|
329
|
-
# A parameter name of Content-Type field should be a lower-cased string
|
330
|
-
# - Before: Content-Type: text/plain; CharSet=ascii; Boundary=...
|
331
|
-
# - After: Content-Type: text/plain; charset=ascii; boundary=...
|
332
|
-
break unless fieldlabel == 'Content-Type'
|
333
|
-
p2 = e.index('=') || -1
|
334
|
-
break unless p2 > 0
|
335
|
-
break unless p2 > p1
|
336
|
-
|
337
|
-
substring0 = e[p1 + 2, p2 - p1 - 2]
|
338
|
-
e[p1 + 2, p2 - p1 - 2] = substring0.downcase
|
339
|
-
break
|
340
294
|
end
|
341
|
-
|
295
|
+
|
296
|
+
# 4. Remove redundant space characters
|
297
|
+
bf = bf.squeeze(' ').strip
|
298
|
+
email << sprintf("%s: %s\n", fn, bf)
|
342
299
|
end
|
343
300
|
|
344
301
|
email << "\n" unless email.end_with?("\n\n")
|
@@ -351,11 +308,10 @@ module Sisimai
|
|
351
308
|
# @param options mail [String] from From line of mbox
|
352
309
|
# @param options mail [Hash] header Email header data
|
353
310
|
# @param options mail [String] rfc822 Original message part
|
354
|
-
# @param options mail [Array] ds Delivery status list(
|
311
|
+
# @param options mail [Array] ds Delivery status list(decoded data)
|
355
312
|
# @param options argvs [String] body Email message body
|
356
313
|
# @param options argvs [Array] tryonfirst MTA module list to load on first
|
357
|
-
# @
|
358
|
-
# @return [Hash] Parsed and structured bounce mails
|
314
|
+
# @return [Hash] Decoded and structured bounce mails
|
359
315
|
def sift(argvs)
|
360
316
|
return nil unless argvs['mail']
|
361
317
|
return nil unless argvs['body']
|
@@ -414,23 +370,13 @@ module Sisimai
|
|
414
370
|
end
|
415
371
|
end
|
416
372
|
|
417
|
-
catch :
|
373
|
+
catch :DECODER do
|
418
374
|
while true
|
419
|
-
# 1.
|
420
|
-
# 2.
|
421
|
-
# 3. Sisimai::
|
422
|
-
# 4. Sisimai::
|
423
|
-
# 5. Sisimai::
|
424
|
-
# 6. Sisimai::RFC3834
|
425
|
-
while r = argvs['tobeloaded'].shift do
|
426
|
-
# Call user defined MTA modules
|
427
|
-
next if haveloaded[r]
|
428
|
-
havesifted = Module.const_get(r).inquire(mailheader, bodystring)
|
429
|
-
haveloaded[r] = true
|
430
|
-
modulename = r
|
431
|
-
throw :PARSER if havesifted
|
432
|
-
end
|
433
|
-
|
375
|
+
# 1. MTA Module Candidates to be tried on first
|
376
|
+
# 2. Sisimai::Lhost::*
|
377
|
+
# 3. Sisimai::RFC3464
|
378
|
+
# 4. Sisimai::ARF
|
379
|
+
# 5. Sisimai::RFC3834
|
434
380
|
[argvs['tryonfirst'], DefaultSet].flatten.each do |r|
|
435
381
|
# Try MTA module candidates
|
436
382
|
next if haveloaded[r]
|
@@ -438,7 +384,7 @@ module Sisimai
|
|
438
384
|
havesifted = Module.const_get(r).inquire(mailheader, bodystring)
|
439
385
|
haveloaded[r] = true
|
440
386
|
modulename = r
|
441
|
-
throw :
|
387
|
+
throw :DECODER if havesifted
|
442
388
|
end
|
443
389
|
|
444
390
|
unless haveloaded['Sisimai::RFC3464']
|
@@ -446,14 +392,15 @@ module Sisimai
|
|
446
392
|
require 'sisimai/rfc3464'
|
447
393
|
havesifted = Sisimai::RFC3464.inquire(mailheader, bodystring)
|
448
394
|
modulename = 'RFC3464'
|
449
|
-
throw :
|
395
|
+
throw :DECODER if havesifted
|
450
396
|
end
|
451
397
|
|
452
398
|
unless haveloaded['Sisimai::ARF']
|
453
399
|
# Feedback Loop message
|
454
400
|
require 'sisimai/arf'
|
455
401
|
havesifted = Sisimai::ARF.inquire(mailheader, bodystring)
|
456
|
-
|
402
|
+
modulename = "ARF"
|
403
|
+
throw :DECODER if havesifted
|
457
404
|
end
|
458
405
|
|
459
406
|
unless haveloaded['Sisimai::RFC3834']
|
@@ -461,7 +408,7 @@ module Sisimai
|
|
461
408
|
require 'sisimai/rfc3834'
|
462
409
|
havesifted = Sisimai::RFC3834.inquire(mailheader, bodystring)
|
463
410
|
modulename = 'RFC3834'
|
464
|
-
throw :
|
411
|
+
throw :DECODER if havesifted
|
465
412
|
end
|
466
413
|
|
467
414
|
break # as of now, we have no sample email for coding this block
|
@@ -472,8 +419,8 @@ module Sisimai
|
|
472
419
|
havesifted['catch'] = havecaught
|
473
420
|
modulename = modulename.sub(/\A.+::/, '')
|
474
421
|
havesifted['ds'].each do |e|
|
475
|
-
e[
|
476
|
-
e.each_key { |a| e[a]
|
422
|
+
e["agent"] = modulename if e["agent"].nil? || e["agent"].empty?
|
423
|
+
e.each_key { |a| e[a] = "" if e[a].nil? } # Replace nil with ""
|
477
424
|
end
|
478
425
|
return havesifted
|
479
426
|
end
|
data/lib/sisimai/order.rb
CHANGED
@@ -7,62 +7,42 @@ module Sisimai
|
|
7
7
|
# There are another patterns in the value of "Subject:" header of a bounce mail generated by the
|
8
8
|
# following MTA/ESP modules
|
9
9
|
OrderE0 = [
|
10
|
-
'Sisimai::Lhost::MailRu',
|
11
|
-
'Sisimai::Lhost::Yandex',
|
12
10
|
'Sisimai::Lhost::Exim',
|
13
11
|
'Sisimai::Lhost::Sendmail',
|
14
|
-
'Sisimai::Lhost::Aol',
|
15
|
-
'Sisimai::Lhost::Office365',
|
16
12
|
'Sisimai::Lhost::Exchange2007',
|
17
13
|
'Sisimai::Lhost::Exchange2003',
|
18
|
-
'Sisimai::Lhost::AmazonWorkMail',
|
19
14
|
'Sisimai::Lhost::AmazonSES',
|
20
|
-
'Sisimai::Lhost::Barracuda',
|
21
15
|
'Sisimai::Lhost::InterScanMSS',
|
22
16
|
'Sisimai::Lhost::KDDI',
|
23
|
-
'Sisimai::Lhost::SurfControl',
|
24
17
|
'Sisimai::Lhost::Verizon',
|
25
18
|
'Sisimai::Lhost::ApacheJames',
|
26
19
|
'Sisimai::Lhost::X2',
|
27
|
-
'Sisimai::Lhost::X5',
|
28
20
|
'Sisimai::Lhost::FML',
|
29
21
|
].freeze
|
30
22
|
|
31
23
|
# Fallback list: The following MTA/ESP modules is not listed OrderE0
|
32
24
|
OrderE1 = [
|
33
25
|
'Sisimai::Lhost::Postfix',
|
34
|
-
'Sisimai::Lhost::
|
35
|
-
'Sisimai::Lhost::
|
36
|
-
'Sisimai::Lhost::
|
37
|
-
'Sisimai::Lhost::GMX',
|
26
|
+
'Sisimai::Lhost::OpenSMTPD',
|
27
|
+
'Sisimai::Lhost::Courier',
|
28
|
+
'Sisimai::Lhost::Qmail',
|
38
29
|
'Sisimai::Lhost::MessagingServer',
|
39
|
-
'Sisimai::Lhost::
|
30
|
+
'Sisimai::Lhost::MailMarshalSMTP',
|
31
|
+
'Sisimai::Lhost::GoogleWorkspace',
|
40
32
|
'Sisimai::Lhost::Domino',
|
41
33
|
'Sisimai::Lhost::Notes',
|
42
|
-
'Sisimai::Lhost::
|
43
|
-
'Sisimai::Lhost::Courier',
|
44
|
-
'Sisimai::Lhost::OpenSMTPD',
|
34
|
+
'Sisimai::Lhost::Gmail',
|
45
35
|
'Sisimai::Lhost::Zoho',
|
46
|
-
'Sisimai::Lhost::
|
47
|
-
'Sisimai::Lhost::
|
36
|
+
'Sisimai::Lhost::GMX',
|
37
|
+
'Sisimai::Lhost::GoogleGroups',
|
48
38
|
'Sisimai::Lhost::MailFoundry',
|
49
|
-
'Sisimai::Lhost::McAfee',
|
50
39
|
'Sisimai::Lhost::V5sendmail',
|
51
|
-
'Sisimai::Lhost::MFILTER',
|
52
|
-
'Sisimai::Lhost::SendGrid',
|
53
|
-
'Sisimai::Lhost::ReceivingSES',
|
54
|
-
'Sisimai::Lhost::Amavis',
|
55
|
-
'Sisimai::Lhost::PowerMTA',
|
56
|
-
'Sisimai::Lhost::GoogleGroups',
|
57
|
-
'Sisimai::Lhost::Gmail',
|
58
|
-
'Sisimai::Lhost::EZweb',
|
59
40
|
'Sisimai::Lhost::IMailServer',
|
60
|
-
'Sisimai::Lhost::
|
41
|
+
'Sisimai::Lhost::MFILTER',
|
61
42
|
'Sisimai::Lhost::Activehunter',
|
62
|
-
'Sisimai::Lhost::
|
43
|
+
'Sisimai::Lhost::EZweb',
|
63
44
|
'Sisimai::Lhost::Biglobe',
|
64
|
-
'Sisimai::Lhost::
|
65
|
-
'Sisimai::Lhost::X4',
|
45
|
+
'Sisimai::Lhost::EinsUndEins',
|
66
46
|
'Sisimai::Lhost::X1',
|
67
47
|
'Sisimai::Lhost::X3',
|
68
48
|
'Sisimai::Lhost::X6',
|
@@ -78,17 +58,12 @@ module Sisimai
|
|
78
58
|
'complaint-about' => ['Sisimai::ARF'],
|
79
59
|
'delivery-failure' => ['Sisimai::Lhost::Domino', 'Sisimai::Lhost::X2'],
|
80
60
|
'delivery-notification' => ['Sisimai::Lhost::MessagingServer'],
|
81
|
-
'delivery-report' => ['Sisimai::Lhost::PowerMTA'],
|
82
61
|
'delivery-status' => [
|
83
|
-
'Sisimai::Lhost::GSuite',
|
84
|
-
'Sisimai::Lhost::GoogleGroups',
|
85
|
-
'Sisimai::Lhost::Outlook',
|
86
|
-
'Sisimai::Lhost::McAfee',
|
87
62
|
'Sisimai::Lhost::OpenSMTPD',
|
88
|
-
'Sisimai::Lhost::
|
89
|
-
'Sisimai::Lhost::AmazonWorkMail',
|
90
|
-
'Sisimai::Lhost::ReceivingSES',
|
63
|
+
'Sisimai::Lhost::GoogleWorkspace',
|
91
64
|
'Sisimai::Lhost::Gmail',
|
65
|
+
'Sisimai::Lhost::GoogleGroups',
|
66
|
+
'Sisimai::Lhost::AmazonSES',
|
92
67
|
'Sisimai::Lhost::X3',
|
93
68
|
],
|
94
69
|
'dmarc-ietf-dmarc' => ['Sisimai::ARF'],
|
@@ -96,65 +71,39 @@ module Sisimai
|
|
96
71
|
'failed-delivery' => ['Sisimai::Lhost::X2'],
|
97
72
|
'failure-delivery' => ['Sisimai::Lhost::X2'],
|
98
73
|
'failure-notice' => [
|
99
|
-
'Sisimai::Lhost::Yahoo',
|
100
74
|
'Sisimai::Lhost::Qmail',
|
101
75
|
'Sisimai::Lhost::MFILTER',
|
102
76
|
'Sisimai::Lhost::Activehunter',
|
103
|
-
'Sisimai::Lhost::X4',
|
104
77
|
],
|
105
78
|
'loop-alert' => ['Sisimai::Lhost::FML'],
|
106
79
|
'mail-delivery' => [
|
107
80
|
'Sisimai::Lhost::Exim',
|
108
|
-
'Sisimai::Lhost::
|
81
|
+
'Sisimai::Lhost::DragonFly',
|
109
82
|
'Sisimai::Lhost::GMX',
|
110
|
-
'Sisimai::Lhost::EinsUndEins',
|
111
83
|
'Sisimai::Lhost::Zoho',
|
112
|
-
'Sisimai::Lhost::
|
113
|
-
'Sisimai::Lhost::MXLogic',
|
84
|
+
'Sisimai::Lhost::EinsUndEins',
|
114
85
|
],
|
115
86
|
'mail-could' => ['Sisimai::Lhost::InterScanMSS'],
|
116
87
|
'mail-failure' => ['Sisimai::Lhost::Exim'],
|
117
|
-
'mail-not' => ['Sisimai::Lhost::X4'],
|
118
88
|
'mail-system' => ['Sisimai::Lhost::EZweb'],
|
119
89
|
'message-delivery' => ['Sisimai::Lhost::MailFoundry'],
|
120
90
|
'message-frozen' => ['Sisimai::Lhost::Exim'],
|
121
|
-
'message-you' => ['Sisimai::Lhost::Barracuda'],
|
122
|
-
'não-entregue' => ['Sisimai::Lhost::Office365'],
|
123
91
|
'non-recapitabile' => ['Sisimai::Lhost::Exchange2007'],
|
124
92
|
'non-remis' => ['Sisimai::Lhost::Exchange2007'],
|
125
93
|
'notice' => ['Sisimai::Lhost::Courier'],
|
126
|
-
'onbestelbaar' => ['Sisimai::Lhost::Office365'],
|
127
|
-
'permanent-delivery' => ['Sisimai::Lhost::X4'],
|
128
94
|
'postmaster-notify' => ['Sisimai::Lhost::Sendmail'],
|
129
95
|
'returned-mail' => [
|
130
96
|
'Sisimai::Lhost::Sendmail',
|
131
|
-
'Sisimai::Lhost::Aol',
|
132
|
-
'Sisimai::Lhost::V5sendmail',
|
133
|
-
'Sisimai::Lhost::Bigfoot',
|
134
97
|
'Sisimai::Lhost::Biglobe',
|
98
|
+
'Sisimai::Lhost::V5sendmail',
|
135
99
|
'Sisimai::Lhost::X1',
|
136
100
|
],
|
137
|
-
'
|
138
|
-
'
|
139
|
-
'undeliverable' => [
|
140
|
-
'Sisimai::Lhost::Office365',
|
141
|
-
'Sisimai::Lhost::Exchange2007',
|
142
|
-
'Sisimai::Lhost::Aol',
|
143
|
-
'Sisimai::Lhost::Exchange2003',
|
144
|
-
],
|
145
|
-
'undeliverable-mail' => [
|
146
|
-
'Sisimai::Lhost::Amavis',
|
147
|
-
'Sisimai::Lhost::MailMarshalSMTP',
|
148
|
-
'Sisimai::Lhost::IMailServer',
|
149
|
-
],
|
101
|
+
'there-was' => ['Sisimai::Lhost::X6'],
|
102
|
+
'undeliverable' => ['Sisimai::Lhost::Exchange2007', 'Sisimai::Lhost::Exchange2003'],
|
103
|
+
'undeliverable-mail' => ['Sisimai::Lhost::MailMarshalSMTP', 'Sisimai::Lhost::IMailServer'],
|
150
104
|
'undeliverable-message' => ['Sisimai::Lhost::Notes', 'Sisimai::Lhost::Verizon'],
|
151
|
-
'undelivered-mail'
|
152
|
-
|
153
|
-
'Sisimai::Lhost::Aol',
|
154
|
-
'Sisimai::Lhost::SendGrid',
|
155
|
-
'Sisimai::Lhost::Zoho',
|
156
|
-
],
|
157
|
-
'warning' => ['Sisimai::Lhost::Sendmail', 'Sisimai::Lhost::Exim'],
|
105
|
+
'undelivered-mail' => ['Sisimai::Lhost::Postfix', 'Sisimai::Lhost::Zoho'],
|
106
|
+
'warning' => ['Sisimai::Lhost::Sendmail', 'Sisimai::Lhost::Exim'],
|
158
107
|
}.freeze
|
159
108
|
|
160
109
|
# @abstract Returns an MTA Order decided by the first word of the "Subject": header
|
@@ -177,10 +126,6 @@ module Sisimai
|
|
177
126
|
return Subject[first] || []
|
178
127
|
end
|
179
128
|
|
180
|
-
# @abstract Make default order of MTA modules to be loaded
|
181
|
-
# @return [Array] Default order list of MTA modules
|
182
|
-
def default; return Sisimai::Lhost.index.map { |e| 'Sisimai::Lhost::' << e }; end
|
183
|
-
|
184
129
|
# @abstract Make MTA module list as a spare
|
185
130
|
# @return [Array] Ordered module list
|
186
131
|
def another; return [OrderE0, OrderE1].flatten; end
|
@@ -52,10 +52,7 @@ module Sisimai
|
|
52
52
|
return nil if argvs['deliverystatus'].empty?
|
53
53
|
return true if argvs['reason'] == 'authfailure'
|
54
54
|
return true if Sisimai::SMTP::Status.name(argvs['deliverystatus']).to_s == 'authfailure'
|
55
|
-
|
56
|
-
# Check the value of Diagnosic-Code: header with patterns
|
57
|
-
return true if match(argvs['diagnosticcode'].downcase)
|
58
|
-
return false
|
55
|
+
return match(argvs['diagnosticcode'].downcase)
|
59
56
|
end
|
60
57
|
|
61
58
|
end
|
@@ -19,6 +19,8 @@ module Sisimai
|
|
19
19
|
'has been temporarily rate limited due to ip reputation',
|
20
20
|
'ip/domain reputation problems',
|
21
21
|
'likely suspicious due to the very low reputation',
|
22
|
+
'none/bad reputation', # t-online.de
|
23
|
+
'temporarily deferred due to unexpected volume or user complaints', # Yahoo Inc.
|
22
24
|
"the sending mta's poor reputation",
|
23
25
|
].freeze
|
24
26
|
def text; return 'badreputation'; end
|
@@ -40,10 +42,8 @@ module Sisimai
|
|
40
42
|
# false: is not BadReputation
|
41
43
|
# @see http://www.ietf.org/rfc/rfc2822.txt
|
42
44
|
def true(argvs)
|
43
|
-
return nil if argvs['deliverystatus'].empty?
|
44
45
|
return true if argvs['reason'] == 'badreputation'
|
45
|
-
return
|
46
|
-
return false
|
46
|
+
return match(argvs['diagnosticcode'].downcase)
|
47
47
|
end
|
48
48
|
|
49
49
|
end
|