File Coverage

lib/Sisimai/Reason/Suppressed.pm
Criterion Covered Total %
statement 10 15 66.6
branch 0 2 0.0
condition 0 2 0.0
subroutine 5 7 71.4
pod 2 4 50.0
total 17 30 56.6


line stmt bran cond sub pod time code
1             package Sisimai::Reason::Suppressed;
2 20     20   1498 use v5.26;
  20         330  
3 20     20   105 use strict;
  20         35  
  20         627  
4 20     20   127 use warnings;
  20         41  
  20         3518  
5              
6 0     0 1 0 sub text { 'suppressed' }
7 2     2 0 8 sub description { "Email was not delivered due to being listed in the suppression list of MTA" }
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 v5.2.0
14 226     226 1 791 return 0;
15             }
16              
17             sub true {
18             # Whether the address is is the suppression list or not
19             # @param [Sisimai::Fact] argvs Object to be detected the reason
20             # @return [Integer] 1: The address is in the suppression list
21             # 0: is not in the suppression list
22             # @since v5.2.0
23             # @see http://www.ietf.org/rfc/rfc2822.txt
24 0     0 0   my $class = shift;
25 0   0       my $argvs = shift // return 0;
26              
27 0 0         return 1 if $argvs->{'reason'} eq 'suppressed';
28 0           return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
29             }
30              
31             1;
32             __END__