containers-postfix/postfixd.sh

30 lines
872 B
Bash
Raw Normal View History

2022-03-09 16:18:48 +00:00
#!/bin/sh
case $1 in
start)
# Reconfigure postfix according to environment
2022-03-29 18:29:47 +00:00
postconf -e myhostname="${DOMAIN}"
2022-03-09 16:18:48 +00:00
postconf -e mydomain="${SUTTY}"
2022-03-29 18:29:47 +00:00
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
2023-01-07 21:27:09 +00:00
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
2023-01-07 21:27:09 +00:00
fi
2022-03-29 17:42:04 +00:00
test -n "${NETWORKS}" && postconf -e mynetworks="${NETWORKS}"
2022-03-09 16:18:48 +00:00
;;
stop) ;;
esac
exec /usr/sbin/postfix $1