sisimai 5.5.0-java → 5.7.0-java
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/rake-test.yml +0 -4
- data/ChangeLog.md +53 -0
- data/LICENSE +1 -1
- data/README-JA.md +26 -20
- data/README.md +30 -25
- data/lib/sisimai/address.rb +8 -31
- data/lib/sisimai/arf.rb +3 -5
- data/lib/sisimai/fact.rb +26 -36
- data/lib/sisimai/lhost/activehunter.rb +0 -2
- data/lib/sisimai/lhost/amazonses.rb +7 -9
- data/lib/sisimai/lhost/apachejames.rb +0 -1
- data/lib/sisimai/lhost/biglobe.rb +0 -16
- data/lib/sisimai/lhost/courier.rb +5 -4
- data/lib/sisimai/lhost/deutschetelekom.rb +120 -0
- data/lib/sisimai/lhost/domino.rb +0 -3
- data/lib/sisimai/lhost/dragonfly.rb +0 -27
- data/lib/sisimai/lhost/einsundeins.rb +1 -10
- data/lib/sisimai/lhost/exchange2003.rb +4 -4
- data/lib/sisimai/lhost/exchange2007.rb +5 -6
- data/lib/sisimai/lhost/exim.rb +35 -85
- data/lib/sisimai/lhost/ezweb.rb +12 -49
- data/lib/sisimai/lhost/fml.rb +4 -29
- data/lib/sisimai/lhost/gmail.rb +0 -23
- data/lib/sisimai/lhost/gmx.rb +7 -24
- data/lib/sisimai/lhost/googlegroups.rb +3 -3
- data/lib/sisimai/lhost/googleworkspace.rb +0 -4
- data/lib/sisimai/lhost/imailserver.rb +3 -9
- data/lib/sisimai/lhost/kddi.rb +6 -20
- data/lib/sisimai/lhost/mailfoundry.rb +0 -2
- data/lib/sisimai/lhost/mailmarshal.rb +1 -3
- data/lib/sisimai/lhost/messagingserver.rb +4 -15
- data/lib/sisimai/lhost/mfilter.rb +0 -1
- data/lib/sisimai/lhost/mimecast.rb +0 -1
- data/lib/sisimai/lhost/notes.rb +1 -2
- data/lib/sisimai/lhost/opensmtpd.rb +0 -40
- data/lib/sisimai/lhost/postfix.rb +10 -11
- data/lib/sisimai/lhost/qmail.rb +14 -81
- data/lib/sisimai/lhost/sendmail.rb +4 -4
- data/lib/sisimai/lhost/trendmicro.rb +3 -3
- data/lib/sisimai/lhost/v5sendmail.rb +0 -1
- data/lib/sisimai/lhost/verizon.rb +1 -2
- data/lib/sisimai/lhost/x1.rb +1 -2
- data/lib/sisimai/lhost/x2.rb +0 -2
- data/lib/sisimai/lhost/x3.rb +4 -9
- data/lib/sisimai/lhost/x6.rb +0 -1
- data/lib/sisimai/lhost/zoho.rb +0 -12
- data/lib/sisimai/lhost.rb +38 -19
- data/lib/sisimai/message.rb +3 -1
- data/lib/sisimai/order.rb +4 -1
- data/lib/sisimai/reason/authfailure.rb +9 -13
- data/lib/sisimai/reason/badreputation.rb +7 -7
- data/lib/sisimai/reason/blocked.rb +57 -83
- data/lib/sisimai/reason/contenterror.rb +16 -8
- data/lib/sisimai/reason/{mesgtoobig.rb → emailtoolarge.rb} +22 -25
- data/lib/sisimai/reason/expired.rb +27 -23
- data/lib/sisimai/reason/filtered.rb +13 -17
- data/lib/sisimai/reason/hasmoved.rb +2 -1
- data/lib/sisimai/reason/hostunknown.rb +25 -19
- data/lib/sisimai/reason/mailboxfull.rb +28 -49
- data/lib/sisimai/reason/networkerror.rb +28 -16
- data/lib/sisimai/reason/norelaying.rb +21 -20
- data/lib/sisimai/reason/notaccept.rb +13 -8
- data/lib/sisimai/reason/notcompliantrfc.rb +6 -9
- data/lib/sisimai/reason/policyviolation.rb +17 -26
- data/lib/sisimai/reason/ratelimited.rb +62 -0
- data/lib/sisimai/reason/rejected.rb +51 -59
- data/lib/sisimai/reason/requireptr.rb +13 -25
- data/lib/sisimai/reason/securityerror.rb +14 -19
- data/lib/sisimai/reason/spamdetected.rb +51 -101
- data/lib/sisimai/reason/suspend.rb +30 -24
- data/lib/sisimai/reason/syntaxerror.rb +1 -8
- data/lib/sisimai/reason/systemerror.rb +37 -23
- data/lib/sisimai/reason/systemfull.rb +1 -1
- data/lib/sisimai/reason/userunknown.rb +81 -112
- data/lib/sisimai/reason/virusdetected.rb +6 -8
- data/lib/sisimai/reason.rb +15 -15
- data/lib/sisimai/rfc1123.rb +1 -1
- data/lib/sisimai/rfc1894.rb +7 -6
- data/lib/sisimai/rfc2045.rb +2 -2
- data/lib/sisimai/rfc3464/thirdparty.rb +1 -1
- data/lib/sisimai/rfc3464.rb +10 -14
- data/lib/sisimai/rfc3834.rb +3 -4
- data/lib/sisimai/rfc791.rb +3 -38
- data/lib/sisimai/rhost/apple.rb +5 -5
- data/lib/sisimai/rhost/cloudflare.rb +2 -0
- data/lib/sisimai/rhost/cox.rb +22 -20
- data/lib/sisimai/rhost/facebook.rb +16 -16
- data/lib/sisimai/rhost/franceptt.rb +8 -3
- data/lib/sisimai/rhost/godaddy.rb +33 -15
- data/lib/sisimai/rhost/google.rb +63 -64
- data/lib/sisimai/rhost/iua.rb +1 -1
- data/lib/sisimai/rhost/messagelabs.rb +12 -12
- data/lib/sisimai/rhost/microsoft.rb +86 -86
- data/lib/sisimai/rhost/mimecast.rb +34 -34
- data/lib/sisimai/rhost/nttdocomo.rb +2 -2
- data/lib/sisimai/rhost/spectrum.rb +7 -7
- data/lib/sisimai/rhost/tencent.rb +9 -11
- data/lib/sisimai/rhost/yahooinc.rb +7 -8
- data/lib/sisimai/rhost.rb +1 -1
- data/lib/sisimai/smtp/command.rb +2 -0
- data/lib/sisimai/smtp/status.rb +73 -109
- data/lib/sisimai/string.rb +0 -27
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/maildir/bsd/lhost-deutschetelekom-01.eml +66 -0
- data/set-of-emails/maildir/bsd/lhost-deutschetelekom-02.eml +68 -0
- data/set-of-emails/maildir/bsd/lhost-deutschetelekom-03.eml +50 -0
- data/set-of-emails/should-not-crash/p5-664-iomart-mail-filter.eml +258 -0
- data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/.gitkeep +0 -0
- metadata +10 -6
- data/lib/sisimai/reason/exceedlimit.rb +0 -47
- data/lib/sisimai/reason/speeding.rb +0 -47
- data/lib/sisimai/reason/toomanyconn.rb +0 -59
|
@@ -7,93 +7,67 @@ module Sisimai
|
|
|
7
7
|
# or the parameter of "HELO/EHLO" command. This reason has added in Sisimai 4.0.0.
|
|
8
8
|
module Blocked
|
|
9
9
|
class << self
|
|
10
|
-
require 'sisimai/string'
|
|
11
|
-
|
|
12
10
|
Index = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'no access from mail server',
|
|
46
|
-
'no matches to nameserver query',
|
|
47
|
-
'not currently accepting mail from your ip', # Microsoft
|
|
48
|
-
'part of their network is on our block list',
|
|
49
|
-
'please use the smtp server of your isp',
|
|
50
|
-
'refused - see http',
|
|
51
|
-
'rejected - multi-blacklist', # junkemailfilter.com
|
|
52
|
-
'rejected because the sending mta or the sender has not passed validation',
|
|
53
|
-
'rejecting open proxy', # Sendmail(srvrsmtp.c)
|
|
54
|
-
'sender ip address rejected',
|
|
55
|
-
'server access forbidden by your ip ',
|
|
56
|
-
'service not available, closing transmission channel',
|
|
57
|
-
'smtp error from remote mail server after initial connection:', # Exim
|
|
58
|
-
"sorry, that domain isn't in my list of allowed rcpthosts",
|
|
59
|
-
'sorry, your remotehost looks suspiciously like spammer',
|
|
60
|
-
'temporarily deferred due to unexpected volume or user complaints',
|
|
61
|
-
'to submit messages to this e-mail system has been rejected',
|
|
62
|
-
'too many spams from your ip', # free.fr
|
|
63
|
-
'too many unwanted messages have been sent from the following ip address above',
|
|
64
|
-
'was blocked by ',
|
|
65
|
-
'we do not accept mail from dynamic ips', # @mail.ru
|
|
66
|
-
'you are not allowed to connect',
|
|
67
|
-
'you are sending spam',
|
|
68
|
-
'your ip address is listed in the rbl',
|
|
69
|
-
'your network is temporary blacklisted',
|
|
70
|
-
'your server requires confirmation',
|
|
11
|
+
"bad sender ip address",
|
|
12
|
+
"banned sending ip", # Office365
|
|
13
|
+
"blacklisted by",
|
|
14
|
+
"dnsbl:attrbl",
|
|
15
|
+
"client host rejected: abus detecte gu_eib_02", # SFR
|
|
16
|
+
"client host rejected: abus detecte gu_eib_04", # SFR
|
|
17
|
+
"client host rejected: may not be mail exchanger",
|
|
18
|
+
"connection refused by",
|
|
19
|
+
"currently sending spam see: ",
|
|
20
|
+
"domain does not exist:",
|
|
21
|
+
"domain isn't in my list of allowed rcpthosts",
|
|
22
|
+
"error: no valid recipients from ",
|
|
23
|
+
"esmtp not accepting connections", # icloud.com
|
|
24
|
+
"extreme bad ip profile",
|
|
25
|
+
"helo command rejected:",
|
|
26
|
+
"host network not allowed",
|
|
27
|
+
"invalid ip for sending mail of domain",
|
|
28
|
+
"is in a black list",
|
|
29
|
+
"is not allowed to send mail from",
|
|
30
|
+
"no access from mail server",
|
|
31
|
+
"part of their network is on our block list",
|
|
32
|
+
"please use the smtp server of your isp",
|
|
33
|
+
"rejected because the sending mta or the sender has not passed validation",
|
|
34
|
+
"rejecting open proxy", # Sendmail(srvrsmtp.c)
|
|
35
|
+
"sender ip address rejected",
|
|
36
|
+
"server access forbidden by your ip ",
|
|
37
|
+
"smtp error from remote mail server after initial connection:", # Exim
|
|
38
|
+
"you are not allowed to connect",
|
|
39
|
+
"your ip address is listed in the rbl",
|
|
40
|
+
"your network is temporary blacklisted",
|
|
41
|
+
"your remotehost looks suspiciously like spammer",
|
|
42
|
+
"your server requires confirmation",
|
|
71
43
|
].freeze
|
|
72
44
|
Pairs = [
|
|
73
|
-
[
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
77
|
-
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
[
|
|
83
|
-
[
|
|
84
|
-
[
|
|
85
|
-
["
|
|
86
|
-
[
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
[
|
|
90
|
-
[
|
|
91
|
-
[
|
|
92
|
-
[
|
|
93
|
-
[
|
|
94
|
-
[
|
|
45
|
+
["(", "@", ":blocked)"],
|
|
46
|
+
["access from ip address ", " blocked"],
|
|
47
|
+
["blocked by ", " dnsbl"],
|
|
48
|
+
["client ", " blocked using"],
|
|
49
|
+
["connection ", "dropped"],
|
|
50
|
+
["client host ", " blocked using"],
|
|
51
|
+
["connections will not be accepted from ", " because the ip is in spamhaus's list"],
|
|
52
|
+
["dynamic", " ip"],
|
|
53
|
+
["email blocked by ", ".barracudacentral.org"],
|
|
54
|
+
["email blocked by ", "spamhaus"],
|
|
55
|
+
["from ", " ip address"],
|
|
56
|
+
["host ", " said: ", "550 blocked"],
|
|
57
|
+
["host ", " refused to talk to me: ", " blocked"],
|
|
58
|
+
["ip ", " is blocked by earthlink"], # Earthlink
|
|
59
|
+
["is in an ", "rbl on "],
|
|
60
|
+
["mail server at ", " is blocked"],
|
|
61
|
+
["mail from "," refused"],
|
|
62
|
+
["message from ", " rejected based on blacklist"],
|
|
63
|
+
["messages from ", " temporarily deferred due to user complaints"], # Yahoo!
|
|
64
|
+
["server ip ", " listed as abusive"],
|
|
65
|
+
["sorry! your ip address", " is blocked by rbl"], # junkemailfilter.com
|
|
66
|
+
["the ", " is blacklisted"], # the email, the domain, the ip
|
|
67
|
+
["veuillez essayer plus tard. service refused, please try later. ", "103"],
|
|
68
|
+
["veuillez essayer plus tard. service refused, please try later. ", "510"],
|
|
95
69
|
["your access ip", " has been rejected"],
|
|
96
|
-
["your sender's ip address is listed at ",
|
|
70
|
+
["your sender's ip address is listed at ", ".abuseat.org"],
|
|
97
71
|
].freeze
|
|
98
72
|
|
|
99
73
|
def text; return 'blocked'; end
|
|
@@ -9,14 +9,22 @@ module Sisimai
|
|
|
9
9
|
module ContentError
|
|
10
10
|
class << self
|
|
11
11
|
Index = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
"charset not supported",
|
|
13
|
+
"executable files are not allowed in compressed files",
|
|
14
|
+
"header error",
|
|
15
|
+
"header size exceeds maximum permitted",
|
|
16
|
+
"illegal attachment on your message",
|
|
17
|
+
"improper use of 8-bit data in message header",
|
|
18
|
+
"it has a potentially executable attachment",
|
|
19
|
+
"message contain invalid mime headers",
|
|
20
|
+
"message contain improperly-formatted binary content",
|
|
21
|
+
"message contain text that uses unnecessary base64 encoding",
|
|
22
|
+
"message header size, or recipient list, exceeds policy limit",
|
|
23
|
+
"message mime complexity exceeds the policy maximum",
|
|
24
|
+
"message was blocked because its content presents a potential", # https://support.google.com/mail/answer/6590
|
|
25
|
+
"routing loop detected -- too many received: headers",
|
|
26
|
+
'too many "received" headers', # Exim/deliver.c:5425
|
|
27
|
+
"we do not accept messages containing images or other attachments",
|
|
20
28
|
].freeze
|
|
21
29
|
|
|
22
30
|
def text; return 'contenterror'; end
|
|
@@ -2,27 +2,25 @@ module Sisimai
|
|
|
2
2
|
module Reason
|
|
3
3
|
# This is the error that a sent email size is too big for a destination mail server. In many
|
|
4
4
|
# case, There are many attachment files with email, or the file size is too large. Sisimai will
|
|
5
|
-
# set "
|
|
6
|
-
# is "5.3.4".
|
|
7
|
-
module
|
|
5
|
+
# set "emailtoolarge" to the reason of email bounce if the value of Status: field in a bounce
|
|
6
|
+
# email is "5.2.3" or "5.3.4".
|
|
7
|
+
module EmailTooLarge
|
|
8
8
|
class << self
|
|
9
9
|
Index = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'size limit',
|
|
22
|
-
'taille limite du message atteinte',
|
|
10
|
+
"exceeds the maximum size ",
|
|
11
|
+
"line limit exceeded",
|
|
12
|
+
"message too large",
|
|
13
|
+
"size limit",
|
|
14
|
+
"taille limite du message atteinte",
|
|
15
|
+
].freeze
|
|
16
|
+
Pairs = [
|
|
17
|
+
["exceeded", "message size"],
|
|
18
|
+
["message ", "exceeds ", "limit"],
|
|
19
|
+
["message ", "size", "exceed"],
|
|
20
|
+
["message ", "too", "big"],
|
|
23
21
|
].freeze
|
|
24
22
|
|
|
25
|
-
def text; return '
|
|
23
|
+
def text; return 'emailtoolarge'; end
|
|
26
24
|
def description; return 'Email rejected due to an email size is too big for a destination mail server'; end
|
|
27
25
|
|
|
28
26
|
# Try to match that the given text and regular expressions
|
|
@@ -31,6 +29,7 @@ module Sisimai
|
|
|
31
29
|
def match(argv1)
|
|
32
30
|
return false if argv1.nil? || argv1.empty?
|
|
33
31
|
return true if Index.any? { |a| argv1.include?(a) }
|
|
32
|
+
return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
|
|
34
33
|
return false
|
|
35
34
|
end
|
|
36
35
|
|
|
@@ -40,18 +39,18 @@ module Sisimai
|
|
|
40
39
|
# false: is not big
|
|
41
40
|
# @see http://www.ietf.org/rfc/rfc2822.txt
|
|
42
41
|
def true(argvs)
|
|
43
|
-
return true if argvs['reason'] == '
|
|
42
|
+
return true if argvs['reason'] == 'emailtoolarge'
|
|
44
43
|
|
|
45
44
|
statuscode = argvs['deliverystatus'] || ''
|
|
46
45
|
tempreason = Sisimai::SMTP::Status.name(statuscode)
|
|
47
46
|
|
|
48
|
-
# Delivery status code points "
|
|
47
|
+
# Delivery status code points "emailtoolarge".
|
|
49
48
|
# Status: 5.3.4
|
|
50
49
|
# Diagnostic-Code: SMTP; 552 5.3.4 Error: message file too big
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#
|
|
54
|
-
return
|
|
50
|
+
#
|
|
51
|
+
# Status: 5.2.3
|
|
52
|
+
# Deiagnostic-Code: Message length exceeds administrative limit
|
|
53
|
+
return true if tempreason == 'emailtoolarge'
|
|
55
54
|
return match(argvs['diagnosticcode'].downcase)
|
|
56
55
|
end
|
|
57
56
|
|
|
@@ -60,5 +59,3 @@ module Sisimai
|
|
|
60
59
|
end
|
|
61
60
|
end
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
@@ -7,32 +7,36 @@ module Sisimai
|
|
|
7
7
|
# the message you sent has been in the queue for long time.
|
|
8
8
|
module Expired
|
|
9
9
|
class << self
|
|
10
|
-
require 'sisimai/string'
|
|
11
|
-
|
|
12
10
|
Index = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
11
|
+
"connection timed out",
|
|
12
|
+
"could not find a gateway for",
|
|
13
|
+
"delay reason: ", # Exim/deliver.c:7459
|
|
14
|
+
"delivery attempts will continue to be",
|
|
15
|
+
"envelope expired", # OpenSMTPD/smtpd/queue.c:221
|
|
16
|
+
"failed to deliver to domain ",
|
|
17
|
+
"frozen on arrival", # Exim/receive.c:4022
|
|
18
|
+
"has been delayed",
|
|
19
|
+
"has been frozen", # Exim/deliver.c:7586
|
|
20
|
+
"have been failing for a long time", # Exim/smtp.c:3508
|
|
21
|
+
"host not reachable",
|
|
22
|
+
"it has not been collected after",
|
|
23
|
+
"message could not be delivered for more than",
|
|
24
|
+
"message expired, ",
|
|
25
|
+
"message has been in the queue too long",
|
|
26
|
+
"message was not delivered within ",
|
|
27
|
+
"message timed out",
|
|
28
|
+
"retry timeout exceeded", # Exim/retry.c:902
|
|
29
|
+
"server did not accept our requests to connect",
|
|
30
|
+
"server did not respond",
|
|
31
|
+
"unable to deliver message after multiple retries",
|
|
33
32
|
].freeze
|
|
34
33
|
Pairs = [
|
|
35
|
-
[
|
|
34
|
+
["could not be delivered for", " days"],
|
|
35
|
+
["could not deliver for the last", "second"],
|
|
36
|
+
["delivery ", "expired"],
|
|
37
|
+
["delivery ", "delayed"],
|
|
38
|
+
["exceed", "time", "out"],
|
|
39
|
+
["not", "reach", "period"], # Exim/smtp.c:3508
|
|
36
40
|
].freeze
|
|
37
41
|
|
|
38
42
|
def text; return 'expired'; end
|
|
@@ -10,22 +10,18 @@ module Sisimai
|
|
|
10
10
|
module Filtered
|
|
11
11
|
class << self
|
|
12
12
|
Index = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'has restricted sms e-mail', # AT&T
|
|
17
|
-
'is not accepting any mail',
|
|
13
|
+
"account is protected by",
|
|
14
|
+
"has restricted sms e-mail", # AT&T
|
|
15
|
+
"is not accepting any mail",
|
|
18
16
|
"message filtered",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'we failed to deliver mail because the following address recipient id refuse to receive mail', # Willcom
|
|
28
|
-
'you have been blocked by the recipient',
|
|
17
|
+
"message rejected due to user rules",
|
|
18
|
+
"not found recipient account",
|
|
19
|
+
"recipient id refuse to receive mail", # Willcom
|
|
20
|
+
"recipient is only accepting mail from specific email addresses", # AOL Phoenix
|
|
21
|
+
"refused due to recipient preferences", # Facebook
|
|
22
|
+
"user refuses to receive this mail",
|
|
23
|
+
"user reject",
|
|
24
|
+
"you have been blocked by the recipient",
|
|
29
25
|
].freeze
|
|
30
26
|
|
|
31
27
|
def text; return 'filtered'; end
|
|
@@ -48,7 +44,6 @@ module Sisimai
|
|
|
48
44
|
def true(argvs)
|
|
49
45
|
return true if argvs['reason'] == 'filtered'
|
|
50
46
|
|
|
51
|
-
require 'sisimai/reason/userunknown'
|
|
52
47
|
tempreason = Sisimai::SMTP::Status.name(argvs['deliverystatus'])
|
|
53
48
|
return false if tempreason == 'suspend'
|
|
54
49
|
|
|
@@ -56,12 +51,13 @@ module Sisimai
|
|
|
56
51
|
thecommand = argvs['command'] || ''
|
|
57
52
|
if tempreason == 'filtered'
|
|
58
53
|
# Delivery status code points "filtered".
|
|
54
|
+
require 'sisimai/reason/userunknown'
|
|
59
55
|
return true if Sisimai::Reason::UserUnknown.match(issuedcode) || match(issuedcode)
|
|
60
56
|
else
|
|
61
57
|
# The value of "reason" isn't "filtered" when the value of "command" is an SMTP command
|
|
62
58
|
# to be sent before the SMTP DATA command because all the MTAs read the headers and the
|
|
63
59
|
# entire message body after the DATA command.
|
|
64
|
-
return false if
|
|
60
|
+
return false if Sisimai::SMTP::Command::ExceptDATA.include?(thecommand)
|
|
65
61
|
return true if match(issuedcode) || Sisimai::Reason::UserUnknown.match(issuedcode)
|
|
66
62
|
end
|
|
67
63
|
return false
|
|
@@ -28,7 +28,8 @@ module Sisimai
|
|
|
28
28
|
# false: Has not moved
|
|
29
29
|
# @see http://www.ietf.org/rfc/rfc2822.txt
|
|
30
30
|
def true(argvs)
|
|
31
|
-
return true
|
|
31
|
+
return true if argvs['reason'] == 'hasmoved'
|
|
32
|
+
return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
|
|
32
33
|
return match(argvs['diagnosticcode'].downcase)
|
|
33
34
|
end
|
|
34
35
|
|
|
@@ -6,26 +6,31 @@ module Sisimai
|
|
|
6
6
|
# Status: field in a bounce mail is "5.1.2".
|
|
7
7
|
module HostUnknown
|
|
8
8
|
class << self
|
|
9
|
-
require 'sisimai/string'
|
|
10
|
-
|
|
11
9
|
Index = [
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
"all host address lookups failed", # Exim/transports/smtp.c:3524
|
|
11
|
+
"couldn't find any host ", # qmail-remote.c:78
|
|
12
|
+
"dns server returned answer with no data",
|
|
13
|
+
"domain is not reachable",
|
|
14
|
+
"domain mentioned in email address is unknown",
|
|
15
|
+
"domain must exist",
|
|
16
|
+
"domain name not found",
|
|
17
|
+
"host or domain name not found",
|
|
18
|
+
"host unknown",
|
|
19
|
+
"host unreachable",
|
|
20
|
+
"illegal host/domain name found",
|
|
21
|
+
"invalid domain name", # OpenSMTPD/smtpd/mta.c:976
|
|
22
|
+
"mx records point to non-existent hosts", # Exim/routers/dnslookup.c:331
|
|
23
|
+
"name or service not known",
|
|
24
|
+
"no such domain",
|
|
25
|
+
"recipient address rejected: unknown domain name",
|
|
26
|
+
"responded with code nxdomain",
|
|
27
|
+
"unknown host",
|
|
28
|
+
].freeze
|
|
29
|
+
Pairs = [
|
|
30
|
+
["domain ", "not exist"],
|
|
31
|
+
["host ", " not found"],
|
|
32
|
+
["unrout", "able ", "address"],
|
|
27
33
|
].freeze
|
|
28
|
-
Pairs = [['553 ', ' does not exist']].freeze
|
|
29
34
|
|
|
30
35
|
def text; return 'hostunknown'; end
|
|
31
36
|
def description; return "Delivery failed due to a domain part of a recipient's email address does not exist"; end
|
|
@@ -47,7 +52,8 @@ module Sisimai
|
|
|
47
52
|
# false: is not unknown host.
|
|
48
53
|
# @see http://www.ietf.org/rfc/rfc2822.txt
|
|
49
54
|
def true(argvs)
|
|
50
|
-
return true
|
|
55
|
+
return true if argvs['reason'] == 'hostunknown'
|
|
56
|
+
return false if Sisimai::SMTP::Command::BeforeRCPT.include?(argvs['command'])
|
|
51
57
|
|
|
52
58
|
issuedcode = argvs['diagnosticcode'].downcase || ''
|
|
53
59
|
statuscode = argvs['deliverystatus'] || ''
|
|
@@ -8,55 +8,33 @@ module Sisimai
|
|
|
8
8
|
module MailboxFull
|
|
9
9
|
class << self
|
|
10
10
|
Index = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
'mailfolder is full',
|
|
39
|
-
'no space left on device',
|
|
40
|
-
'not enough disk space',
|
|
41
|
-
'not enough storage space in',
|
|
42
|
-
'not sufficient disk space',
|
|
43
|
-
'over the allowed quota',
|
|
44
|
-
'quota exceeded',
|
|
45
|
-
'quota violation for',
|
|
46
|
-
'recipient reached disk quota',
|
|
47
|
-
'recipient rejected: mailbox would exceed maximum allowed storage',
|
|
48
|
-
'the recipient mailbox has exceeded its disk space limit',
|
|
49
|
-
"the user's space has been used up",
|
|
50
|
-
'the user you are trying to reach is over quota',
|
|
51
|
-
'too much mail data', # @docomo.ne.jp
|
|
52
|
-
'user has exceeded quota, bouncing mail',
|
|
53
|
-
'user has too many messages on the server',
|
|
54
|
-
'user is over quota',
|
|
55
|
-
'user is over the quota',
|
|
56
|
-
'user over quota',
|
|
57
|
-
'user over quota. (#5.1.1)', # qmail-toaster
|
|
58
|
-
'was automatically rejected: quota exceeded',
|
|
59
|
-
'would be over the allowed quota',
|
|
11
|
+
"452 insufficient disk space",
|
|
12
|
+
"account disabled temporarly for exceeding receiving limits",
|
|
13
|
+
"boite du destinataire pleine",
|
|
14
|
+
"exceeded storage allocation",
|
|
15
|
+
"full mailbox",
|
|
16
|
+
"mailbox exceeds allowed size",
|
|
17
|
+
"mailbox size limit exceeded",
|
|
18
|
+
"mailbox would exceed maximum allowed storage",
|
|
19
|
+
"mailfolder is full",
|
|
20
|
+
"no space left on device",
|
|
21
|
+
"not sufficient disk space",
|
|
22
|
+
"quota violation for",
|
|
23
|
+
"too much mail data", # @docomo.ne.jp
|
|
24
|
+
"user has exceeded quota, bouncing mail",
|
|
25
|
+
"user has too many messages on the server",
|
|
26
|
+
"user's space has been used up",
|
|
27
|
+
].freeze
|
|
28
|
+
Pairs = [
|
|
29
|
+
["account is ", " quota"],
|
|
30
|
+
["disk", "quota"],
|
|
31
|
+
["enough ", " space"],
|
|
32
|
+
["mailbox ", "exceeded", " limit"],
|
|
33
|
+
["mailbox ", "full"], # Exim/transports/appendfile.c:2567
|
|
34
|
+
["mailbox ", "quota"],
|
|
35
|
+
["maildir ", "quota"],
|
|
36
|
+
["over ", "quota"],
|
|
37
|
+
["quota ", "exceeded"], # Exim/transports/appendfile.c:3050
|
|
60
38
|
].freeze
|
|
61
39
|
|
|
62
40
|
def text; return 'mailboxfull'; end
|
|
@@ -68,6 +46,7 @@ module Sisimai
|
|
|
68
46
|
def match(argv1)
|
|
69
47
|
return false if argv1.nil? || argv1.empty?
|
|
70
48
|
return true if Index.any? { |a| argv1.include?(a) }
|
|
49
|
+
return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
|
|
71
50
|
return false
|
|
72
51
|
end
|
|
73
52
|
|
|
@@ -11,22 +11,33 @@ module Sisimai
|
|
|
11
11
|
module NetworkError
|
|
12
12
|
class << self
|
|
13
13
|
Index = [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
"address family mismatch on destination mxs", # OpenSMTPD/smtpd/mta.c
|
|
15
|
+
"all routes to destination blocked", # OpenSMTPD/smtpd/mta.c
|
|
16
|
+
"bad dns lookup error code", # OpenSMTPD/smtpd/mta.c
|
|
17
|
+
"could not connect and send the mail to",
|
|
18
|
+
"could not contact dns servers",
|
|
19
|
+
"could not retrieve source address", # OpenSMTPD/smtpd/mta.c
|
|
20
|
+
"dns records for the destination computer could not be found",
|
|
21
|
+
"establish an smtp connection",
|
|
22
|
+
"exceeded maximum hop count", # Courier
|
|
23
|
+
"host is unreachable",
|
|
24
|
+
"host name lookup failure",
|
|
25
|
+
"host not found, try again",
|
|
26
|
+
"listed as a best-preference mx",
|
|
27
|
+
"loop detected", # OpenSMTPD/smtpd/mta.c
|
|
28
|
+
"maximum forwarding loop count exceeded",
|
|
29
|
+
"network error on destination mxs", # OpenSMTPD/smtpd/mta.c
|
|
30
|
+
"no relevant answers",
|
|
31
|
+
"temporary failure in mx lookup", # OpenSMTPD/smtpd/mta.c
|
|
32
|
+
"too many hops",
|
|
33
|
+
"unable to resolve route ",
|
|
34
|
+
"unrouteable mail domain",
|
|
35
|
+
].freeze
|
|
36
|
+
Pairs = [
|
|
37
|
+
["malformed", "name server reply"],
|
|
38
|
+
["mail ", "loop"],
|
|
39
|
+
["message ", "loop"],
|
|
40
|
+
["no ", "route to"],
|
|
30
41
|
].freeze
|
|
31
42
|
|
|
32
43
|
def text; return 'networkerror'; end
|
|
@@ -38,6 +49,7 @@ module Sisimai
|
|
|
38
49
|
def match(argv1)
|
|
39
50
|
return false if argv1.nil? || argv1.empty?
|
|
40
51
|
return true if Index.any? { |a| argv1.include?(a) }
|
|
52
|
+
return true if Pairs.any? { |a| Sisimai::String.aligned(argv1, a) }
|
|
41
53
|
return false
|
|
42
54
|
end
|
|
43
55
|
|