File Coverage

blib/lib/Net/LMTP2.pm
Criterion Covered Total %
statement 12 30 40.0
branch 0 10 0.0
condition 0 4 0.0
subroutine 4 8 50.0
pod 1 1 100.0
total 17 53 32.0


line stmt bran cond sub pod time code
1             package Net::LMTP2;
2             $Net::LMTP2::VERSION = '0.2';
3             # ABSTRACT: A client class for the LMTP protocol
4 1     1   203682 use strict;
  1         2  
  1         46  
5 1     1   6 use warnings;
  1         2  
  1         131  
6              
7 1     1   10 use base 'Net::SMTP';
  1         2  
  1         985  
8 1     1   172349 use Net::Cmd;
  1         4  
  1         819  
9              
10              
11              
12             sub hello {
13 0     0 1   my $me = shift;
14 0   0       my $domain = shift || "localhost.localdomain";
15 0           my $ok = $me->_LHLO($domain);
16 0           my @msg = $me->message;
17              
18 0 0         if ($ok) {
    0          
19 0           my $h = ${*$me}{'net_smtp_esmtp'} = {};
  0            
20 0           foreach my $ln (@msg) {
21 0 0         $h->{uc $1} = $2 if $ln =~ /([-\w]+)\b[= \t]*([^\n]*)/;
22             }
23             }
24             elsif ($me->status == CMD_ERROR) {
25 0 0         @msg = $me->message if $ok = $me->_HELO($domain);
26             }
27              
28              
29 0 0         return unless $ok;
30 0           ${*$me}{net_smtp_hello_domain} = $domain;
  0            
31 0           $msg[0] =~ /\A\s*(\S+)/;
32 0   0       return ($1 || " ");
33              
34             }
35              
36              
37              
38 0     0     sub _EHLO { shift->unsupported(@_);}
39 0     0     sub _HELO { shift->unsupported(@_);}
40 0     0     sub _LHLO { shift->command("LHLO", @_)->response() == CMD_OK }
41             1;
42              
43             __END__