Sisimai/Reason/Suspend.pm

filter: Statementstmt 100% 26 / 26 Branchbran 100% 8 / 8 Conditioncond 100% 7 / 7 MC/DCmcdc 100% 4 / 4 Subroutinesub 100% 7 / 7 Podpod 50.0% 2 / 4 totaltotal 96.4% 54 / 56 CC 8 SCAR 11.9
CC
8
Cov
100%
true
5.0
match
4.0
BEGIN
1.0
CRAP 3.3
« Sisimai/Reason/ContentError.pm ↑ Summary Sisimai/Reason/RateLimited.pm »
1 package Sisimai::Reason::Suspend;
2 68 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 68 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 68 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 68 require Sisimai::Eb;
7 49 ▶sub text { $Sisimai::Eb::ReQUIT }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { 'Email rejected due to a recipient account is being suspended' }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 2710 ▶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 2710 my $class = shift;
16 2710 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
27091
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 2709 state $index = [
19 " currently suspended",
20 " temporary locked",
21 "address no longer accepts mail",
22 "archived recipient",
23 "boite du destinataire archivee",
24 "email account that you tried to reach is inactive",
25 "inactive account",
26 "inactivity new mail is not currently being accepted for this mailbox",
27 "invalid/inactive user",
28 "is a deactivated mailbox", # http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000742
29 "is unavailable: user is terminated",
30 "mailbox is frozen",
31 "mailbox is inactive",
32 "mailbox unavailable or access denied",
33 "recipient rejected: temporarily inactive",
34 "recipient suspend the service",
35 "temporarily unavailable user",
36 "user is no longer with ",
37 "user or domain is disabled",
38 "user suspended", # http://mail.163.com/help/help_spam_16.htm
39 "vdelivermail: account is locked email bounced",
40 ];
41 2709 state $pairs = [
42 ["account ", "disabled"],
43 ["account ", "limited"],
44 ["has been ", "suspended"],
45 ["mailaddress ", "disabled"],
46 ["mailbox ", "disabled"],
47 ["not ", "active"],
48 ];
49 2709 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 9 2700 2709
50 2700 ▶ return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs;
Branch: 1 branch
BranchTrueFalseTotal
if grep {"Sisimai::String"->aligned(\$argv1, $_);} @$pairs 28 2672 2700
51 2672 return 0;
52 }
53  
54 2155 ▶sub true {
Subroutine true: called CC=5 SCAR=16.1
Pod undocumented
55 # The envelope recipient's mailbox is Suspended or not
56 # @param [Sisimai::Fact] argvs Object to be detected the reason
57 # @return [Integer] 1: is mailbox suspended
58 # 0: is not suspended
59 # @since v4.0.0
60 # @see http://www.ietf.org/rfc/rfc2822.txt
61 2155 my $class = shift;
62 2155 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
21541
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
63  
64 2154 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReQUIT;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReQUIT 1 2153 2154
65 2153 ▶ return 1 if length $argvs->{'replycode'} && $argvs->{'replycode'} == 525;
Branch: 1 branch
BranchTrueFalseTotal
if length $argvs->{"replycode"} and $argvs->{"replycode"} == 525 15 2138 2153
Condition100%3/3
length $argvs->{"replycode"} and $argvs->{"replycode"} == 525
!ll&&!rl&&r
582155615
MC/DC100%2/2
length $argvs->{"replycode"} and $argvs->{"replycode"} == 525
length $argvs->{"replycode"} $argvs->{"replycode"} == 525
Truth table100%3/3
A and B
A= length $argvs->{"replycode"}B= $argvs->{"replycode"} == 525
ABresult
0X0
100
111
66 2138 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
67 }
68  
69 68 1;
70 __END__
« Sisimai/Reason/ContentError.pm ↑ Summary Sisimai/Reason/RateLimited.pm »