From 332213df3e305f06bdda6a191a7f98834c61aa9a Mon Sep 17 00:00:00 2001 From: John Denker Date: Sun, 3 Jun 2012 00:01:46 -0700 Subject: move code from makefile to script, to give better control; defaults should not clobber non-defaults --- tools/makefile | 5 +---- tools/mk_smtp_rules | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 tools/mk_smtp_rules (limited to 'tools') diff --git a/tools/makefile b/tools/makefile index 005b408..dbe4806 100644 --- a/tools/makefile +++ b/tools/makefile @@ -27,10 +27,7 @@ install: chown qmaild /var/qmail/control/*.crtkey /etc/tcpserver/smtp.rules : - install -d /etc/tcpserver - @echo '10.:allow,RELAYCLIENT=""' > $@ - @echo '127.0.0.:allow,RELAYCLIENT=""' >> $@ - @echo ':allow' >> $@ + ./mk_smtp_rules tcprules : /etc/tcpserver/smtp.rules < $< tcprules /etc/tcpserver/smtp.cdb /etc/tcpserver/smtp.tmp diff --git a/tools/mk_smtp_rules b/tools/mk_smtp_rules new file mode 100755 index 0000000..85c3298 --- /dev/null +++ b/tools/mk_smtp_rules @@ -0,0 +1,18 @@ +#! /bin/bash + +# if /etc/tcpserver/smtp.rules does not already exist, +# create it with some reasonable defaults + +dest=/etc/tcpserver/smtp.rules + +install -d $( dirname $dest ) + +if ! test -r $dest ; then + +< $dest +10.:allow,RELAYCLIENT="" +127.0.0.:allow,RELAYCLIENT="" +:allow +EoF + +fi -- cgit v1.2.3