Sisimai/Reason/SecurityError.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 3 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 9 / 9 Podpod 50.0% 2 / 4 totaltotal 93.6% 44 / 47 CC 4 SCAR 6.9
CC
4
Cov
97%
match
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Sisimai/Reason/NetworkError.pm ↑ Summary Sisimai/Reason/BadReputation.pm »
1 package Sisimai::Reason::SecurityError;
2 34 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 34 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 34 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 34 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 34 ▶use Sisimai::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶sub text { $Sisimai::Eb::ReSAFE }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
9 4 ▶sub description { 'Email rejected due to security violation was detected on a destination host' }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
10 454 ▶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 v4.0.0
16 454 my $class = shift;
17 454 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
4531
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
18  
19 453 state $index = [
20 "account not subscribed to ses",
21 "authentication credentials invalid",
22 "authentication failure",
23 "authentication required",
24 "authentication turned on in your email client",
25 "could not retrieve credentials", # OpenSMTPD/smtpd/mta.c
26 "unauthenticated senders not allowed",
27 "verification failure",
28 "you are not authorized to send mail, authentication is required",
29 "you don't authenticate or the domain isn't in my list of allowed rcpthosts",
30 ];
31 453 state $pairs = [
32 ["authentication failed; server ", " said: "], # Postfix
33 ["authentification invalide", "305"],
34 ["authentification requise", "402"],
35 ["user ", " is not authorized to perform ses:sendrawemail on resource"],
36 ];
37  
38 453 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 12 441 453
39 441 ▶ return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs;
Branch: 1 branch
BranchTrueFalseTotal
if grep {"Sisimai::String"->aligned(\$argv1, $_);} @$pairs 0 441 441
40 441 return 0;
41 }
42  
43 2 ▶sub true {
Subroutine true: called CC=1 SCAR=0.0
Pod undocumented
44 # The bounce reason is security error or not
45 # @param [Sisimai::Fact] argvs Object to be detected the reason
46 # @return [Integer] 1: is security error
47 # 0: is not security error
48 # @see http://www.ietf.org/rfc/rfc2822.txt
49 2 return 0;
50 }
51  
52 34 1;
53 __END__
« Sisimai/Reason/NetworkError.pm ↑ Summary Sisimai/Reason/BadReputation.pm »