#!/bin/sh set -e NAME="SMTP" function stop { echo "Stopping ${NAME}" kill $(cat /run/saslauthd/saslauthd.pid) kill $(cat /run/sendmail/mta/sendmail.pid|head -1) } trap 'stop' SIGTERM if [ -z "$@" ]; then if [ -z `hostname -d` ]; then echo "You must start this container with --hostname= specifying a domain name" exit 1 fi #/usr/sbin/saslauthd -m /run/saslauthd -a pam #cd /etc/mail && make && make && exec /usr/sbin/sendmail -q1h -bD & newaliases postfix start /usr/sbin/opendkim -P /run/opendkim.pid -u opendkim -f wait else exec $@ fi