Sisimai/Reason/AuthFailure.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 8 / 8 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 9 / 9 Podpod 50.0% 2 / 4 totaltotal 96.7% 59 / 61 CC 8 SCAR 11.0
CC
8
Cov
100%
true
5.0
match
4.0
BEGIN
1.0
CRAP 3.0
« Sisimai/Reason/RequirePTR.pm ↑ Summary Sisimai/Reason/Blocked.pm »
1 package Sisimai::Reason::AuthFailure;
2 67 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 67 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 67 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 67 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 67 ▶use Sisimai::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 43 ▶sub text { $Sisimai::Eb::ReAUTH }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
9 4 ▶sub description { 'Email rejected due to SPF, DKIM, DMARC failure' }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
10 2137 ▶sub match {
Subroutine match: called CC=4 SCAR=13.9
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 v5.0.0
16 2137 my $class = shift;
17 2137 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
21361
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
18  
19 2136 state $index = [
20 "//spf.pobox.com",
21 "5322.From address doesn't meet the authentication requirements",
22 "bad spf records for",
23 "dmarc policy",
24 "doesn't meet the required authentication level",
25 "please inspect your spf settings",
26 "rejected due to dmarc", # comcast.net
27 "sender policy framework",
28 "spf check: fail",
29 ];
30 2136 state $pairs = [
31 ["spf: ", " is not allowed to send "],
32 ["is not allowed to send ", " spf "],
33 ];
34  
35 2136 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 25 2111 2136
36 2111 ▶ return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs;
Branch: 1 branch
BranchTrueFalseTotal
if grep {"Sisimai::String"->aligned(\$argv1, $_);} @$pairs 2 2109 2111
37 2109 return 0;
38 }
39  
40 2079 ▶sub true {
Subroutine true: called CC=5 SCAR=16.1
Pod undocumented
41 # The bounce reason is "AuthFailure" or not
42 # @param [Sisimai::Fact] argvs Object to be detected the reason
43 # @return [Integer] 1: is AuthFailure
44 # 0: is not AuthFailure
45 # @see http://www.ietf.org/rfc/rfc2822.txt
46 # @since v5.0.0
47 2079 my $class = shift;
48 2079 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
20781
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
49  
50 2078 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReAUTH;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReAUTH 1 2077 2078
51 2077 ▶ return 1 if (Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || '') eq $Sisimai::Eb::ReAUTH;
Branch: 1 branch
BranchTrueFalseTotal
if ("Sisimai::SMTP::Status"->name($argvs->{"deliverystatus"}) || "") eq $Sisimai::Eb::ReAUTH 20 2057 2077
Condition100%2/2
'Sisimai::SMTP::Status'->name($argvs->{'deliverystatus'}) || ''
l!l
1204873
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'})
Aresult
11
00
52 2057 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
53 }
54  
55 67 1;
56 __END__
« Sisimai/Reason/RequirePTR.pm ↑ Summary Sisimai/Reason/Blocked.pm »