--- a/Makefile Thu Aug 04 00:54:29 2005 +0000
+++ b/Makefile Thu Aug 04 09:25:39 2005 +0000
@@ -13,8 +13,7 @@
.PHONY: all install uninstall
all:
- @echo "nothing. just install"
-
+ @echo "Nothing. Just install :)"
install: $(BIN)
install -d $(bindir)
--- a/exiacl Thu Aug 04 00:54:29 2005 +0000
+++ b/exiacl Thu Aug 04 09:25:39 2005 +0000
@@ -14,13 +14,15 @@
use Sys::Hostname;
+
use constant ME => basename $0;
+
use constant CONFIG => (
{ CASE => 1 },
config => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" ,
ALIAS => "C" },
- src => { ARGS => "=s", DEFAULT => "131.107.0.15" },
+ src => { ARGS => "=s", DEFAULT => "131.111.8.41" },
dst => { ARGS => "=s" },
helo => { ARGS => "=s", DEFAULT => "schlittermann.de" },
@@ -28,11 +30,13 @@
From => { ARGS => "=s" },
from => { ARGS => "=s", DEFAULT => "<>" },
- to => { ARGS => "=s", DEFAULT => "hans\@pobox.com" },
+ to => { ARGS => "=s", DEFAULT => "hans\@nowhere.example" },
exim => { ARGS => "=s", DEFAULT => $ENV{EXIM} || "exim" },
);
+
+
sub exim_option($);
sub read_exim($);
sub write_exim($@);
@@ -45,11 +49,14 @@
$Cf->getopt(\@ARGV);
$Cf->From($Cf->From || $Cf->from);
+die "Config file for exim not readable ".$Cf->config.": $!\n" if not -r $Cf->config;
+
my ($w, $r);
my @cmd = ($Cf->exim,
-C => $Cf->config,
- $Cf->dst ? (-oMi => addr($Cf->dst) : ()),
- -bhc => addr($Cf->src));
+ $Cf->dst ? (-oMi => addr($Cf->dst)) : (),
+ -bhc => addr($Cf->src),
+ @ARGV); # remaining args are exim native
my $s = new IO::Select;
@@ -93,8 +100,9 @@
my %opts;
sub exim_option($) {
my $opt = shift;
+ my $exim = $Cf->exim;
if (!%opts) {
- %opts = map { chomp; /^(.*?)\s*=\s*(.*)/ ? ($1, $2) : (/no_(.*)/ ? ($1, 0) : ($_, 1)) } grep !/^\s*$/, `exim -bP`;
+ %opts = map { chomp; /^(.*?)\s*=\s*(.*)/ ? ($1, $2) : (/no_(.*)/ ? ($1, 0) : ($_, 1)) } grep !/^\s*$/, `$exim -bP`;
}
$opts{$opt}
} }