On 31/03/20 2:19 am, Ranjan Maitra wrote:
On Mon, 30 Mar 2020 13:11:42 +0200 Bastian Blank 
<bastian+postfix-users=postfix....@waldi.eu.org> wrote:

On Mon, Mar 23, 2020 at 01:04:44PM -0500, Ranjan Maitra wrote:
So, I am wondering if I it is possible to have a setup whereby postfix is 
delayed unless/until VPN is up and running. If VPN is down, then I would like 
postfix to be delayed until such time as it comes up. If it is possible, how do 
I go about doing this? Other ideas?

I would just reject SMTP connections outgoing on your non-VPN interfaces.

| iptables -A OUTPUT -o $vpn -m tcp --dport 25 -j ACCEPT
| iptables -A OUTPUT -m tcp --dport 25 -j REJECT


Thanks very much! This seems to a very simple solution. And would this delay 
postfix until VPN is up and running for messages that are sent?

Also, just to be clear, I tried

echo $vpn

with and without VPN connected. I got a blank. Is this expected? (I was 
expecting the VPN connection to show up when I had VPN running.)

Substitute the name of your VPN interface for $vpn.


Peter

Reply via email to