Comment 33 for bug 1519331

Revision history for this message
Erik Auerswald (auerswal) wrote :

Hi,

I see two problems to solve to enable using Postfix on laptops with changing network connectivity:

1. Copy a working /etc/resolve.conf on initial Postfix start-up
2. Adjust Postfix's copy of /etc/resolv.conf in /var/spool/postfix/etc/resolv.conf

Part 1 seems to be tackled with waiting for networking to come up. A static default using 127.0.1.1 as DNS server might work as well, at least for Ubuntu 14.04 LTS.

Part 2 can be solved similar to my comment #21, i.e. restarting Postfix whenever the system resolv.conf changes by using the appropriate infrastructure for this. Just copying the new file to the change root might suffice and might be nicer.

My use case is well described by by Steve Langasek as "intermittently online" machine. I want Postfix to store e-mails if there is no network connectivity, and send them out, when network connectivity is available.

Back in the day this just worked. There was a static /etc/resolv.conf and Postfix used the system resolv.conf file. Later enhancements made /etc/resolv.conf dynamic and Postfix moved to a change root with a local copy of an /etc/resolv.conf snapshot. Those two changes do not work together correctly.

BTW, the current status on 14.04 LTS is that Postfix often copies /etc/resolv.conf before this file is created correctly. Disabling and then enabling the network (e.g. unplug cable, wait for NetworkManager to notice, plug cable back in) resolves the issue iff a hook in /etc/resolvconf/update.d/ picks up the change and updates Postfix. I use the simple, but heavy-weight script described in comment #21 for this.

Thanks,
Erik