| 1 | # This code is part of Perl distribution Mail-Transport version 4.01. | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # The POD got stripped from this file by OODoc version 3.05. | ||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # For contributors see file ChangeLog. | ||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # This software is copyright (c) 2001-2025 by Mark Overmeer. | ||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later | ||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | package Mail::Transport::Exim;{ | ||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | our $VERSION = '4.01'; | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | ▶ | use parent 'Mail::Transport::Send'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Log::Report 'mail-transport', import => [ qw/__x error fault warning/ ]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Scalar::Util qw/blessed/; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | #-------------------- | ||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | sub init($) | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | { my ($self, $args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
init: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | $args->{via} = 'exim'; | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | $self->SUPER::init($args); | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | $self->{MTS_program} = $args->{proxy} || | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | ( -x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) || $self->findBinary('exim', '/usr/exim/bin') | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/6
$args->{'proxy'} || (-x '/usr/sbin/exim4' ? '/usr/sbin/exim4' : undef) || $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')
$args->{"proxy"}
-x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undef
$self->findBinary('exim', '/usr/exim/bin')
Truth table0%0/4
A or B || C
A= $args->{"proxy"}B= -x "/usr/sbin/exim4" ? "/usr/sbin/exim4" : undefC= $self->findBinary('exim', '/usr/exim/bin')
| |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | or error __x"cannot find binary for exim."; | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | sub trySend($@) | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | { my ($self, $message, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trySend: not called CC=6 SCAR=37.4
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 blessed $from && $from->isa('Mail::Address'); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($from) and $from->isa("Mail::Address")
MC/DC0%0/2
builtin::blessed($from) and $from->isa("Mail::Address")
builtin::blessed($from)
$from->isa("Mail::Address")
Truth table0%0/3
A and B
A= builtin::blessed($from)B= $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 | my $mailer; | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | if(open($mailer, '|-')==0) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | { { exec $program, '-i', '-f', $from, @to; } # {} to avoid warning | |||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | fault __x"cannot open pipe to {program}", program => $program; | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | $self->putContent($message, $mailer, undisclosed => 1); | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | ▶ | $mailer->close | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | or fault __x"errors when closing Exim mailer {program}", program => $program; | ||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||