containers-postfix/postfixd.sh

30 lines
872 B
Bash
Executable File

#!/bin/sh
case $1 in
start)
# Reconfigure postfix according to environment
postconf -e myhostname="${DOMAIN}"
postconf -e mydomain="${SUTTY}"
postconf -e smtpd_tls_key_file="/etc/letsencrypt/live/${DOMAIN}/privkey.pem"
postconf -e smtpd_tls_cert_file="/etc/letsencrypt/live/${DOMAIN}/fullchain.pem"
if test -n "${MILTERS}"; then
postconf -e smtpd_milters="${MILTERS}"
postconf -e non_smtpd_milters="${MILTERS}"
fi
if test -n "${SRS}"; then
postconf -e sender_canonical_maps=tcp:${SRS}:10001
postconf -e recipient_canonical_maps=tcp:${SRS}:10002
postconf -e sender_canonical_classes=envelope_sender
postconf -e recipient_canonical_classes=envelope_recipient,header_recipient
fi
test -n "${NETWORKS}" && postconf -e mynetworks="${NETWORKS}"
;;
stop) ;;
esac
exec /usr/sbin/postfix $1