File Coverage

lib/Sisimai/Reason/SystemFull.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition 2 2 100.0
subroutine 7 7 100.0
pod 2 4 50.0
total 30 32 93.7


line stmt bran cond sub pod time code
1             package Sisimai::Reason::SystemFull;
2 27     27   2687 use v5.26;
  27         100  
3 27     27   149 use strict;
  27         48  
  27         754  
4 27     27   131 use warnings;
  27         51  
  27         5636  
5              
6 1     1 1 6 sub text { 'systemfull' }
7 4     4 0 12 sub description { "Email rejected due to a destination mail server's disk is full" }
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 342     342 1 1356 my $class = shift;
15 342   100     1185 my $argv1 = shift // return 0;
16              
17 341         611 state $index = [
18             'exceeded storage allocation', # MS Exchange
19             'mail system full',
20             ];
21 341 100       802 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  682         1951  
22 340         995 return 0;
23             }
24              
25             sub true {
26             # The bounce reason is system full or not
27             # @param [Sisimai::Fact] argvs Object to be detected the reason
28             # @return [Integer] 1: is system full
29             # 0: is not system full
30             # @see http://www.ietf.org/rfc/rfc2822.txt
31 2     2 0 4 return 0;
32             }
33              
34             1;
35             __END__