diff --git a/postfixd.sh b/postfixd.sh index 8af2776..93026e3 100755 --- a/postfixd.sh +++ b/postfixd.sh @@ -2,18 +2,17 @@ case $1 in start) - if test -z "${RSPAMD}" ; then - echo "Missing rspamd hostname" >&2 - exit 1 - fi - # 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" - postconf -e smtpd_milters="${MILTERS}" - postconf -e non_smtpd_milters="${MILTERS}" + + if test -n "${MILTERS}"; then + postconf -e smtpd_milters="${MILTERS}" + postconf -e non_smtpd_milters="${MILTERS}" + fi + test -n "${NETWORKS}" && postconf -e mynetworks="${NETWORKS}" ;;