line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
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
|
|
|
1
|
|
883
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
11
|
|
|
|
|
|
|
$VERSION = '3.005'; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
6
|
use base 'Mail::Transport::Send'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
89
|
|
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
16
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
6
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
342
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init($) |
22
|
0
|
|
|
0
|
0
|
|
{ my ($self, $args) = @_; |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
$args->{via} = 'qmail'; |
25
|
|
|
|
|
|
|
|
26
|
0
|
0
|
|
|
|
|
$self->SUPER::init($args) or return; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$self->{MTM_program} |
29
|
|
|
|
|
|
|
= $args->{proxy} |
30
|
0
|
|
0
|
|
|
|
|| $self->findBinary('qmail-inject', '/var/qmail/bin') |
31
|
|
|
|
|
|
|
|| return; |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$self; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#------------------------------------------ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub trySend($@) |
40
|
0
|
|
|
0
|
1
|
|
{ my ($self, $message, %args) = @_; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $program = $self->{MTM_program}; |
43
|
0
|
0
|
|
|
|
|
if(open(MAILER, '|-')==0) |
44
|
0
|
|
|
|
|
|
{ { exec $program; } |
|
0
|
|
|
|
|
|
|
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
|
0
|
|
|
|
|
unless(close MAILER) |
52
|
0
|
|
|
|
|
|
{ $self->log(ERROR => "Errors when closing Qmail mailer $program: $!"); |
53
|
0
|
|
0
|
|
|
|
$? ||= $!; |
54
|
0
|
|
|
|
|
|
return 0; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
#------------------------------------------ |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
1; |