Skip to content

Instantly share code, notes, and snippets.

@nbari
Last active August 29, 2015 13:59
Show Gist options
  • Save nbari/10548384 to your computer and use it in GitHub Desktop.
Save nbari/10548384 to your computer and use it in GitHub Desktop.
qmail-smtpd-SSL-465
#!/bin/sh
exec 2>&1
#
# SMTP service
#
QMAIL="/var/qmail"
ME="`head -1 $QMAIL/control/me`"
CONCURRENCY=${CONCURRENCY:=50}
QUSER="qmaild"
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"}
exec \
envuidgid $QUSER \
tcpserver -v -s -URl $ME -x$QMAIL/control/qmail-smtpd.cdb -n $QMAIL/control/my_smtp.pem \
${CONCURRENCY:+"-c$CONCURRENCY"} ${BACKLOG:+"-b$BACKLOG"} 0 465 \
$QMAIL/bin/qmail-smtpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment