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 34     34   2599 use v5.26;
  34         100  
3 34     34   140 use strict;
  34         50  
  34         737  
4 34     34   176 use warnings;
  34         58  
  34         5821  
5              
6 1     1 1 17 sub text { 'systemfull' }
7 4     4 0 17 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 452     452 1 1518 my $class = shift;
15 452   100     1163 my $argv1 = shift // return 0;
16              
17 451         707 state $index = [
18             'exceeded storage allocation', # MS Exchange
19             'mail system full',
20             ];
21 451 100       714 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  902         1811  
22 450         1022 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 9 return 0;
32             }
33              
34             1;
35             __END__