File Coverage

lib/Sisimai/Reason/OnHold.pm
Criterion Covered Total %
statement 18 18 100.0
branch 3 6 50.0
condition 3 4 75.0
subroutine 7 7 100.0
pod 2 4 50.0
total 33 39 84.6


line stmt bran cond sub pod time code
1             package Sisimai::Reason::OnHold;
2 5     5   1938 use feature ':5.10';
  5         7  
  5         389  
3 5     5   21 use strict;
  5         8  
  5         83  
4 5     5   21 use warnings;
  5         6  
  5         803  
5              
6 1     1 1 16 sub text { 'onhold' }
7 4     4 0 17 sub description { 'Sisimai could not decided the reason due to there is no (or less) detailed information for judging the reason' }
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 44     44 1 90 return 0;
15             }
16              
17             sub true {
18             # On hold, Could not decide the bounce reason...
19             # @param [Sisimai::Data] argvs Object to be detected the reason
20             # @return [Integer] 1: Status code is "onhold"
21             # 0: is not "onhold"
22             # @since v4.1.28
23             # @see http://www.ietf.org/rfc/rfc2822.txt
24 2     2 0 3 my $class = shift;
25 2   100     7 my $argvs = shift // return undef;
26              
27 1 50       3 return undef unless $argvs->deliverystatus;
28 1 50       6 return 1 if $argvs->reason eq 'onhold';
29 1 50 50     5 return 1 if (Sisimai::SMTP::Status->name($argvs->deliverystatus) || '') eq 'onhold';
30 1         1 return 0
31             }
32              
33             1;
34             __END__