Hi,
I'd like the attached run script to more or less become the new
"standard" run script. "less" because I'd like to modify the script for
use with runit. Also, I'd also like to see delaygreeting support
included, but somehow I'm atm too stupid to do it. I get this:
# sh -x run
...
+ exec envuidgid qmaild tcpserver -v -URl baoab.oeko.net -H
-x/var/qmail/control/qmail-smtpd.cdb -c3 193.221.127.44 25 /bin/sleep 10 ; exec
/var/qmail/bin/qmail-smtpd
and when I "mconnect 193.221.127.44", I get:
tcpserver: ok 13525 baoab.oeko.net:193.221.127.44:25 :193.221.127.31::61922
usage: sleep seconds
tcpserver: end 13525 status 256
I tried various combinations for this, but to no avail (yet).
On the plus side, this run script makes it easier to set up a bunch of
slightly different SMTP services by just copying the structure for the
SMTP service and then setting vars in their respective ./env
directories.
Best,
--Toni++
#!/bin/sh
exec 2>&1
#
# SMTP service
#
QMAIL="/var/qmail"
ME="`head -1 $QMAIL/control/me`"
CONCURRENCY=${CONCURRENCY:=50}
QUSER="qmaild"
JOB="$QMAIL/bin/qmail-smtpd"
# CLASS="-submission"
CLASS=""
PATH="$QMAIL/bin:$PATH"
# source the environemt in ./env
eval `env - PATH=$PATH envdir ./env awk '\
BEGIN { for (i in ENVIRON) \
if (i != "PATH") { \
printf "export %s=\"%s\"\\n", i, ENVIRON[i] \
} \
}'`
# enforce some sane defaults
QUSER=${QUSER:="qmaild"}
PBSTOOL=${PBSTOOL:="$QMAIL/bin/pbscheck"}
LISTENON=${LISTENON:=0}
PORT=${PORT:=smtp}
if [ X${NOPBS+"true"} = X"true" ]; then
unset PBSTOOL
fi
if [ X${GREETDELAY} != X ]; then
JOB="sleep ${GREETDELAY}; exec $QMAIL/bin/qmail-smtpd"
fi
exec \
envuidgid $QUSER \
tcpserver -v -URl $ME ${TCPSERVEROPTS} -x$QMAIL/control/qmail-smtpd${CLASS}.cdb \
${CONCURRENCY:+"-c$CONCURRENCY"} ${BACKLOG:+"-b$BACKLOG"} ${LISTENON} ${PORT} \
$PBSTOOL \
$QMAIL/bin/qmail-smtpd