# HG changeset patch # User heiko # Date 1162503609 0 # Node ID 2dbba45114095d33b6db288623d38a2c47e93d64 # Parent bfb67e3281ca1c7056dc77f8fbf6a75515fa548b - try harder to guess the binary and the config file - do not pass any options to exim diff -r bfb67e3281ca -r 2dbba4511409 exiacl.pl --- a/exiacl.pl Wed Jul 26 09:47:09 2006 +0000 +++ b/exiacl.pl Thu Nov 02 21:40:09 2006 +0000 @@ -48,7 +48,10 @@ sub write_exim($@); sub addr(@); sub hostname() { chomp (my $h = `hostname -f`); return $h; } -sub findExim() { $_ = `which exim` || `which exim4`; chomp; $_ } + +sub which($) { (map { -x "$_/$_[0]" && "$_/$_[0]" || () } split /:/, $ENV{PATH})[0] } +sub findExim() { which("exim") || which("exim4") } +sub guessConfig($) { qx/$_[0] "-bV"/ =~ /^Configuration.*\sis\s+(\S+)/mi and return $1 } use constant ME => basename $0; use constant HOSTNAME => hostname; @@ -69,7 +72,7 @@ dst => { ARGS => "=s" }, # exim primary_hostname exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || findExim }, - config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" , + config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || guessConfig(findExim()), ALIAS => "C" }, callout => { ARGS => "!", DEFAULT => 1 }, @@ -83,7 +86,8 @@ $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 $@; + #$Cf->getopt(qw(pass_through no_ignore_case)) or die $@; + $Cf->getopt(qw(no_ignore_case)) or die $@; $Cf->From($Cf->from) unless $Cf->From; $Cf->To($Cf->to) unless $Cf->To;