File Coverage

lib/Sisimai/Reason/Expired.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition 1 2 50.0
subroutine 7 7 100.0
pod 2 4 50.0
total 30 33 90.9


line stmt bran cond sub pod time code
1             package Sisimai::Reason::Expired;
2 22     22   2029 use feature ':5.10';
  22         41  
  22         1605  
3 22     22   123 use strict;
  22         34  
  22         426  
4 22     22   98 use warnings;
  22         44  
  22         4393  
5              
6 5     5 1 15 sub text { 'expired' }
7 4     4 0 18 sub description { 'Delivery time has expired due to a connection failure' }
8             sub match {
9             # Try to match that the given text and regular expressions
10             # @param [String] argv1 String to be matched with regular expressions
11             # @return [Integer] 0: Did not match
12             # 1: Matched
13             # @since v4.0.0
14 309     309 1 599 my $class = shift;
15 309   50     738 my $argv1 = shift // return undef;
16              
17 309         579 state $index = [
18             'connection timed out',
19             'could not find a gateway for',
20             'delivery attempts will continue to be',
21             'delivery time expired',
22             'failed to deliver to domain ',
23             'giving up on',
24             'have been failing for a long time',
25             'has been delayed',
26             'it has not been collected after',
27             'message expired after sitting in queue for',
28             'message expired, connection refulsed',
29             'message timed out',
30             'retry time not reached for any host after a long failure period',
31             'server did not respond',
32             'this message has been in the queue too long',
33             'unable to deliver message after multiple retries',
34             'was not reachable within the allowed queue period',
35             'your message could not be delivered for more than',
36             ];
37 309 100       587 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  5562         8604  
38 238         581 return 0;
39             }
40              
41             sub true {
42             # Delivery expired due to connection failure or network error
43             # @param [Sisimai::Data] argvs Object to be detected the reason
44             # @return [Integer] 1: is expired
45             # 0: is not expired
46             # @see http://www.ietf.org/rfc/rfc2822.txt
47 2     2 0 6 return undef;
48             }
49              
50             1;
51             __END__