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 26     26   2016 use feature ':5.10';
  26         50  
  26         1760  
3 26     26   145 use strict;
  26         40  
  26         426  
4 26     26   109 use warnings;
  26         52  
  26         4145  
5              
6 5     5 1 29 sub text { 'systemerror' }
7 4     4 0 15 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 381     381 1 711 my $class = shift;
15 381   50     1051 my $argv1 = shift // return undef;
16              
17 381         607 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 381 100       822 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  8001         12725  
41 356         914 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 7 return undef;
51             }
52              
53             1;
54             __END__