13.12.2024 13:35, Vincent Lefevre wrote:
#! /bin/sh cp -pLu /etc/resolv.conf /var/spool/postfix/etc/resolv.conf || :
I suppose that postfix also needs to be reloaded, like what /etc/network/if-up.d/postfix does (or was this unneeded?).
It's been needed in 2001. It's not anymore.
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.
More sophisticated control should be done by the user, since only he knows which interfaces are to trigger what and when. If you want to trigger mail queue processing, do 'sendmail -q'. /mjt