| 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
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | $self->{MTS_program} | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | = $args->{proxy} | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | ▶ | || ( -x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/8
$args->{'proxy'} || (-x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) || $self->findBinary('exim', '/usr/exim/bin') || (return)
$args->{"proxy"} or -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef or $self->findBinary("exim", "/usr/exim/bin")
$args->{"proxy"} or -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef
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")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 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
MC/DC0%0/2
$args{'from'} || $message->sender
$args{'from'}
$message->sender
Truth table0%0/3
A || B
A= $args{'from'}B= $message->sender
| |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | $from = $from->address if ref $from && $from->isa('Mail::Address'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
ref $from and $from->isa("Mail::Address")
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")
| |||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | { $self->log(ERROR => "Errors when closing Exim mailer $program: $!"); | |||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | $? ||= $!; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$? ||= $!
MC/DC0%0/2
$? ||= $!
$?
$!
Truth table0%0/3
A ||= B
A= $?B= $!
| |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | #------------------------------------------ | ||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||