| 1 | package Sisimai::Reason::Expired; | ||||||||||||
| 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 | 7 | ▶ | sub text { $Sisimai::Eb::ReTIME } | ||||||||||
|
Subroutine
text: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 9 | 4 | ▶ | sub description { 'Delivery time has expired due to a connection failure' } | ||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 10 | 428 | ▶ | 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 | 428 | my $class = shift; | |||||||||||
| 17 | 428 | ▶ | 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 | 427 | state $index = [ | |||||||||||
| 20 | "connection timed out", | ||||||||||||
| 21 | "could not find a gateway for", | ||||||||||||
| 22 | "delay reason: ", # Exim/deliver.c:7459 | ||||||||||||
| 23 | "delivery attempts will continue to be", | ||||||||||||
| 24 | "envelope expired", # OpenSMTPD/smtpd/queue.c:221 | ||||||||||||
| 25 | "failed to deliver to domain ", | ||||||||||||
| 26 | "frozen on arrival", # Exim/receive.c:4022 | ||||||||||||
| 27 | "has been delayed", | ||||||||||||
| 28 | "has been frozen", # Exim/deliver.c:7586 | ||||||||||||
| 29 | "have been failing for a long time", # Exim/smtp.c:3508 | ||||||||||||
| 30 | "host not reachable", | ||||||||||||
| 31 | "it has not been collected after", | ||||||||||||
| 32 | "message could not be delivered for more than", | ||||||||||||
| 33 | "message expired, ", | ||||||||||||
| 34 | "message has been in the queue too long", | ||||||||||||
| 35 | "message was not delivered within ", | ||||||||||||
| 36 | "message timed out", | ||||||||||||
| 37 | "retry timeout exceeded", # Exim/retry.c:902 | ||||||||||||
| 38 | "server did not accept our requests to connect", | ||||||||||||
| 39 | "server did not respond", | ||||||||||||
| 40 | "unable to deliver message after multiple retries", | ||||||||||||
| 41 | ]; | ||||||||||||
| 42 | 427 | state $pairs = [ | |||||||||||
| 43 | ["could not be delivered for", " days"], | ||||||||||||
| 44 | ["could not deliver for the last", "second"], | ||||||||||||
| 45 | ["delivery ", "expired"], | ||||||||||||
| 46 | ["delivery ", "delayed"], | ||||||||||||
| 47 | ["exceed", "time", "out"], | ||||||||||||
| 48 | ["not", "reach", "period"], # Exim/smtp.c:3508 | ||||||||||||
| 49 | ]; | ||||||||||||
| 50 | |||||||||||||
| 51 | 427 | ▶ | return 1 if grep { rindex($argv1, $_) > -1 } @$index; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 52 | 234 | ▶ | return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 53 | 211 | return 0; | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | 2 | ▶ | sub true { | ||||||||||
|
Subroutine
true: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 57 | # Delivery expired due to connection failure or network error | ||||||||||||
| 58 | # @param [Sisimai::Fact] argvs Object to be detected the reason | ||||||||||||
| 59 | # @return [Integer] 1: is Expired | ||||||||||||
| 60 | # 0: is not Expired | ||||||||||||
| 61 | # @see http://www.ietf.org/rfc/rfc2822.txt | ||||||||||||
| 62 | 2 | return 0; | |||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | 34 | 1; | |||||||||||
| 66 | __END__ | ||||||||||||