--- a/exiacl.pl Fri Aug 19 13:22:47 2005 +0000
+++ b/exiacl.pl Fri Aug 19 13:38:06 2005 +0000
@@ -42,6 +42,7 @@
sub write_exim($@);
sub addr(@);
sub hostname() { chomp (my $h = `hostname -f`); return $h; }
+sub findExim() { $_ = `which exim` || `which exim4`; chomp; $_ }
use constant ME => basename $0;
use constant HOSTNAME => hostname;
@@ -61,11 +62,10 @@
src => { ARGS => "=s", DEFAULT => "172.20.1.8" },
dst => { ARGS => "=s" }, # exim primary_hostname
- exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || "exim" },
+ exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || findExim },
config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" ,
ALIAS => "C" },
-
callout => { ARGS => "!", DEFAULT => 1 },
help => { ARGS => "!" },
@@ -75,6 +75,7 @@
my $Cf;
$Cf = new AppConfig CONFIG or die;
+ $Cf->exim or die "No exim binary found\n";
$Cf->dst(addr(exim_option("primary_hostname")));
$Cf->getopt(qw(pass_through no_ignore_case)) or die $@;