| 1 | package Sisimai::Reason::VirusDetected; | ||||||||||||
| 2 | 46 | ▶ | use v5.26; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 46 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 46 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 46 | ▶ | use Sisimai::Eb; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 46 | ▶ | use Sisimai::SMTP::Command; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 6 | ▶ | sub text { $Sisimai::Eb::ReEXEC } | ||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 9 | 4 | ▶ | sub description { 'Email rejected due to a virus scanner on a destination host' } | ||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 10 | 1005 | ▶ | 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.22.0 | ||||||||||||
| 16 | 1005 | my $class = shift; | |||||||||||
| 17 | 1005 | ▶ | 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 | 1004 | state $index = ["it has a potentially executable attachment"]; | |||||||||||
| 20 | 1004 | state $pairs = [ | |||||||||||
| 21 | ["message was ", "ected", " virus"], | ||||||||||||
| 22 | ["virus", " detected"], | ||||||||||||
| 23 | ]; | ||||||||||||
| 24 | 1004 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 1004 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 992 | return 0; | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 616 | ▶ | sub true { | ||||||||||
|
Subroutine
true: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||
| 30 | # The bounce reason is "VirusDetected" or not | ||||||||||||
| 31 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||
| 32 | # @return [Integer] 1: virus detected | ||||||||||||
| 33 | # 0: virus was not detected | ||||||||||||
| 34 | # @since v4.22.0 | ||||||||||||
| 35 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||
| 36 | 616 | my $class = shift; | |||||||||||
| 37 | 616 | ▶ | my $argvs = shift // return 0; | ||||||||||
|
Condition100%2/2
shift() // (return 0)
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||
| 38 | |||||||||||||
| 39 | # The value of "reason" isn't "VirusDetected" when the value of "command" is an SMTP command to | ||||||||||||
| 40 | # be sent before the SMTP DATA command because all the MTAs read the headers and the entire | ||||||||||||
| 41 | # message body after the DATA command. | ||||||||||||
| 42 | 615 | ▶ | return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReEXEC; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 43 | 614 | ▶ | return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->ExceptDATA->@*; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 44 | 478 | return __PACKAGE__->match(lc $argvs->{'diagnosticcode'}); | |||||||||||
| 45 | } | ||||||||||||
| 46 | |||||||||||||
| 47 | 46 | 1; | |||||||||||
| 48 | __END__ | ||||||||||||