smtp/init

27 lines
487 B
Plaintext
Raw Normal View History

2017-07-23 07:56:38 +00:00
#!/bin/bash
set -e
NAME="SMTP"
function stop {
echo "Stopping ${NAME}"
2018-01-31 11:56:02 +00:00
kill $(cat /run/saslauthd/saslauthd.pid)
kill $(cat /run/sendmail/mta/sendmail.pid|head -1)
2017-07-23 07:56:38 +00:00
}
trap 'stop' SIGTERM
if [ -z `hostname --domain` ]; then
echo "You must start this container with --hostname= specifying a domain name"
exit 1
fi
if [ "$1" == "start" ]; then
/usr/sbin/saslauthd -m /run/saslauthd -a pam
2018-02-02 06:18:04 +00:00
cd /etc/mail && make && make && exec /usr/sbin/sendmail -q1h -bD &
2017-07-23 07:56:38 +00:00
wait
else
exec $@
fi