File Coverage

lib/Sisimai/Reason/SystemFull.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::SystemFull;
2 18     18   2141 use feature ':5.10';
  18         35  
  18         1173  
3 18     18   109 use strict;
  18         31  
  18         332  
4 18     18   79 use warnings;
  18         29  
  18         3181  
5              
6 1     1 1 26 sub text { 'systemfull' }
7 4     4 0 20 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 237     237 1 460 my $class = shift;
15 237   50     666 my $argv1 = shift // return undef;
16              
17 237         394 state $index = [
18             'mail system full',
19             'requested mail action aborted: exceeded storage allocation', # MS Exchange
20             ];
21 237 100       428 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  474         1167  
22 236         599 return 0;
23             }
24              
25             sub true {
26             # The bounce reason is system full or not
27             # @param [Sisimai::Data] 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 undef;
32             }
33              
34             1;
35             __END__