I have a Postfix mail server, running on a host with multiple network adapters, one of which is a virtual tun0 device. I need this mail server to accept connections on any adapter - and send email only on the virtual tun device.
I have a configuration, in line with the answer to this question, which defines smtp_bind_address=10.20.30.40 - where 10.20.30.40 is the address associated with the tun0 device. This server server doesn't support IPV6.
For years, this appeared to work perfectly - until, one day, the tun0 device died - and Postfix sent email over the default network device, eth0 (10.0.0,1) not tun0.
Is this expected behaviour? Are there settings I can change to ensure that Postfix only ever dispatches email over tun0 (10.20.30.40) - leaving messages in the queue if tun0 is not available?
In case it is relevant, this is on Ubuntu 16.04.2 LTS with Postfix version 3.1.0-3. tun0 is implemented using OpenVPN version 2.3.10-1ubuntu2.1
-- Edit to add extra details --
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.20.30.40 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
This server runs several services - of which Postfix is only one. Only email needs to be routed over 10.20.30.40 - all the other services need to be routed over the default gateway.