File Coverage

lib/Sisimai/Lhost.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 0 6 0.0
total 32 38 84.2


line stmt bran cond sub pod time code
1             package Sisimai::Lhost;
2 84     84   70518 use feature ':5.10';
  84         205  
  84         5893  
3 84     84   515 use strict;
  84         234  
  84         1608  
4 84     84   378 use warnings;
  84         222  
  84         2077  
5 84     84   1266 use Sisimai::RFC5322;
  84         215  
  84         29411  
6              
7             sub DELIVERYSTATUS {
8             # Data structure for parsed bounce messages
9             # @private
10             # @return [Hash] Data structure for delivery status
11             return {
12 3702     3702 0 31343 'spec' => '', # Protocl specification
13             'date' => '', # The value of Last-Attempt-Date header
14             'rhost' => '', # The value of Remote-MTA header
15             'lhost' => '', # The value of Received-From-MTA header
16             'alias' => '', # The value of alias entry(RHS)
17             'agent' => '', # MTA name
18             'action' => '', # The value of Action header
19             'status' => '', # The value of Status header
20             'reason' => '', # Temporary reason of bounce
21             'command' => '', # SMTP command in the message body
22             'replycode', => '', # SMTP Reply Code
23             'diagnosis' => '', # The value of Diagnostic-Code header
24             'recipient' => '', # The value of Final-Recipient header
25             'softbounce' => '', # Soft bounce or not
26             'feedbacktype' => '', # Feedback Type
27             };
28             }
29             sub INDICATORS {
30             # Flags for position variables
31             # @private
32             # @return [Hash] Position flag data
33             # @since v4.13.0
34             return {
35 245     245 0 1150 'deliverystatus' => (1 << 1),
36             'message-rfc822' => (1 << 2),
37             };
38             }
39 1     1 0 1218 sub description { return '' }
40             sub index {
41             # Alphabetical sorted MTA module list
42             # @return [Array] MTA list with order
43 83     83 0 1175 return [qw|
44             Activehunter Amavis AmazonSES AmazonWorkMail Aol ApacheJames Barracuda Bigfoot
45             Biglobe Courier Domino EZweb EinsUndEins Exchange2003 Exchange2007 Exim FML
46             Facebook GMX GSuite GoogleGroups Gmail IMailServer InterScanMSS KDDI MXLogic
47             MailFoundry MailMarshalSMTP MailRu McAfee MessageLabs MessagingServer Notes
48             Office365 OpenSMTPD Outlook Postfix PowerMTA ReceivingSES SendGrid Sendmail
49             SurfControl V5sendmail Verizon X1 X2 X3 X4 X5 X6 Yahoo Yandex Zoho mFILTER
50             qmail
51             |];
52             }
53              
54             sub path {
55             # Returns Sisimai::Lhost::* module path table
56             # @return [Hash] Module path table
57             # @since v4.25.6
58 80     80 0 213 my $class = shift;
59 80         352 my $index = __PACKAGE__->index;
60 80         392 my $table = {
61             'Sisimai::ARF' => 'Sisimai/ARF.pm',
62             'Sisimai::RFC3464' => 'Sisimai/RFC3464.pm',
63             'Sisimai::RFC3834' => 'Sisimai/RFC3834.pm',
64             };
65 80         6946 $table->{ __PACKAGE__.'::'.$_ } = 'Sisimai/Lhost/'.$_.'.pm' for @$index;
66 80         509 return $table;
67             }
68              
69             sub make {
70             # Method of a parent class to parse a bounce message of each MTA
71             # @param [Hash] mhead Message headers of a bounce email
72             # @param [String] mbody Message body of a bounce email
73             # @return [Hash] Bounce data list and message/rfc822 part
74             # @return [Undef] failed to parse or the arguments are missing
75 1     1 0 4 return undef;
76             }
77              
78             1;
79             __END__