Transport/Exim.pm

filter: Statementstmt 43.5% 17 / 39 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 17 MC/DCmcdc 0.0% 0 / 9 Subroutinesub 71.4% 5 / 7 Podpod 50.0% 1 / 2 totaltotal 27.3% 23 / 84 SCAR 42.6
CC
12
Cov
26%
trySend
56.0
init
42.0
BEGIN
1.0
CRAP 70.9
« Transport/Mailx.pm ↑ Summary Transport/Sendmail.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::Exim;
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=6 SCAR=37.4
Pod undocumented
23  
24 0 $args->{via} = 'exim';
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->{MTS_program}
29 = $args->{proxy}
30 0 ▶ || ( -x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef)
Branch: 1 branch
BranchTrueFalseTotal
-x '/usr/sbin/exim4' ? : 0 0 0
Condition0%0/8
$args->{'proxy'} || (-x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) || $self->findBinary('exim', '/usr/exim/bin') || (return)
l!l
00
$args->{"proxy"} or -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef or $self->findBinary("exim", "/usr/exim/bin")
l!l&&r!l&&!r
000
$args->{"proxy"} or -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef
l!l&&r!l&&!r
000
MC/DC0%0/3
$args->{'proxy'} || (-x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) || $self->findBinary('exim', '/usr/exim/bin') || (return)
$args->{"proxy"} -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef $self->findBinary("exim", "/usr/exim/bin")
Truth table0%0/4
A or B or C
A= $args->{"proxy"}B= -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undefC= $self->findBinary("exim", "/usr/exim/bin")
ABCresult
1XX1
01X1
0011
0000
31 || $self->findBinary('exim', '/usr/exim/bin')
32 || return;
33  
34 0 $self;
35 }
36  
37 #------------------------------------------
38  
39  
40 sub trySend($@)
41 0 ▶{ my ($self, $message, %args) = @_;
Subroutine trySend: not called CC=7 SCAR=40.3
Pod documented
42  
43 0 ▶ my $from = $args{from} || $message->sender;
Condition0%0/3
$args{'from'} || $message->sender
l!l&&r!l&&!r
000
MC/DC0%0/2
$args{'from'} || $message->sender
$args{'from'} $message->sender
Truth table0%0/3
A || B
A= $args{'from'}B= $message->sender
ABresult
1X1
011
000
44 0 ▶ $from = $from->address if ref $from && $from->isa('Mail::Address');
Branch: 1 branch
BranchTrueFalseTotal
if ref $from and $from->isa("Mail::Address") 0 0 0
Condition0%0/3
ref $from and $from->isa("Mail::Address")
!ll&&!rl&&r
000
MC/DC0%0/2
ref $from and $from->isa("Mail::Address")
ref $from $from->isa("Mail::Address")
Truth table0%0/3
A and B
A= ref $fromB= $from->isa("Mail::Address")
ABresult
0X0
100
111
45 0 my @to = map {$_->address} $self->destinations($message, $args{to});
46  
47 0 my $program = $self->{MTS_program};
48 0 ▶ if(open(MAILER, '|-')==0)
Branch: 1 branch
BranchTrueFalseTotal
if (open(MAILER, "|-") == 0) 0 0 0
49 0 { { exec $program, '-i', '-f', $from, @to; } # {} to avoid warning
50 0 $self->log(NOTICE => "Errors when opening pipe to $program: $!");
51 0 exit 1;
52 }
53  
54 0 $self->putContent($message, \*MAILER, undisclosed => 1);
55  
56 0 ▶ unless(close MAILER)
Branch: 1 branch
BranchTrueFalseTotal
unless (close MAILER) 0 0 0
57 0 { $self->log(ERROR => "Errors when closing Exim mailer $program: $!");
58 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
59 0 return 0;
60 }
61  
62 0 1;
63 }
64  
65 #------------------------------------------
66  
67 1 1;
« Transport/Mailx.pm ↑ Summary Transport/Sendmail.pm »