sisimai 4.22.3-java → 4.22.4-java
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/.travis.yml +1 -1
- data/Benchmarks.mk +54 -0
- data/ChangeLog.md +23 -2
- data/Developers.mk +42 -35
- data/Makefile +10 -0
- data/README-JA.md +13 -13
- data/README.md +14 -14
- data/lib/sisimai.rb +12 -18
- data/lib/sisimai/address.rb +64 -82
- data/lib/sisimai/arf.rb +27 -42
- data/lib/sisimai/bite/email.rb +2 -4
- data/lib/sisimai/bite/email/activehunter.rb +12 -17
- data/lib/sisimai/bite/email/amazonses.rb +30 -48
- data/lib/sisimai/bite/email/amazonworkmail.rb +20 -27
- data/lib/sisimai/bite/email/aol.rb +27 -35
- data/lib/sisimai/bite/email/apachejames.rb +17 -28
- data/lib/sisimai/bite/email/bigfoot.rb +20 -33
- data/lib/sisimai/bite/email/biglobe.rb +15 -24
- data/lib/sisimai/bite/email/courier.rb +37 -61
- data/lib/sisimai/bite/email/domino.rb +19 -28
- data/lib/sisimai/bite/email/einsundeins.rb +20 -34
- data/lib/sisimai/bite/email/exchange2003.rb +25 -43
- data/lib/sisimai/bite/email/exchange2007.rb +15 -23
- data/lib/sisimai/bite/email/exim.rb +101 -120
- data/lib/sisimai/bite/email/ezweb.rb +28 -44
- data/lib/sisimai/bite/email/facebook.rb +26 -37
- data/lib/sisimai/bite/email/fml.rb +11 -20
- data/lib/sisimai/bite/email/gmx.rb +17 -27
- data/lib/sisimai/bite/email/google.rb +19 -29
- data/lib/sisimai/bite/email/gsuite.rb +39 -48
- data/lib/sisimai/bite/email/imailserver.rb +25 -39
- data/lib/sisimai/bite/email/interscanmss.rb +19 -26
- data/lib/sisimai/bite/email/kddi.rb +20 -33
- data/lib/sisimai/bite/email/mailfoundry.rb +14 -24
- data/lib/sisimai/bite/email/mailmarshalsmtp.rb +15 -24
- data/lib/sisimai/bite/email/mailru.rb +40 -59
- data/lib/sisimai/bite/email/mcafee.rb +21 -35
- data/lib/sisimai/bite/email/messagelabs.rb +23 -38
- data/lib/sisimai/bite/email/messagingserver.rb +15 -27
- data/lib/sisimai/bite/email/mfilter.rb +19 -28
- data/lib/sisimai/bite/email/mxlogic.rb +31 -49
- data/lib/sisimai/bite/email/notes.rb +16 -24
- data/lib/sisimai/bite/email/office365.rb +29 -38
- data/lib/sisimai/bite/email/opensmtpd.rb +50 -67
- data/lib/sisimai/bite/email/outlook.rb +24 -36
- data/lib/sisimai/bite/email/postfix.rb +33 -42
- data/lib/sisimai/bite/email/qmail.rb +44 -59
- data/lib/sisimai/bite/email/receivingses.rb +28 -36
- data/lib/sisimai/bite/email/sendgrid.rb +28 -37
- data/lib/sisimai/bite/email/sendmail.rb +35 -51
- data/lib/sisimai/bite/email/surfcontrol.rb +17 -25
- data/lib/sisimai/bite/email/userdefined.rb +17 -28
- data/lib/sisimai/bite/email/v5sendmail.rb +32 -41
- data/lib/sisimai/bite/email/verizon.rb +31 -56
- data/lib/sisimai/bite/email/x1.rb +11 -18
- data/lib/sisimai/bite/email/x2.rb +11 -23
- data/lib/sisimai/bite/email/x3.rb +10 -19
- data/lib/sisimai/bite/email/x4.rb +46 -65
- data/lib/sisimai/bite/email/x5.rb +26 -37
- data/lib/sisimai/bite/email/yahoo.rb +11 -19
- data/lib/sisimai/bite/email/yandex.rb +19 -30
- data/lib/sisimai/bite/email/zoho.rb +21 -30
- data/lib/sisimai/bite/json.rb +1 -2
- data/lib/sisimai/bite/json/amazonses.rb +20 -25
- data/lib/sisimai/bite/json/sendgrid.rb +1 -1
- data/lib/sisimai/data.rb +36 -55
- data/lib/sisimai/data/json.rb +3 -3
- data/lib/sisimai/data/yaml.rb +1 -1
- data/lib/sisimai/datetime.rb +5 -21
- data/lib/sisimai/mail.rb +4 -6
- data/lib/sisimai/mail/maildir.rb +1 -1
- data/lib/sisimai/mda.rb +41 -44
- data/lib/sisimai/message.rb +2 -3
- data/lib/sisimai/message/email.rb +42 -52
- data/lib/sisimai/message/json.rb +7 -7
- data/lib/sisimai/mime.rb +25 -23
- data/lib/sisimai/order/email.rb +2 -2
- data/lib/sisimai/order/json.rb +2 -7
- data/lib/sisimai/reason.rb +41 -46
- data/lib/sisimai/reason/blocked.rb +60 -71
- data/lib/sisimai/reason/contenterror.rb +4 -8
- data/lib/sisimai/reason/delivered.rb +1 -3
- data/lib/sisimai/reason/exceedlimit.rb +10 -20
- data/lib/sisimai/reason/expired.rb +5 -9
- data/lib/sisimai/reason/feedback.rb +1 -3
- data/lib/sisimai/reason/filtered.rb +19 -38
- data/lib/sisimai/reason/hasmoved.rb +5 -8
- data/lib/sisimai/reason/hostunknown.rb +11 -18
- data/lib/sisimai/reason/mailboxfull.rb +14 -24
- data/lib/sisimai/reason/mailererror.rb +3 -5
- data/lib/sisimai/reason/mesgtoobig.rb +15 -25
- data/lib/sisimai/reason/networkerror.rb +8 -10
- data/lib/sisimai/reason/norelaying.rb +9 -14
- data/lib/sisimai/reason/notaccept.rb +9 -21
- data/lib/sisimai/reason/onhold.rb +3 -8
- data/lib/sisimai/reason/policyviolation.rb +8 -10
- data/lib/sisimai/reason/rejected.rb +36 -49
- data/lib/sisimai/reason/securityerror.rb +11 -13
- data/lib/sisimai/reason/spamdetected.rb +23 -37
- data/lib/sisimai/reason/suspend.rb +9 -10
- data/lib/sisimai/reason/syntaxerror.rb +3 -4
- data/lib/sisimai/reason/systemerror.rb +7 -9
- data/lib/sisimai/reason/systemfull.rb +2 -4
- data/lib/sisimai/reason/toomanyconn.rb +17 -30
- data/lib/sisimai/reason/undefined.rb +1 -3
- data/lib/sisimai/reason/userunknown.rb +28 -38
- data/lib/sisimai/reason/vacation.rb +4 -6
- data/lib/sisimai/reason/virusdetected.rb +4 -6
- data/lib/sisimai/rfc2606.rb +1 -2
- data/lib/sisimai/rfc3464.rb +87 -101
- data/lib/sisimai/rfc3834.rb +29 -39
- data/lib/sisimai/rfc5322.rb +17 -24
- data/lib/sisimai/rhost.rb +10 -7
- data/lib/sisimai/rhost/exchangeonline.rb +124 -255
- data/lib/sisimai/rhost/franceptt.rb +2 -2
- data/lib/sisimai/rhost/godaddy.rb +12 -25
- data/lib/sisimai/rhost/googleapps.rb +82 -183
- data/lib/sisimai/smtp.rb +4 -4
- data/lib/sisimai/smtp/error.rb +8 -8
- data/lib/sisimai/smtp/reply.rb +1 -1
- data/lib/sisimai/smtp/status.rb +1 -0
- data/lib/sisimai/string.rb +5 -7
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/README.md +1 -1
- data/set-of-emails/maildir/bsd/README.md +50 -50
- data/sisimai-java.gemspec +1 -1
- data/sisimai.gemspec +1 -1
- metadata +4 -4
- data/lib/sisimai/skeleton.rb +0 -43
@@ -12,9 +12,7 @@ module Sisimai
|
|
12
12
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/MailerError.pm
|
13
13
|
class << self
|
14
14
|
def text; return 'mailererror'; end
|
15
|
-
def description
|
16
|
-
return 'Email returned due to a mailer program has not exited successfully'
|
17
|
-
end
|
15
|
+
def description; return 'Email returned due to a mailer program has not exited successfully'; end
|
18
16
|
|
19
17
|
# Try to match that the given text and regular expressions
|
20
18
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -33,9 +31,9 @@ module Sisimai
|
|
33
31
|
|exit[ ]\d+
|
34
32
|
|mailer[ ]error
|
35
33
|
|pipe[ ]to[ ][|][/].+
|
36
|
-
|
|
34
|
+
|x[-]unix[;][ ]\d+ # X-UNIX; 127
|
37
35
|
)
|
38
|
-
}
|
36
|
+
}x
|
39
37
|
|
40
38
|
return true if argv1 =~ regex
|
41
39
|
return false
|
@@ -9,9 +9,7 @@ module Sisimai
|
|
9
9
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/MesgTooBig.pm
|
10
10
|
class << self
|
11
11
|
def text; return 'mesgtoobig'; end
|
12
|
-
def description
|
13
|
-
return 'Email rejected due to an email size is too big for a destination mail server'
|
14
|
-
end
|
12
|
+
def description; return 'Email rejected due to an email size is too big for a destination mail server'; end
|
15
13
|
|
16
14
|
# Try to match that the given text and regular expressions
|
17
15
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -21,7 +19,7 @@ module Sisimai
|
|
21
19
|
return nil unless argv1
|
22
20
|
regex = %r{(?>
|
23
21
|
exceeded[ ]maximum[ ]inbound[ ]message[ ]size
|
24
|
-
|
|
22
|
+
|line[ ]limit[ ]exceeded
|
25
23
|
|max[ ]message[ ]size[ ]exceeded
|
26
24
|
|message[ ](?:
|
27
25
|
file[ ]too[ ]big
|
@@ -35,9 +33,9 @@ module Sisimai
|
|
35
33
|
|too[ ]large[ ]for[ ]this[ ].+
|
36
34
|
)
|
37
35
|
|size[ ]limit
|
38
|
-
|
|
36
|
+
|taille[ ]limite[ ]du[ ]message[ ]atteinte.+[a-z]{3}.+514
|
39
37
|
)
|
40
|
-
}
|
38
|
+
}x
|
41
39
|
|
42
40
|
return true if argv1 =~ regex
|
43
41
|
return false
|
@@ -51,31 +49,23 @@ module Sisimai
|
|
51
49
|
def true(argvs)
|
52
50
|
return nil unless argvs
|
53
51
|
return nil unless argvs.is_a? Sisimai::Data
|
54
|
-
return true if argvs.reason ==
|
52
|
+
return true if argvs.reason == 'mesgtoobig'
|
55
53
|
|
56
54
|
require 'sisimai/smtp/status'
|
57
55
|
statuscode = argvs.deliverystatus || ''
|
58
|
-
diagnostic = argvs.diagnosticcode || ''
|
59
|
-
reasontext = Sisimai::Reason::MesgTooBig.text
|
60
56
|
tempreason = Sisimai::SMTP::Status.name(statuscode)
|
61
|
-
v = false
|
62
57
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
# 5.2.3 Message length exceeds administrative limit
|
71
|
-
v = false
|
72
|
-
else
|
73
|
-
# Check the value of Diagnosic-Code: header with patterns
|
74
|
-
v = true if Sisimai::Reason::MesgTooBig.match(diagnostic)
|
75
|
-
end
|
76
|
-
end
|
58
|
+
# Delivery status code points "mesgtoobig".
|
59
|
+
# Status: 5.3.4
|
60
|
+
# Diagnostic-Code: SMTP; 552 5.3.4 Error: message file too big
|
61
|
+
return true if tempreason == 'mesgtoobig'
|
62
|
+
|
63
|
+
# 5.2.3 Message length exceeds administrative limit
|
64
|
+
return false if( tempreason == 'exceedlimit' || statuscode == '5.2.3' )
|
77
65
|
|
78
|
-
|
66
|
+
# Check the value of Diagnosic-Code: header with patterns
|
67
|
+
return true if match(argvs.diagnosticcode.downcase)
|
68
|
+
return false
|
79
69
|
end
|
80
70
|
|
81
71
|
end
|
@@ -14,9 +14,7 @@ module Sisimai
|
|
14
14
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/NetworkError.pm
|
15
15
|
class << self
|
16
16
|
def text; return 'networkerror'; end
|
17
|
-
def description
|
18
|
-
return 'SMTP connection failed due to DNS look up failure or other network problems'
|
19
|
-
end
|
17
|
+
def description; return 'SMTP connection failed due to DNS look up failure or other network problems'; end
|
20
18
|
|
21
19
|
# Try to match that the given text and regular expressions
|
22
20
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -26,8 +24,8 @@ module Sisimai
|
|
26
24
|
return nil unless argv1
|
27
25
|
regex = %r{(?>
|
28
26
|
could[ ]not[ ]connect[ ]and[ ]send[ ]the[ ]mail[ ]to
|
29
|
-
|
|
30
|
-
|
|
27
|
+
|dns[ ]records[ ]for[ ]the[ ]destination[ ]computer[ ]could[ ]not[ ]be[ ]found
|
28
|
+
|hop[ ]count[ ]exceeded[ ]-[ ]possible[ ]mail[ ]loop
|
31
29
|
|host[ ]is[ ]unreachable
|
32
30
|
|mail[ ]forwarding[ ]loop[ ]for[ ]
|
33
31
|
|malformed[ ]name[ ]server[ ]reply
|
@@ -37,15 +35,15 @@ module Sisimai
|
|
37
35
|
|probably[ ]in[ ]a[ ]routing[ ]loop
|
38
36
|
)
|
39
37
|
|name[ ]service[ ]error[ ]for[ ].+[ ](?:
|
40
|
-
|
41
|
-
|
|
38
|
+
malformed[ ]or[ ]unexpected[ ]name[ ]server[ ]reply
|
39
|
+
|host[ ]not[ ]found,[ ]try[ ]again
|
42
40
|
)
|
43
|
-
|
|
41
|
+
|no[ ]route[ ]to[ ]host
|
44
42
|
|too[ ]many[ ]hops
|
45
|
-
|
|
43
|
+
|unable[ ]to[ ]resolve[ ]route[ ].+[ ]
|
46
44
|
|unrouteable[ ]mail[ ]domain
|
47
45
|
)
|
48
|
-
}
|
46
|
+
}x
|
49
47
|
|
50
48
|
return true if argv1 =~ regex
|
51
49
|
return false
|
@@ -14,9 +14,7 @@ module Sisimai
|
|
14
14
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/NoRelaying.pm
|
15
15
|
class << self
|
16
16
|
def text; return 'norelaying'; end
|
17
|
-
def description
|
18
|
-
return 'Email rejected with error message "Relaying Denied"'
|
19
|
-
end
|
17
|
+
def description; return 'Email rejected with error message "Relaying Denied"'; end
|
20
18
|
|
21
19
|
# Try to match that the given text and regular expressions
|
22
20
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -26,7 +24,7 @@ module Sisimai
|
|
26
24
|
return nil unless argv1
|
27
25
|
regex = %r{(?>
|
28
26
|
as[ ]a[ ]relay
|
29
|
-
|
|
27
|
+
|insecure[ ]mail[ ]relay
|
30
28
|
|mail[ ]server[ ]requires[ ]authentication[ ]when[ ]attempting[ ]to[ ]
|
31
29
|
send[ ]to[ ]a[ ]non-local[ ]e-mail[ ]address # MailEnable
|
32
30
|
|not[ ](?:
|
@@ -40,10 +38,10 @@ module Sisimai
|
|
40
38
|
)
|
41
39
|
|relaying[ ]denied # Sendmail
|
42
40
|
|that[ ]domain[ ]isn[']t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthost
|
43
|
-
|
|
44
|
-
|
|
41
|
+
|this[ ]system[ ]is[ ]not[ ]configured[ ]to[ ]relay[ ]mail
|
42
|
+
|unable[ ]to[ ]relay[ ]for
|
45
43
|
)
|
46
|
-
}
|
44
|
+
}x
|
47
45
|
|
48
46
|
return true if argv1 =~ regex
|
49
47
|
return false
|
@@ -58,17 +56,14 @@ module Sisimai
|
|
58
56
|
return nil unless argvs
|
59
57
|
return nil unless argvs.is_a? Sisimai::Data
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
if currreason.size > 0
|
59
|
+
r = argvs.reason || ''
|
60
|
+
if r.size > 0
|
65
61
|
# Do not overwrite the reason
|
66
|
-
return false if
|
62
|
+
return false if r.start_with?('securityerror', 'systemerror', 'undefined')
|
67
63
|
else
|
68
64
|
# Check the value of Diagnosic-Code: header with patterns
|
69
|
-
return true if
|
65
|
+
return true if match(argvs.diagnosticcode.downcase)
|
70
66
|
end
|
71
|
-
|
72
67
|
return false
|
73
68
|
end
|
74
69
|
|
@@ -12,9 +12,7 @@ module Sisimai
|
|
12
12
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/NotAccept.pm
|
13
13
|
class << self
|
14
14
|
def text; return 'notaccept'; end
|
15
|
-
def description
|
16
|
-
return 'Delivery failed due to a destination mail server does not accept any email'
|
17
|
-
end
|
15
|
+
def description; return 'Delivery failed due to a destination mail server does not accept any email'; end
|
18
16
|
|
19
17
|
# Try to match that the given text and regular expressions
|
20
18
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -25,10 +23,10 @@ module Sisimai
|
|
25
23
|
|
26
24
|
# Destination mail server does not accept any message
|
27
25
|
regex = %r{(?:
|
28
|
-
|
26
|
+
name[ ]server:[ ][.]:[ ]host[ ]not[ ]found # Sendmail
|
29
27
|
|55[46][ ]smtp[ ]protocol[ ]returned[ ]a[ ]permanent[ ]error
|
30
28
|
)
|
31
|
-
}
|
29
|
+
}x
|
32
30
|
|
33
31
|
return true if argv1 =~ regex
|
34
32
|
return false
|
@@ -42,23 +40,13 @@ module Sisimai
|
|
42
40
|
def true(argvs)
|
43
41
|
return nil unless argvs
|
44
42
|
return nil unless argvs.is_a? Sisimai::Data
|
45
|
-
return true if argvs.reason ==
|
46
|
-
|
47
|
-
diagnostic = argvs.diagnosticcode || ''
|
48
|
-
v = false
|
43
|
+
return true if argvs.reason == 'notaccept'
|
49
44
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
if argvs.smtpcommand == 'MAIL'
|
56
|
-
# Matched with a pattern in this class
|
57
|
-
v = true if Sisimai::Reason::NotAccept.match(diagnostic)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
return v
|
45
|
+
# SMTP Reply Code is 554 or 556
|
46
|
+
return true if [521, 554, 556].index(argvs.replycode.to_i)
|
47
|
+
return false if argvs.smtpcommand == 'MAIL'
|
48
|
+
return true if match(argvs.diagnosticcode.downcase)
|
49
|
+
return false
|
62
50
|
end
|
63
51
|
|
64
52
|
end
|
@@ -9,9 +9,7 @@ module Sisimai
|
|
9
9
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/OnHold.pm
|
10
10
|
class << self
|
11
11
|
def text; return 'onhold'; end
|
12
|
-
def description
|
13
|
-
return 'Sisimai could not decided the reason due to there is no (or less) detailed information for judging the reason'
|
14
|
-
end
|
12
|
+
def description; return 'Sisimai could not decided the reason due to there is no (or less) detailed information for judging the reason'; end
|
15
13
|
|
16
14
|
# Try to match that the given text and regular expressions
|
17
15
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -30,13 +28,10 @@ module Sisimai
|
|
30
28
|
return nil unless argvs
|
31
29
|
return nil unless argvs.is_a? Sisimai::Data
|
32
30
|
return nil unless argvs.deliverystatus.size > 0
|
33
|
-
return true if argvs.reason ==
|
34
|
-
|
35
|
-
statuscode = argvs.deliverystatus || ''
|
36
|
-
reasontext = Sisimai::Reason::OnHold.text
|
31
|
+
return true if argvs.reason == 'onhold'
|
37
32
|
|
38
33
|
require 'sisimai/smtp/status'
|
39
|
-
return true if Sisimai::SMTP::Status.name(
|
34
|
+
return true if Sisimai::SMTP::Status.name(argvs.deliverystatus) == 'onhold'
|
40
35
|
return false
|
41
36
|
end
|
42
37
|
end
|
@@ -17,9 +17,7 @@ module Sisimai
|
|
17
17
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/PolicyViolation.pm
|
18
18
|
class << self
|
19
19
|
def text; return 'policyviolation'; end
|
20
|
-
def description
|
21
|
-
return 'Email rejected due to policy violation on a destination host'
|
22
|
-
end
|
20
|
+
def description; return 'Email rejected due to policy violation on a destination host'; end
|
23
21
|
|
24
22
|
# Try to match that the given text and regular expressions
|
25
23
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -31,24 +29,24 @@ module Sisimai
|
|
31
29
|
regex = %r{(?>
|
32
30
|
because[ ]the[ ]recipient[ ]is[ ]not[ ]accepting[ ]mail[ ]with[ ](?:attachments|embedded[ ]images) # AOL Phoenix
|
33
31
|
|closed[ ]mailing[ ]list
|
34
|
-
|
|
32
|
+
|denied[ ]by[ ]policy
|
35
33
|
|email[ ](?:
|
36
34
|
not[ ]accepted[ ]for[ ]policy[ ]reasons
|
37
35
|
# http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554
|
38
36
|
|rejected[ ]due[ ]to[ ]security[ ]policies
|
39
37
|
)
|
40
38
|
|header[ ](?:are[ ]not[ ]accepted|error)
|
41
|
-
|
|
39
|
+
|mail[ ]from[ ].+[ ]rejected[ ]for[ ]policy[ ]reasons
|
42
40
|
|message[ ](?:
|
43
41
|
given[ ]low[ ]priority
|
44
42
|
|not[ ]accepted[ ]for[ ]policy[ ]reasons
|
45
43
|
)
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
|messages[ ]with[ ]multiple[ ]addresses
|
45
|
+
|you[ ]have[ ]exceeded[ ]the[ ]the[ ]allowable[ ]number[ ]of[ ]posts[ ]without[ ]solving[ ]a[ ]captcha
|
46
|
+
|protocol[ ]violation
|
47
|
+
|the[ ]email[ ]address[ ]used[ ]to[ ]send[ ]your[ ]message[ ]is[ ]not[ ]subscribed[ ]to[ ]this[ ]group
|
50
48
|
)
|
51
|
-
}
|
49
|
+
}x
|
52
50
|
|
53
51
|
return true if argv1 =~ regex
|
54
52
|
return false
|
@@ -16,9 +16,7 @@ module Sisimai
|
|
16
16
|
# Imported from p5-Sisimail/lib/Sisimai/Reason/Rejected.pm
|
17
17
|
class << self
|
18
18
|
def text; return 'rejected'; end
|
19
|
-
def description
|
20
|
-
return "Email rejected due to a sender's email address (envelope from)"
|
21
|
-
end
|
19
|
+
def description; return "Email rejected due to a sender's email address (envelope from)"; end
|
22
20
|
|
23
21
|
# Try to match that the given text and regular expressions
|
24
22
|
# @param [String] argv1 String to be matched with regular expressions
|
@@ -26,43 +24,43 @@ module Sisimai
|
|
26
24
|
# true: Matched
|
27
25
|
def match(argv1)
|
28
26
|
return nil unless argv1
|
29
|
-
isnot = %r{(?:5[.]1[.]0[ ]
|
30
|
-
|
|
31
|
-
|
|
27
|
+
isnot = %r{(?:5[.]1[.]0[ ]address
|
28
|
+
|recipient[ ]address
|
29
|
+
|sender[ ]ip[ ]address
|
32
30
|
)[ ]rejected
|
33
|
-
}
|
31
|
+
}x
|
34
32
|
regex = %r{(?>
|
35
33
|
[<][>][ ]invalid[ ]sender
|
36
34
|
|address[ ]rejected
|
37
|
-
|
|
35
|
+
|administrative[ ]prohibition
|
38
36
|
|batv[ ](?:
|
39
37
|
failed[ ]to[ ]verify # SoniWall
|
40
38
|
|validation[ ]failure # SoniWall
|
41
39
|
)
|
42
40
|
|backscatter[ ]protection[ ]detected[ ]an[ ]invalid[ ]or[ ]expired[ ]email[ ]address # MDaemon
|
43
41
|
|bogus[ ]mail[ ]from # IMail - block empty sender
|
44
|
-
|
|
42
|
+
|connections[ ]not[ ]accepted[ ]from[ ]servers[ ]without[ ]a[ ]valid[ ]sender[ ]domain
|
45
43
|
|denied[ ]\[bouncedeny\] # McAfee
|
46
|
-
|
|
47
|
-
|does[ ]not[ ]exist[ ]
|
44
|
+
|delivery[ ]not[ ]authorized,[ ]message[ ]refused
|
45
|
+
|does[ ]not[ ]exist[ ]e2110
|
48
46
|
|domain[ ]of[ ]sender[ ]address[ ].+[ ]does[ ]not[ ]exist
|
49
|
-
|
|
47
|
+
|emetteur[ ]invalide.+[a-z]{3}.+(?:403|405|415)
|
50
48
|
|empty[ ]envelope[ ]senders[ ]not[ ]allowed
|
51
49
|
|error:[ ]no[ ]third-party[ ]dsns # SpamWall - block empty sender
|
52
|
-
|
|
50
|
+
|from:[ ]domain[ ]is[ ]invalid[.][ ]please[ ]provide[ ]a[ ]valid[ ]from:
|
53
51
|
|fully[ ]qualified[ ]email[ ]address[ ]required # McAfee
|
54
52
|
|invalid[ ]domain,[ ]see[ ][<]url:.+[>]
|
55
|
-
|
|
56
|
-
|
|
53
|
+
|mail[ ]from[ ]not[ ]owned[ ]by[ ]user.+[a-z]{3}.+421
|
54
|
+
|message[ ]rejected:[ ]email[ ]address[ ]is[ ]not[ ]verified
|
57
55
|
|mx[ ]records[ ]for[ ].+[ ]violate[ ]section[ ].+
|
58
|
-
|
|
56
|
+
|null[ ]sender[ ]is[ ]not[ ]allowed
|
59
57
|
|recipient[ ]not[ ]accepted[.][ ][(]batv:[ ]no[ ]tag
|
60
58
|
|returned[ ]mail[ ]not[ ]accepted[ ]here
|
61
59
|
|rfc[ ]1035[ ]violation:[ ]recursive[ ]cname[ ]records[ ]for
|
62
60
|
|rule[ ]imposed[ ]mailbox[ ]access[ ]for # MailMarshal
|
63
61
|
|sender[ ](?:
|
64
62
|
email[ ]address[ ]rejected
|
65
|
-
|is[ ]
|
63
|
+
|is[ ]spammer
|
66
64
|
|not[ ]pre[-]approved
|
67
65
|
|rejected
|
68
66
|
|domain[ ]is[ ]empty
|
@@ -71,10 +69,10 @@ module Sisimai
|
|
71
69
|
|syntax[ ]error:[ ]empty[ ]email[ ]address
|
72
70
|
|the[ ]message[ ]has[ ]been[ ]rejected[ ]by[ ]batv[ ]defense
|
73
71
|
|transaction[ ]failed[ ]unsigned[ ]dsn[ ]for
|
74
|
-
|
|
72
|
+
|unroutable[ ]sender[ ]address
|
75
73
|
|you[ ]are[ ]sending[ ]to[/]from[ ]an[ ]address[ ]that[ ]has[ ]been[ ]blacklisted
|
76
74
|
)
|
77
|
-
}
|
75
|
+
}x
|
78
76
|
|
79
77
|
return false if argv1 =~ isnot
|
80
78
|
return true if argv1 =~ regex
|
@@ -91,41 +89,30 @@ module Sisimai
|
|
91
89
|
return nil unless argvs.is_a? Sisimai::Data
|
92
90
|
|
93
91
|
require 'sisimai/smtp/status'
|
94
|
-
|
95
|
-
reasontext = Sisimai::Reason::Rejected.text
|
96
|
-
|
97
|
-
return true if argvs.reason == reasontext
|
98
|
-
|
99
|
-
tempreason = Sisimai::SMTP::Status.name(statuscode)
|
92
|
+
tempreason = Sisimai::SMTP::Status.name(argvs.deliverystatus)
|
100
93
|
tempreason = 'undefined' if tempreason.empty?
|
101
|
-
diagnostic = argvs.diagnosticcode
|
102
|
-
v = false
|
94
|
+
diagnostic = argvs.diagnosticcode.downcase
|
103
95
|
|
104
|
-
if
|
105
|
-
|
106
|
-
v = true
|
107
|
-
else
|
108
|
-
# Check the value of Diagnosic-Code: header with patterns
|
109
|
-
if argvs.smtpcommand == 'MAIL'
|
110
|
-
# The session was rejected at 'MAIL FROM' command
|
111
|
-
v = true if Sisimai::Reason::Rejected.match(diagnostic)
|
96
|
+
return true if argvs.reason == 'rejected'
|
97
|
+
return true if tempreason == 'rejected' # Delivery status code points "rejected".
|
112
98
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
v = true if Sisimai::Reason::Rejected.match(diagnostic)
|
124
|
-
end
|
99
|
+
# Check the value of Diagnosic-Code: header with patterns
|
100
|
+
if argvs.smtpcommand == 'MAIL'
|
101
|
+
# The session was rejected at 'MAIL FROM' command
|
102
|
+
return true if match(diagnostic)
|
103
|
+
|
104
|
+
elsif argvs.smtpcommand == 'DATA'
|
105
|
+
# The session was rejected at 'DATA' command
|
106
|
+
if tempreason != 'userunknown'
|
107
|
+
# Except "userunknown"
|
108
|
+
return true if match(diagnostic)
|
125
109
|
end
|
110
|
+
elsif %w[onhold undefined securityerror systemerror].include?(tempreason)
|
111
|
+
# Try to match with message patterns when the temporary reason
|
112
|
+
# is "onhold", "undefined", "securityerror", or "systemerror"
|
113
|
+
return true if match(diagnostic)
|
126
114
|
end
|
127
|
-
|
128
|
-
return v
|
115
|
+
return false
|
129
116
|
end
|
130
117
|
|
131
118
|
end
|