Transport/Qmail.pm

filter: Statementstmt 48.5% 17 / 35 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 8 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 50.0% 1 / 2 totaltotal 37.1% 23 / 62 SCAR 30.3
CC
7
Cov
35%
init
20.0
trySend
20.0
BEGIN
1.0
CRAP 20.6
« Transport/Sendmail.pm ↑ Summary Transport/Receive.pm »
1 # Copyrights 2001-2020 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.02.
5 # This code is part of distribution Mail-Transport. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Transport::Qmail;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.005';
12  
13 1 ▶use base 'Mail::Transport::Send';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 sub init($)
22 0 ▶{ my ($self, $args) = @_;
Subroutine init: not called CC=4 SCAR=30.0
Pod undocumented
23  
24 0 $args->{via} = 'qmail';
25  
26 0 ▶ $self->SUPER::init($args) or return;
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init($args) or return 0 0 0
27  
28 $self->{MTM_program}
29 = $args->{proxy}
30 0 ▶ || $self->findBinary('qmail-inject', '/var/qmail/bin')
Condition0%0/5
$args->{'proxy'} || $self->findBinary('qmail-inject', '/var/qmail/bin') || (return)
l!l
00
$args->{"proxy"} or $self->findBinary("qmail-inject", "/var/qmail/bin")
l!l&&r!l&&!r
000
MC/DC0%0/2
$args->{'proxy'} || $self->findBinary('qmail-inject', '/var/qmail/bin') || (return)
$args->{"proxy"} $self->findBinary("qmail-inject", "/var/qmail/bin")
Truth table0%0/3
A or B
A= $args->{"proxy"}B= $self->findBinary("qmail-inject", "/var/qmail/bin")
ABresult
1X1
011
000
31 || return;
32  
33 0 $self;
34 }
35  
36 #------------------------------------------
37  
38  
39 sub trySend($@)
40 0 ▶{ my ($self, $message, %args) = @_;
Subroutine trySend: not called CC=4 SCAR=30.0
Pod documented
41  
42 0 my $program = $self->{MTM_program};
43 0 ▶ if(open(MAILER, '|-')==0)
Branch: 1 branch
BranchTrueFalseTotal
if (open(MAILER, "|-") == 0) 0 0 0
44 0 { { exec $program; }
45 0 $self->log(NOTICE => "Errors when opening pipe to $program: $!");
46 0 exit 1;
47 }
48
49 0 $self->putContent($message, \*MAILER, undisclosed => 1);
50  
51 0 ▶ unless(close MAILER)
Branch: 1 branch
BranchTrueFalseTotal
unless (close MAILER) 0 0 0
52 0 { $self->log(ERROR => "Errors when closing Qmail mailer $program: $!");
53 0 ▶ $? ||= $!;
Condition0%0/3
$? ||= $!
l!l&&r!l&&!r
000
MC/DC0%0/2
$? ||= $!
$? $!
Truth table0%0/3
A ||= B
A= $?B= $!
ABresult
1X1
011
000
54 0 return 0;
55 }
56  
57 0 1;
58 }
59  
60 #------------------------------------------
61  
62 1 1;
« Transport/Sendmail.pm ↑ Summary Transport/Receive.pm »