Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Ranjan Maitra
On Mon, 23 Mar 2020 15:05:17 -0400 (EDT) Wietse Venema wrote: > >Ranjan Maitra: > > 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

delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Ranjan Maitra
Hi, I am using postfix to deliver my work mail from a remote location. This works fine when I am on VPN (the postfix traffic goes through VPN then). However, it gets identified as spam when VPN is not up while sending the e-mail. Since most people do not routinely check their spam folders

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Peter
On 24/03/20 8:05 am, Wietse Venema wrote: Ranjan Maitra: 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

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Wietse Venema
>Ranjan Maitra: > 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?

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Wietse Venema
Ranjan Maitra: > 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?

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Ranjan Maitra
On Mon, 23 Mar 2020 16:22:40 -0400 (EDT) Wietse Venema wrote: > Ranjan Maitra: > > 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

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Wietse Venema
Corrected code follows (missing do/done). Save to file, chmod +x name-of-file, don't run this script from cron. It needs to be started at boot time, or before you make a VPN connection. #!/bin/sh while : do ifconfig xxx | egrep 'UP|DOWN' sleep 2 done | while read status do case

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Leonid Isaev
On Mon, Mar 23, 2020 at 03:36:52PM -0500, Ranjan Maitra wrote: > I presume that this should go in as a cron job. This depends on your distribution and VPN settings. For example, on my ArchLinux system which uses OpenVPN, I'd make this a systemd unit that binds to the tun network interface...

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Bob Proulx
Scott Kitterman wrote: > On Monday, March 23, 2020 7:47:25 PM EDT Bob Proulx wrote: But don't forget I also said: > > I know you said you are running Fedora but I imagine that Fedora > > has something like this but in a different place. Doesn't Fedora > > have a /etc/sysconfig/network-scripts/

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Ranjan Maitra
On Mon, 23 Mar 2020 18:46:11 -0600 Bob Proulx wrote: > Scott Kitterman wrote: > > On Monday, March 23, 2020 7:47:25 PM EDT Bob Proulx wrote: > > But don't forget I also said: > > > > I know you said you are running Fedora but I imagine that Fedora > > > has something like this but in a different

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Scott Kitterman
On Monday, March 23, 2020 7:47:25 PM EDT Bob Proulx wrote: > On my Debian (and therefore Ubuntu, Mint, other derivatives) I would > add a script /etc/network/if-up.d/postfix-local (in addition to the > already existing "postfix" script there) that does this when the VPN > interface comes up, and a

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Bob Proulx
Ranjan Maitra wrote: > I am using postfix to deliver my work mail from a remote > location. This works fine when I am on VPN (the postfix traffic goes > through VPN then). However, it gets identified as spam when VPN is > not up while sending the e-mail. Since most people do not routinely > check

Re: delaying postfix until/unless VPN is up/connected

2020-03-23 Thread Bob Proulx
Leonid Isaev wrote: > This depends on your distribution and VPN settings. For example, on my > ArchLinux system which uses OpenVPN, I'd make this a systemd unit that binds > to > the tun network interface... I know you said you are running Fedora but I imagine that Fedora has something like this