Skip to content

Instantly share code, notes, and snippets.

@drinchev
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drinchev/de5bccf68cc080454c30 to your computer and use it in GitHub Desktop.
Save drinchev/de5bccf68cc080454c30 to your computer and use it in GitHub Desktop.
qmail start script ( http://www.lifewithqmail.org/lwq.html )
#!/bin/sh
QMAILDUID=`id -u qmaild`
NOFILESGID=`id -g qmaild`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
LOCAL=`head -1 /var/qmail/control/me`
if [ -z "$QMAILDUID" -o -z "$NOFILESGID" -o -z "$MAXSMTPD" -o -z "$LOCAL" ]; then
echo QMAILDUID, NOFILESGID, MAXSMTPD, or LOCAL is unset in
echo /var/qmail/supervise/qmail-smtpd/run
exit 1
fi
if [ ! -f /var/qmail/control/rcpthosts ]; then
echo "No /var/qmail/control/rcpthosts!"
echo "Refusing to start SMTP listener because it'll create an open relay"
exit 1
fi
# * Changed limit from 2000000 to 5000000
# * Changed path to tcp server from /usr/local/bin to /usr/bin
exec /usr/local/bin/softlimit -m 5000000 \
/usr/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 25 /var/qmail/bin/qmail-smtpd 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment