File Coverage

lib/Sisimai/Reason/SystemError.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::SystemError;
2 23     23   1675 use feature ':5.10';
  23         42  
  23         1386  
3 23     23   109 use strict;
  23         38  
  23         344  
4 23     23   86 use warnings;
  23         37  
  23         3320  
5              
6 5     5 1 24 sub text { 'systemerror' }
7 4     4 0 13 sub description { 'Email returned due to system error on the remote host' }
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 321     321 1 456 my $class = shift;
15 321   50     671 my $argv1 = shift // return undef;
16              
17 321         479 state $index = [
18             'aliasing/forwarding loop broken',
19             "can't create user output file",
20             'could not load drd for domain',
21             'internal error reading data', # Microsoft
22             'internal server error: operation now in progress', # Microsoft
23             'interrupted system call',
24             'it encountered an error while being processed',
25             'it would create a mail loop',
26             'local configuration error',
27             'local error in processing',
28             'loop was found in the mail exchanger',
29             'loops back to myself',
30             'queue file write error',
31             'mail system configuration error',
32             'remote server is misconfigured',
33             'server configuration error',
34             'service currently unavailable',
35             'system config error',
36             'temporary local problem',
37             'timeout waiting for input',
38             'transaction failed',
39             ];
40 321 100       551 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  6741         9114  
41 296         703 return 0;
42             }
43              
44             sub true {
45             # The bounce reason is system error or not
46             # @param [Sisimai::Data] argvs Object to be detected the reason
47             # @return [Integer] 1: is system error
48             # 0: is not system error
49             # @see http://www.ietf.org/rfc/rfc2822.txt
50 2     2 0 4 return undef;
51             }
52              
53             1;
54             __END__