Sisimai/Reason/NotAccept.pm

filter: Statementstmt 100% 31 / 31 Branchbran 100% 8 / 8 Conditioncond 91.6% 11 / 12 MC/DCmcdc 83.3% 5 / 6 Subroutinesub 100% 8 / 8 Podpod 50.0% 2 / 4 totaltotal 94.2% 65 / 69 CC 10 SCAR 14.3
CC
10
Cov
98%
true
7.0
match
4.0
BEGIN
1.0
CRAP 4.2
« Sisimai/Rhost/IUA.pm ↑ Summary Sisimai/Reason/SpamDetected.pm »
1 package Sisimai::Reason::NotAccept;
2 55 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 55 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 55 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 55 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 26 ▶sub text { $Sisimai::Eb::Re00MX }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { 'Delivery failed due to a destination mail server does not accept any email' }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 1074 ▶sub match {
Subroutine match: called CC=4 SCAR=13.9
Pod documented
10 # Try to match that the given text and regular expressions
11 # @param [String] argv1 String to be matched with regular expressions
12 # @return [Integer] 0: Did not match
13 # 1: Matched
14 # @since v4.0.0
15 1074 my $class = shift;
16 1074 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
10731
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 # Destination mail server does not accept any message
19 1073 state $index = [
20 "destination seem to reject all mails", # OpenSMTPD/smtp/mta.c
21 "does not accept mail", # Sendmail, iCloud
22 "mail receiving disabled",
23 "mx or srv record indicated no smtp ", # Exim/routers/dnslookup.c:328
24 "name server: .: host not found", # Sendmail
25 "no host found for existing smtp ", # Exim/transports/smtp.c:3502
26 "no route for current request",
27 "null mx",
28 ];
29 1073 state $pairs = [
30 ["no mx ", "found for "], # OpenSMTPD/smtp/mta.c
31 ];
32 1073 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 13 1060 1073
33 1060 ▶ return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs;
Branch: 1 branch
BranchTrueFalseTotal
if grep {"Sisimai::String"->aligned(\$argv1, $_);} @$pairs 10 1050 1060
34 1050 return 0;
35 }
36  
37 641 ▶sub true {
Subroutine true: called CC=7 SCAR=19.5
Pod undocumented
38 # Remote host does not accept any message
39 # @param [Sisimai::Fact] argvs Object to be detected the reason
40 # @return [Integer] 1: Not accept
41 # 0: Accept
42 # @since v4.0.0
43 # @see http://www.ietf.org/rfc/rfc2822.txt
44 641 my $class = shift;
45 641 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
6401
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
46 640 ▶ my $reply = $argvs->{'replycode'} || 0;
Condition100%2/2
$argvs->{'replycode'} || 0
l!l
291349
MC/DC100%1/1
$argvs->{'replycode'} || 0
$argvs->{'replycode'}
Truth table100%2/2
A
A= $argvs->{'replycode'}
Aresult
11
00
47  
48 # SMTP Reply Code is 521, 554 or 556
49 640 require Sisimai::SMTP::Command;
50 640 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::Re00MX || $reply == 521 || $reply == 556;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521 or $reply == 556 6 634 640
Condition83%5/6
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521 or $reply == 556
l!l&&r!l&&!r
60634
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521
l!l&&r!l&&!r
15634
MC/DC66%2/3
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX or $reply == 521 or $reply == 556
$argvs->{"reason"} eq $Sisimai::Eb::Re00MX $reply == 521 $reply == 556
Truth table75%3/4
A or B or C
A= $argvs->{"reason"} eq $Sisimai::Eb::Re00MXB= $reply == 521C= $reply == 556
ABCresult
1XX1
01X1
0011
0000
51 634 ▶ return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->BeforeRCPT->@*;
Branch: 1 branch
BranchTrueFalseTotal
if grep {$argvs->{"command"} eq $_;} @{"Sisimai::SMTP::Command"->BeforeRCPT} 76 558 634
52 558 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
53 }
54  
55 55 1;
56 __END__
« Sisimai/Rhost/IUA.pm ↑ Summary Sisimai/Reason/SpamDetected.pm »