Postfix in Docker container can't resolve MX unless it gets restarted once -
Postfix in Docker container can't resolve MX unless it gets restarted once -
i have issue postfix instance in docker container. i'm using supervisord
create sure services run in background. however, if build image, start first time , seek send mail, postfix complains can't resolve mx record given address (status=deferred (host or domain name not found. name service error name=domain.tld type=mx: host not found, seek again)
).
now installed dig
find out if dns issue, can resolve mx straight:
$ dig mx domain.tld +short 90 aspmx2.googlemail.com. 90 aspmx3.googlemail.com. 10 aspmx.l.google.com. 50 alt1.aspmx.l.google.com. 50 alt2.aspmx.l.google.com.
then proceeded restart postfix service postfix restart
, pretty startled mx issue gone. reproduced issue more 3 times , same. have issue service postfix restart
create postfix work functional.
can explain me why or better: how prepare this?
thanks in advance!
i ran same issue when tried install postfix on phusion/baseimage, replaces ubuntus init.d scheme runit. if issue "service postfix restart", nevertheless runs postfix script in /etc/init.d, in turn lot of things don't understand. 1 of them re-create bunch of files /etc /var/spool/postfix/etc, including resolv.conf. copying file fixed issue me. thus, in run script, add together (taken /etc/init.d/postfix)
files="localtime services resolv.conf hosts nsswitch.conf nss_mdns.config" file in $files; cp /etc/${file} /var/spool/postfix/etc/${file} chmod a+rx /var/spool/postfix/etc/${file} done
docker postfix-mta supervisord
Comments
Post a Comment