smtp/init

34 lines
704 B
Plaintext
Raw Normal View History

2023-04-25 20:39:41 +10:00
#!/bin/sh
2017-07-23 17:56:38 +10:00
set -e
NAME="SMTP"
function stop {
echo "Stopping ${NAME}"
2018-01-31 22:56:02 +11:00
kill $(cat /run/saslauthd/saslauthd.pid)
kill $(cat /run/sendmail/mta/sendmail.pid|head -1)
2017-07-23 17:56:38 +10:00
}
trap 'stop' SIGTERM
2023-04-25 20:39:41 +10:00
if [ -z "$@" ]; then
if [ -z `hostname -d` ]; then
echo "You must start this container with --hostname= specifying a domain name"
exit 1
fi
2017-07-23 17:56:38 +10:00
2023-04-28 15:16:31 +10:00
touch /etc/postfix/custom/relay_host
touch /etc/postfix/custom/sasl_passwd
postmap -o lmdb:/etc/postfix/custom/sasl_passwd
touch /etc/postfix/custom/transport
postmap -o lmdb:/etc/postfix/custom/transport
/usr/sbin/saslauthd -m /run/saslauthd -ca shadow
2023-04-25 20:39:41 +10:00
newaliases
postfix start
/usr/sbin/opendkim -P /run/opendkim.pid -u opendkim -f
2017-07-23 17:56:38 +10:00
wait
else
exec $@
fi