From 1df189f6eeafda7de7f0c3ace428152b927ab496 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Thu, 23 Jan 2025 13:55:38 +0100 Subject: [PATCH] Docker setup: add Postfix workaround DNS This ensures that name resolution settings are available in chrooted Postfix services. --- docker/images/mta/mta-entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/images/mta/mta-entrypoint.sh b/docker/images/mta/mta-entrypoint.sh index 7a4cd94..8cfc98f 100644 --- a/docker/images/mta/mta-entrypoint.sh +++ b/docker/images/mta/mta-entrypoint.sh @@ -3,11 +3,15 @@ if [ "$MTA_ROLE" == "mailpit" ] then BINDIP=$(ip addr | grep eth0 | grep inet | awk '{print $2}' | cut -d '/' -f 1) /mailpit.bin -s $BINDIP:25 --webroot mailpit + elif [ "$MTA_ROLE" == "postfix" ] then echo "[$POSTFIX_RELAYHOST_FQDN]:$POSTFIX_RELAYHOST_PORT $POSTFIX_RELAYHOST_USERNAME:$POSTFIX_RELAYHOST_PASSWORD" > /etc/postfix/sasl_passwd cd /etc/postfix postmap sasl_passwd + # Needed to make name resolution work for Postfix + cp /etc/resolv.conf /var/spool/postfix/etc/resolv.conf + # Update configuration values if [ "$POSTFIX_RELAYHOST_AUTH_ENABLED" == "yes" ]