| 1 | package Sisimai::Reason::Filtered; | ||||||||||||||||||||
| 2 | 57 | ▶ | use v5.26; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 57 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 57 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 57 | ▶ | use Sisimai::Eb; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 57 | ▶ | use Sisimai::SMTP::Command; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 205 | ▶ | sub text { $Sisimai::Eb::ReFILT } | ||||||||||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 9 | 4 | ▶ | sub description { 'Email rejected due to a header content after SMTP DATA command' } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 10 | 1105 | ▶ | sub match { | ||||||||||||||||||
|
Subroutine
match: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 11 | # Try to match that the given text and regular expressions | ||||||||||||||||||||
| 12 | # @param [String] argv1 String to be matched with regular expressions | ||||||||||||||||||||
| 13 | # @return [Integer] 0: Did not match | ||||||||||||||||||||
| 14 | # 1: Matched | ||||||||||||||||||||
| 15 | # @since v4.0.0 | ||||||||||||||||||||
| 16 | 1105 | my $class = shift; | |||||||||||||||||||
| 17 | 1105 | ▶ | my $argv1 = shift // return 0; | ||||||||||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 1104 | state $index = [ | |||||||||||||||||||
| 20 | "account is protected by", | ||||||||||||||||||||
| 21 | "has restricted sms e-mail", # AT&T | ||||||||||||||||||||
| 22 | "is not accepting any mail", | ||||||||||||||||||||
| 23 | "message filtered", | ||||||||||||||||||||
| 24 | "message rejected due to user rules", | ||||||||||||||||||||
| 25 | "not found recipient account", | ||||||||||||||||||||
| 26 | "recipient id refuse to receive mail", # Willcom | ||||||||||||||||||||
| 27 | "recipient is only accepting mail from specific email addresses", # AOL Phoenix | ||||||||||||||||||||
| 28 | "refused due to recipient preferences", # Facebook | ||||||||||||||||||||
| 29 | "user refuses to receive this mail", | ||||||||||||||||||||
| 30 | "user reject", | ||||||||||||||||||||
| 31 | "you have been blocked by the recipient", | ||||||||||||||||||||
| 32 | ]; | ||||||||||||||||||||
| 33 | 1104 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 34 | 1094 | return 0; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 1360 | ▶ | sub true { | ||||||||||||||||||
|
Subroutine
true: called CC=10 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||
| 38 | # Rejected by domain or address filter ? | ||||||||||||||||||||
| 39 | # @param [Sisimai::Fact] 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 | 1360 | my $class = shift; | |||||||||||||||||||
| 45 | 1360 | ▶ | my $argvs = shift // return 0; return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReFILT; | ||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 1358 | ▶ | my $tempreason = Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || ''; | ||||||||||||||||||
|
Condition100%2/2
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
MC/DC100%1/1
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
Truth table100%2/2
A
A= 'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'})
| |||||||||||||||||||||
| 48 | 1358 | ▶ | return 0 if $tempreason eq $Sisimai::Eb::ReQUIT; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 49 | |||||||||||||||||||||
| 50 | 1358 | require Sisimai::Reason::UserUnknown; | |||||||||||||||||||
| 51 | 1358 | my $issuedcode = lc $argvs->{'diagnosticcode'}; | |||||||||||||||||||
| 52 | 1358 | ▶ | my $thecommand = $argvs->{'command'} || ''; | ||||||||||||||||||
|
Condition100%2/2
$argvs->{'command'} || ''
MC/DC100%1/1
$argvs->{'command'} || ''
$argvs->{'command'}
Truth table100%2/2
A
A= $argvs->{'command'}
| |||||||||||||||||||||
| 53 | 1358 | ▶ | if( $tempreason eq $Sisimai::Eb::ReFILT ) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 54 | # Delivery status code points "Filtered". | ||||||||||||||||||||
| 55 | 40 | ▶ | return 1 if Sisimai::Reason::UserUnknown->match($issuedcode); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 56 | 10 | return __PACKAGE__->match($issuedcode); | |||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | } else { | ||||||||||||||||||||
| 59 | # The value of "reason" isn't "Filtered" when the value of "command" is an SMTP command to | ||||||||||||||||||||
| 60 | # be sent before the SMTP DATA command because all the MTAs read the headers and the entire | ||||||||||||||||||||
| 61 | # message body after the DATA command. | ||||||||||||||||||||
| 62 | 1318 | ▶ | return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->ExceptDATA->@*; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 63 | 991 | ▶ | return 1 if __PACKAGE__->match($issuedcode); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 64 | 990 | return Sisimai::Reason::UserUnknown->match($issuedcode); | |||||||||||||||||||
| 65 | } | ||||||||||||||||||||
| 66 | } | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 57 | 1; | |||||||||||||||||||
| 69 | __END__ | ||||||||||||||||||||