containers-postfix/postfixd.sh

24 lines
625 B
Bash
Raw Normal View History

2022-03-09 16:18:48 +00:00
#!/bin/sh
case $1 in
start)
2022-03-29 14:46:41 +00:00
if test -z "${RSPAMD}" ; then
echo "Missing rspamd hostname" >&2
exit 1
fi
2022-03-09 16:18:48 +00:00
# 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"
2023-01-07 21:23:32 +00:00
postconf -e smtpd_milters="${MILTERS}"
2023-01-07 21:24:01 +00:00
postconf -e non_smtpd_milters="${MILTERS}"
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