|
|
@@ -4,6 +4,7 @@ set -euo pipefail
|
|
|
MAIL_HOSTNAME="${MAIL_HOSTNAME:-mailhub.local}"
|
|
|
MAIL_ORIGIN_DOMAIN="${MAIL_ORIGIN_DOMAIN:-${MAIL_HOSTNAME#*.}}"
|
|
|
POSTFIX_LOG_FILE="${POSTFIX_LOG_FILE:-/dev/stdout}"
|
|
|
+POSTFIX_PROXY_INTERFACES="${POSTFIX_PROXY_INTERFACES:-${SENDING_IP:-}}"
|
|
|
|
|
|
if [[ "${POSTFIX_LOG_FILE}" != "/dev/stdout" ]]; then
|
|
|
mkdir -p "$(dirname "${POSTFIX_LOG_FILE}")"
|
|
|
@@ -17,6 +18,9 @@ postconf -e "myorigin = ${MAIL_ORIGIN_DOMAIN}"
|
|
|
postconf -e "mydestination ="
|
|
|
postconf -e "inet_interfaces = all"
|
|
|
postconf -e "inet_protocols = ipv4"
|
|
|
+if [[ -n "${POSTFIX_PROXY_INTERFACES}" ]]; then
|
|
|
+ postconf -e "proxy_interfaces = ${POSTFIX_PROXY_INTERFACES}"
|
|
|
+fi
|
|
|
postconf -e "mynetworks = 127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"
|
|
|
postconf -e "smtpd_relay_restrictions = permit_mynetworks, reject_unauth_destination"
|
|
|
postconf -e "smtp_tls_security_level = may"
|