--- a/exiacl Fri Aug 05 15:02:37 2005 +0000
+++ b/exiacl Fri Aug 05 15:29:52 2005 +0000
@@ -33,9 +33,6 @@
use IO::Select;
use Socket;
use File::Basename;
-use Sys::Hostname;
-
-
use constant ME => basename $0;
@@ -45,10 +42,10 @@
log => { ARGS => "!", DEFAULT => 1 },
debug => { ARGS => "!", DEFAULT => 0 },
- src => { ARGS => "=s", DEFAULT => "131.111.8.41" },
- dst => { ARGS => "=s" },
+ src => { ARGS => "=s" }, # hostname -f
+ dst => { ARGS => "=s" }, # primary_hostname
- Helo => { ARGS => "=s", DEFAULT => "sesame.csx.cam.ac.uk", ALIAS => "Ehlo" },
+ Helo => { ARGS => "=s", ALIAS => "Ehlo" }, # hostname -f
From => { ARGS => "=s", DEFAULT => "<>" },
from => { ARGS => "=s", DEFAULT => "postmaster\@exim.org" },
@@ -63,18 +60,22 @@
);
-
-
sub exim_option($);
sub read_exim($);
sub write_exim($@);
sub addr(@);
+sub hostname() { chomp (my $h = `hostname -f`); return $h; }
+
+use constant HOSTNAME => hostname;
+
my $Cf;
$Cf = new AppConfig CONFIG or die;
$Cf->dst(addr(exim_option("primary_hostname")));
$Cf->getopt(\@ARGV) or die $@;
- $Cf->From($Cf->From || $Cf->from);
+ $Cf->From($Cf->from) unless $Cf->From;
+ $Cf->src(addr(HOSTNAME)) unless $Cf->src;
+ $Cf->Helo(HOSTNAME) unless $Cf->Helo;
MAIN: {