On 2024-12-13 13:13:23 +0300, Michael Tokarev wrote:
> The quick solution is to have /etc/NetworkManager/dispatcher.d/postfix:
> 
> #! /bin/sh
> cp -pLu /etc/resolv.conf /var/spool/postfix/etc/resolv.conf || :
> 
> and chmod +x it (make it executable).  After that, your postfix
> should always know the current resolv.conf.  There's nothing else
> to do, postfix will pick it up automatically on the next dns lookup.
> 
> I'll add this to /usr/lib/NetworkManager/dispatcher.d/ in the package.

I suppose that postfix also needs to be reloaded, like what
/etc/network/if-up.d/postfix does (or was this unneeded?).

Also, forcing a queue run like what /etc/network/if-up.d/postfix
does would also be useful, at least on some events: the wireless
interface remains up while wifi has been disconnected, so one may
want to run the queue when one gets back network connectivity. The
NetworkManager-dispatcher(8) man page mentions connectivity-change,
though I'm not sure that this works (I've never tried). Note that
due to captive portals, I suppose that dhcp4-change / dhcp6-change
events may come too early for that.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to