addr
authorheiko
Thu, 04 Aug 2005 00:54:29 +0000
changeset 4 5c0e239c49c5
parent 3 f95c43d98314
child 5 3a8bb95e1428
addr
Makefile
exiacl
--- a/Makefile	Wed Aug 03 08:34:45 2005 +0000
+++ b/Makefile	Thu Aug 04 00:54:29 2005 +0000
@@ -10,7 +10,10 @@
 prefix = $(stowdir)/$(p)
 bindir = $(prefix)/bin
 
-.PHONY: install uninstall
+.PHONY: all install uninstall
+
+all:
+	@echo "nothing.  just install"
 
 
 install:    $(BIN)
--- a/exiacl	Wed Aug 03 08:34:45 2005 +0000
+++ b/exiacl	Thu Aug 04 00:54:29 2005 +0000
@@ -17,34 +17,39 @@
 use constant ME => basename $0;
 use constant CONFIG => (
     { CASE => 1 },
-    config  => { ARGS => "=s", DEFAULT => "exim.conf.t", ALIAS => "C" },
+    config  => { ARGS => "=s", DEFAULT => $ENV{EXIM_CONF} || "/etc/exim/exim.conf.t" , 
+		 ALIAS => "C" },
 
     src	    => { ARGS => "=s", DEFAULT => "131.107.0.15" },
     dst	    => { ARGS => "=s"  },
 
-    helo    => { ARGS => "=s", DEFAULT => "mail.microsoft.com" },
+    helo    => { ARGS => "=s", DEFAULT => "schlittermann.de" },
 
     From    => { ARGS => "=s" },
-    from    => { ARGS => "=s", DEFAULT => "hanson\@gmx.net" },
+    from    => { ARGS => "=s", DEFAULT => "<>" },
 
     to	    => { ARGS => "=s", DEFAULT => "hans\@pobox.com" },
 
-    exim    => { ARGS => "=s", DEFAULT => "exim"},
+    exim    => { ARGS => "=s", DEFAULT => $ENV{EXIM} || "exim" },
 );
 
 sub exim_option($);
 sub read_exim($);
 sub write_exim($@);
+sub addr(@);
 
 
 my $Cf;
 $Cf = new AppConfig CONFIG or die;
-    $Cf->dst(inet_ntoa(scalar gethostbyname(exim_option("primary_hostname"))));
+    $Cf->dst(addr(exim_option("primary_hostname")));
     $Cf->getopt(\@ARGV);
     $Cf->From($Cf->From || $Cf->from);
 
 my ($w, $r);
-my @cmd = ($Cf->exim, -C => $Cf->config, $Cf->dst ? (-oMi => $Cf->dst) : (), -bhc => $Cf->src);
+my @cmd = ($Cf->exim, 
+	-C => $Cf->config, 
+	$Cf->dst ? (-oMi => addr($Cf->dst) : ()), 
+	-bhc => addr($Cf->src));
 
 my $s = new IO::Select;
 
@@ -94,4 +99,8 @@
     $opts{$opt}
 } }
 
+sub addr(@) {
+    map { inet_ntoa scalar gethostbyname $_ } @_;
+}
+
 # vim:sts=4 sw=4 aw ai sm: