# HG changeset patch # User heiko # Date 1124458686 0 # Node ID ce3163d69ea618f4c526fee4d7891133b953e461 # Parent 1f683c5eef8f281120583e63d37115738e2e8e1b exim is now searched via `which` diff -r 1f683c5eef8f -r ce3163d69ea6 exiacl.pl --- 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 $@;