File Coverage

lib/Sisimai/Reason/SystemError.pm
Criterion Covered Total %
statement 23 23 100.0
branch 4 4 100.0
condition 2 2 100.0
subroutine 8 8 100.0
pod 2 4 50.0
total 39 41 95.1


line stmt bran cond sub pod time code
1             package Sisimai::Reason::SystemError;
2 40     40   2635 use v5.26;
  40         115  
3 40     40   158 use strict;
  40         99  
  40         955  
4 40     40   167 use warnings;
  40         71  
  40         1836  
5 40     40   171 use Sisimai::String;
  40         123  
  40         10089  
6              
7 5     5 1 11 sub text { 'systemerror' }
8 4     4 0 18 sub description { 'Email returned due to system error on the remote host' }
9             sub match {
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.0.0
15 580     580 1 1530 my $class = shift;
16 580   100     1446 my $argv1 = shift // return 0;
17              
18 579         878 state $index = [
19             "aliasing/forwarding loop broken",
20             "automatic homedir creator crashed", # qmail-ldap-1.03-20040101.patch:19817 - 19866
21             "can't create user output file",
22             "cannot send e-mail to yourself",
23             "could not load ",
24             "delivery to file forbidden", # Exim/deliver.c:5614
25             "delivery to pipe forbidden", # Exim/deliver.c:5624
26             "input/output error",
27             "interrupted system call",
28             "it encountered an error while being processed",
29             "it would create a mail loop",
30             "ldap attribute", # qmail-ldap-1.03-20040101.patch:19817 - 19866
31             "ldap lookup", # qmail-ldap-1.03-20040101.patch:19817 - 19866
32             "ldap server", # qmail-ldap-1.03-20040101.patch:19817 - 19866
33             "lmtp error after ", # Exim/transports/lmtp.c:186
34             "local delivery failed", # Exim/transports/pipe.c:1156
35             "loop back warning:", # FML
36             "loop was found in the mail exchanger",
37             "loops back to myself",
38             "mail transport unavailable",
39             "may cause mail loop", # FML
40             "no such file or directory",
41             "error while executing qmail-forward", # qmail-ldap-1.03-20040101.patch:19817 - 19866
42             "queue file write error",
43             "recipient deferred because there is no mdb",
44             "remote server is misconfigured",
45             "service currently unavailable",
46             "several matches found in domino directory", # Donimo
47             "temporary local problem",
48             "timeout waiting for input",
49             "too many results returned but needs to be unique", # qmail-ldap-1.03-20040101.patch:19817 - 19866
50             "transaction failed ",
51             ];
52 579         751 state $pairs = [
53             ["config", " error"],
54             ["fml ", "has detected a loop condition so that"], # FML
55             ["internal ", "error"],
56             ["local ", "error"],
57             ["proxy", "broken pipe"],
58             ["unable to connect ", "daemon"],
59             ];
60 579 100       1197 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  18528         22467  
61 540 100       867 return 1 if grep { Sisimai::String->aligned(\$argv1, $_) } @$pairs;
  3240         4415  
62 529         1018 return 0;
63             }
64              
65             sub true {
66             # The bounce reason is system error or not
67             # @param [Sisimai::Fact] argvs Object to be detected the reason
68             # @return [Integer] 1: is system error
69             # 0: is not system error
70             # @see http://www.ietf.org/rfc/rfc2822.txt
71 2     2 0 9 return 0;
72             }
73              
74             1;
75             __END__