diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index d3a4046..13fefa1 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -66,16 +66,20 @@ postconf -e myhostname=$POSTFIX_HOSTNAME postconf -e "relay_domains=" # Relay configuration -postconf -e relayhost=$POSTFIX_RELAY_HOST +postconf -e "relayhost=$POSTFIX_RELAY_HOST" +postconf -e "smtp_sasl_auth_enable=yes" + +rm /etc/postfix/sasl_passwd || true echo "$POSTFIX_RELAY_HOST $POSTFIX_RELAY_USER:$POSTFIX_RELAY_PASSWORD" >> /etc/postfix/sasl_passwd postmap lmdb:/etc/postfix/sasl_passwd -postconf -e "smtp_sasl_auth_enable=yes" postconf -e "smtp_sasl_password_maps=lmdb:/etc/postfix/sasl_passwd" + postconf -e "smtp_sasl_security_options=noanonymous" postconf -e "smtp_sasl_tls_security_options=noanonymous" postconf -e "smtp_tls_security_level=encrypt" # Allowed senders +rm /etc/postfix/allowed_senders || true for i in $POSTFIX_SENDER_DOMAINS; do echo -e "$i\tOK" >> /etc/postfix/allowed_senders done