equal
deleted
inserted
replaced
18 --src=s src ip/name [!$Cf->src!] |
18 --src=s src ip/name [!$Cf->src!] |
19 --dst=s dst ip/name [!$Cf->dst!] |
19 --dst=s dst ip/name [!$Cf->dst!] |
20 |
20 |
21 --exim=s exim binary [!$Cf->exim!] |
21 --exim=s exim binary [!$Cf->exim!] |
22 --config=s exim config file [!$Cf->config!] |
22 --config=s exim config file [!$Cf->config!] |
|
23 |
|
24 --[no]callout [!$Cf->callout!] |
23 |
25 |
24 $Id$ |
26 $Id$ |
25 $URL$ |
27 $URL$ |
26 # |
28 # |
27 |
29 |
61 |
63 |
62 exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || "exim" }, |
64 exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || "exim" }, |
63 config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" , |
65 config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" , |
64 ALIAS => "C" }, |
66 ALIAS => "C" }, |
65 |
67 |
|
68 |
|
69 callout => { ARGS => "!", DEFAULT => 1 }, |
66 help => { ARGS => "!" }, |
70 help => { ARGS => "!" }, |
67 |
71 |
68 ); |
72 ); |
69 |
73 |
70 |
74 |
79 |
83 |
80 $Cf->Helo((split/@/, $Cf->from||"")[1] || HOSTNAME) |
84 $Cf->Helo((split/@/, $Cf->from||"")[1] || HOSTNAME) |
81 unless $Cf->Helo; |
85 unless $Cf->Helo; |
82 $Cf->dst(addr(HOSTNAME)) unless $Cf->dst; |
86 $Cf->dst(addr(HOSTNAME)) unless $Cf->dst; |
83 |
87 |
84 $@ = ""; |
|
85 foreach (qw/from to src dst/) { |
|
86 $Cf->get($_) or $@ = join " ", $@, $_; |
|
87 } |
|
88 |
|
89 die ME.": Missing values: $@\n" if $@; |
|
90 |
88 |
91 |
89 |
92 MAIN: { |
90 MAIN: { |
93 die "Config file for exim not readable ".$Cf->config.": $!\n" if not -r $Cf->config; |
91 die "Config file for exim not readable ".$Cf->config.": $!\n" if not -r $Cf->config; |
94 |
92 |
95 my ($w, $r); |
93 my ($w, $r); |
96 my @cmd = ($Cf->exim, |
94 my @cmd = ($Cf->exim, |
97 -C => $Cf->config, |
95 -C => $Cf->config, |
98 -oMi => addr($Cf->dst), |
96 -oMi => addr($Cf->dst), |
99 -bhc => addr($Cf->src), |
97 ($Cf->callout? "-bhc" : "-bh" ) => addr($Cf->src), |
100 @ARGV); # remaining args are exim native |
98 @ARGV); # remaining args are exim native |
101 |
99 |
102 if ($Cf->help) { |
100 if ($Cf->help) { |
103 ($_ = USAGE) =~ s/!(.*?)!/eval $1||""/egs; |
101 ($_ = USAGE) =~ s/!(.*?)!/eval $1||""/egs; |
104 print; exit; |
102 print; exit; |
105 } |
103 } |
|
104 |
|
105 $@ = ""; |
|
106 foreach (qw/from to src dst/) { |
|
107 $Cf->get($_) or $@ = join " ", $@, $_; |
|
108 } |
|
109 die ME.": Missing values: $@\n" if $@; |
106 |
110 |
107 my $s = new IO::Select; |
111 my $s = new IO::Select; |
108 |
112 |
109 print "**> @cmd\n"; |
113 print "**> @cmd\n"; |
110 |
114 |