line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sisimai::Reason::Filtered; |
2
|
45
|
|
|
45
|
|
2167
|
use feature ':5.10'; |
|
45
|
|
|
|
|
98
|
|
|
45
|
|
|
|
|
3966
|
|
3
|
45
|
|
|
45
|
|
296
|
use strict; |
|
45
|
|
|
|
|
86
|
|
|
45
|
|
|
|
|
1039
|
|
4
|
45
|
|
|
45
|
|
218
|
use warnings; |
|
45
|
|
|
|
|
76
|
|
|
45
|
|
|
|
|
19824
|
|
5
|
|
|
|
|
|
|
|
6
|
188
|
|
|
188
|
1
|
417
|
sub text { 'filtered' } |
7
|
4
|
|
|
4
|
0
|
16
|
sub description { 'Email rejected due to a header content after SMTP DATA command' } |
8
|
|
|
|
|
|
|
sub match { |
9
|
|
|
|
|
|
|
# Try to match that the given text and regular expressions |
10
|
|
|
|
|
|
|
# @param [String] argv1 String to be matched with regular expressions |
11
|
|
|
|
|
|
|
# @return [Integer] 0: Did not match |
12
|
|
|
|
|
|
|
# 1: Matched |
13
|
|
|
|
|
|
|
# @since v4.0.0 |
14
|
934
|
|
|
934
|
1
|
1416
|
my $class = shift; |
15
|
934
|
|
50
|
|
|
1909
|
my $argv1 = shift // return undef; |
16
|
|
|
|
|
|
|
|
17
|
934
|
|
|
|
|
1298
|
state $index = [ |
18
|
|
|
|
|
|
|
'because the recipient is only accepting mail from specific email addresses', # AOL Phoenix |
19
|
|
|
|
|
|
|
'bounced address', # SendGrid|a message to an address has previously been Bounced. |
20
|
|
|
|
|
|
|
'due to extended inactivity new mail is not currently being accepted for this mailbox', |
21
|
|
|
|
|
|
|
'has restricted sms e-mail', # AT&T |
22
|
|
|
|
|
|
|
'is not accepting any mail', |
23
|
|
|
|
|
|
|
'message rejected due to user rules', |
24
|
|
|
|
|
|
|
'not found recipient account', |
25
|
|
|
|
|
|
|
'refused due to recipient preferences', # Facebook |
26
|
|
|
|
|
|
|
'resolver.rst.notauthorized', # Microsoft Exchange |
27
|
|
|
|
|
|
|
'this account is protected by', |
28
|
|
|
|
|
|
|
'user not found', # Filter on MAIL.RU |
29
|
|
|
|
|
|
|
'user reject', |
30
|
|
|
|
|
|
|
'we failed to deliver mail because the following address recipient id refuse to receive mail', # Willcom |
31
|
|
|
|
|
|
|
'you have been blocked by the recipient', |
32
|
|
|
|
|
|
|
]; |
33
|
934
|
100
|
|
|
|
1614
|
return 1 if grep { rindex($argv1, $_) > -1 } @$index; |
|
13076
|
|
|
|
|
21094
|
|
34
|
931
|
|
|
|
|
2205
|
return 0; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub true { |
38
|
|
|
|
|
|
|
# Rejected by domain or address filter ? |
39
|
|
|
|
|
|
|
# @param [Sisimai::Data] argvs Object to be detected the reason |
40
|
|
|
|
|
|
|
# @return [Integer] 1: is filtered |
41
|
|
|
|
|
|
|
# 0: is not filtered |
42
|
|
|
|
|
|
|
# @since v4.0.0 |
43
|
|
|
|
|
|
|
# @see http://www.ietf.org/rfc/rfc2822.txt |
44
|
1102
|
|
|
1102
|
0
|
1771
|
my $class = shift; |
45
|
1102
|
|
100
|
|
|
2561
|
my $argvs = shift // return undef; |
46
|
1101
|
50
|
|
|
|
2359
|
return 1 if $argvs->reason eq 'filtered'; |
47
|
|
|
|
|
|
|
|
48
|
1101
|
|
100
|
|
|
5980
|
my $tempreason = Sisimai::SMTP::Status->name($argvs->deliverystatus) || ''; |
49
|
1101
|
100
|
|
|
|
2570
|
return 0 if $tempreason eq 'suspend'; |
50
|
|
|
|
|
|
|
|
51
|
1096
|
|
|
|
|
3817
|
require Sisimai::Reason::UserUnknown; |
52
|
1096
|
|
|
|
|
1662
|
my $alterclass = 'Sisimai::Reason::UserUnknown'; |
53
|
1096
|
|
50
|
|
|
2197
|
my $diagnostic = lc $argvs->diagnosticcode // ''; |
54
|
|
|
|
|
|
|
|
55
|
1096
|
100
|
|
|
|
6515
|
if( $tempreason eq 'filtered' ) { |
56
|
|
|
|
|
|
|
# Delivery status code points "filtered". |
57
|
41
|
100
|
|
|
|
144
|
return 1 if $alterclass->match($diagnostic); |
58
|
9
|
50
|
|
|
|
34
|
return 1 if __PACKAGE__->match($diagnostic); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} else { |
61
|
|
|
|
|
|
|
# The value of "reason" isn't "filtered" when the value of "smtpcommand" is an SMTP command |
62
|
|
|
|
|
|
|
# to be sent before the SMTP DATA command because all the MTAs read the headers and the |
63
|
|
|
|
|
|
|
# entire message body after the DATA command. |
64
|
1055
|
100
|
|
|
|
3423
|
return 0 if $argvs->{'smtpcommand'} =~ /\A(?:CONN|EHLO|HELO|MAIL|RCPT)\z/; |
65
|
828
|
50
|
|
|
|
1876
|
return 1 if __PACKAGE__->match($diagnostic); |
66
|
828
|
100
|
|
|
|
2758
|
return 1 if $alterclass->match($diagnostic); |
67
|
|
|
|
|
|
|
} |
68
|
683
|
|
|
|
|
2070
|
return 0; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
1; |
73
|
|
|
|
|
|
|
__END__ |