| 1 | package Sisimai::Reason::NetworkError; | ||||||||||||
| 2 | 38 | ▶ | use v5.26; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 38 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 38 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 38 | ▶ | use Sisimai::Eb; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 3 | ▶ | sub text { $Sisimai::Eb::ReINET } | ||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 8 | 4 | ▶ | sub description { 'SMTP connection failed due to DNS look up failure or other network problems' } | ||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 9 | 595 | ▶ | 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.1.12 | ||||||||||||
| 15 | 595 | my $class = shift; | |||||||||||
| 16 | 595 | ▶ | 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()
| |||||||||||||
| 17 | |||||||||||||
| 18 | 594 | state $index = [ | |||||||||||
| 19 | "address family mismatch on destination mxs", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 20 | "all routes to destination blocked", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 21 | "bad dns lookup error code", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 22 | "could not connect and send the mail to", | ||||||||||||
| 23 | "could not contact dns servers", | ||||||||||||
| 24 | "could not retrieve source address", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 25 | "dns records for the destination computer could not be found", | ||||||||||||
| 26 | "establish an smtp connection", | ||||||||||||
| 27 | "exceeded maximum hop count", # Courier | ||||||||||||
| 28 | "host is unreachable", | ||||||||||||
| 29 | "host name lookup failure", | ||||||||||||
| 30 | "host not found, try again", | ||||||||||||
| 31 | "listed as a best-preference mx", | ||||||||||||
| 32 | "loop detected", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 33 | "maximum forwarding loop count exceeded", | ||||||||||||
| 34 | "network error on destination mxs", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 35 | "no relevant answers", | ||||||||||||
| 36 | "temporary failure in mx lookup", # OpenSMTPD/smtpd/mta.c | ||||||||||||
| 37 | "too many hops", | ||||||||||||
| 38 | "unable to resolve route ", | ||||||||||||
| 39 | "unrouteable mail domain", | ||||||||||||
| 40 | ]; | ||||||||||||
| 41 | 594 | state $pairs = [ | |||||||||||
| 42 | ["malformed", "name server reply"], | ||||||||||||
| 43 | ["mail ", "loop"], | ||||||||||||
| 44 | ["message ", "loop"], | ||||||||||||
| 45 | ["no ", "route to"], | ||||||||||||
| 46 | ]; | ||||||||||||
| 47 | 594 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 48 | 551 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 49 | 511 | return 0; | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | 2 | ▶ | sub true { | ||||||||||
|
Subroutine
true: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 53 | # The bounce reason is network error or not | ||||||||||||
| 54 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||
| 55 | # @return [Integer] 1: is network error | ||||||||||||
| 56 | # 0: is not network error | ||||||||||||
| 57 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||
| 58 | 2 | return 0; | |||||||||||
| 59 | } | ||||||||||||
| 60 | |||||||||||||
| 61 | 38 | 1; | |||||||||||
| 62 | __END__ | ||||||||||||