Skip to content

Commit

Permalink
Docker setup: add Postfix workaround DNS
Browse files Browse the repository at this point in the history
This ensures that name resolution settings are available in
chrooted Postfix services.
  • Loading branch information
stsnel committed Jan 23, 2025
1 parent 4bbd6a3 commit 1df189f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/images/mta/mta-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down

0 comments on commit 1df189f

Please sign in to comment.