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

2020-04-17 Thread Wietse Venema
Ranjan Maitra: > On Fri, 17 Apr 2020 15:21:49 +0200 Jan Ceuleers > wrote: > > > On 17/04/2020 15:08, Ranjan Maitra wrote: > > > Btw, for me, when ifconfig is DOWN, I do not get a down. > > > > ifconfig -a fixes that. > > > > Sorry, but not for me: > > When down: > > $ifconfig -a | egrep

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

2020-04-17 Thread Ranjan Maitra
On Fri, 17 Apr 2020 15:21:49 +0200 Jan Ceuleers wrote: > On 17/04/2020 15:08, Ranjan Maitra wrote: > > Btw, for me, when ifconfig is DOWN, I do not get a down. > > ifconfig -a fixes that. > Sorry, but not for me: When down: $ifconfig -a | egrep 'UP|DOWN' : error fetching interface i

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

2020-04-17 Thread Jan Ceuleers
On 17/04/2020 15:08, Ranjan Maitra wrote: > Btw, for me, when ifconfig is DOWN, I do not get a down. ifconfig -a fixes that.

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

2020-04-17 Thread Ranjan Maitra
On Fri, 17 Apr 2020 08:05:28 + Gregory Heytings wrote: > > Ranjan Maitra: > > > >> 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 ma

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

2020-04-17 Thread Gregory Heytings
Ranjan Maitra: 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 do

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

2020-04-17 Thread Bill Cole
On 17 Apr 2020, at 2:52, Ansgar Wiechers wrote: > On 2020-04-17 Bill Cole wrote: >> On 17 Apr 2020, at 0:57, Ranjan Maitra wrote: >>> On Mon, 23 Mar 2020 17:19:42 -0400 (EDT) Wietse Venema wrote: #!/bin/sh while : do ifconfig xxx | egrep 'UP|DOWN' sleep 2

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

2020-04-16 Thread Ansgar Wiechers
On 2020-04-17 Bill Cole wrote: > On 17 Apr 2020, at 0:57, Ranjan Maitra wrote: > > On Mon, 23 Mar 2020 17:19:42 -0400 (EDT) Wietse Venema wrote: > > > #!/bin/sh > > > > > > while : > > > do > > > ifconfig xxx | egrep 'UP|DOWN' > > > sleep 2 > > > done | while read status > > > do > > >

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

2020-04-16 Thread Bill Cole
On 17 Apr 2020, at 0:57, Ranjan Maitra wrote: On Mon, 23 Mar 2020 17:19:42 -0400 (EDT) Wietse Venema wrote: 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 connect

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

2020-04-16 Thread Ranjan Maitra
On Mon, 23 Mar 2020 17:19:42 -0400 (EDT) Wietse Venema wrote: > 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 >

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

2020-04-01 Thread Peter
On 1/04/20 10:10 am, Ranjan Maitra wrote: sudo iptables -A OUTPUT -o cscotun0 -p tcp --dport 25 -j ACCEPT sudo iptables -A OUTPUT -p tcp --dport 25 -j REJECT However, what has happened is that all my mail going out has stopped? How do I revert it back to what I used to have? Look at the ipta

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

2020-03-31 Thread Ranjan Maitra
On Wed, 1 Apr 2020 09:51:31 +1300 Peter wrote: > On 1/04/20 1:42 am, Ranjan Maitra wrote: > > On Tue, 31 Mar 2020 19:41:58 +1300 Peter wrote: > > > >> On 31/03/20 5:42 pm, Bob Proulx wrote: > >>> The "$vpn" part is a variable was simply a placeholder for the IP > >>> address of your VPN connecte

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

2020-03-31 Thread Peter
On 1/04/20 1:42 am, Ranjan Maitra wrote: On Tue, 31 Mar 2020 19:41:58 +1300 Peter wrote: On 31/03/20 5:42 pm, Bob Proulx wrote: The "$vpn" part is a variable was simply a placeholder for the IP address of your VPN connected relayhost. It would be an IP address like 93.184.216.34 but put in t

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

2020-03-31 Thread Bob Proulx
Peter wrote: > Bob Proulx wrote: > >iptables -A OUTPUT -o 93.184.216.34 -m tcp --dport 25 -j ACCEPT > >iptables -A OUTPUT -m tcp --dport 25 -j REJECT > > > > But replace 93.184.216.34 with the IP address of your VPN relay host. > > I simply used an actual address inorder to clarify the exa

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

2020-03-31 Thread Ranjan Maitra
On Tue, 31 Mar 2020 19:41:58 +1300 Peter wrote: > On 31/03/20 5:42 pm, Bob Proulx wrote: > > The "$vpn" part is a variable was simply a placeholder for the IP > > address of your VPN connected relayhost. It would be an IP address > > like 93.184.216.34 but put in the IP address of your relay hos

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

2020-03-30 Thread Tessa Plum
sorry just OT, my VPS has only IPv6 interface, can I deploy it as mail server? Thank you. Tessa Peter wrote: Actually it's an interface name (such as tun0), not an IP address:

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

2020-03-30 Thread Peter
On 31/03/20 5:42 pm, Bob Proulx wrote: The "$vpn" part is a variable was simply a placeholder for the IP address of your VPN connected relayhost. It would be an IP address like 93.184.216.34 but put in the IP address of your relay host that is only accessible when the VPN is up. iptables -A

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

2020-03-30 Thread Ranjan Maitra
On Mon, 30 Mar 2020 22:42:25 -0600 Bob Proulx wrote: > Ranjan Maitra wrote: > > Bastian Blank wrote: > > > 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 REJEC

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

2020-03-30 Thread Bob Proulx
Ranjan Maitra wrote: > Bastian Blank wrote: > > 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 > > So, I was trying this out: > > $ sudo iptables -A OUTPUT

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

2020-03-30 Thread Peter
On 31/03/20 2:19 am, Ranjan Maitra wrote: On Mon, 30 Mar 2020 13:11:42 +0200 Bastian Blank 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 do

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

2020-03-30 Thread Ranjan Maitra
On Mon, 30 Mar 2020 13:11:42 +0200 Bastian Blank 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 t

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

2020-03-30 Thread Ranjan Maitra
On Mon, 30 Mar 2020 13:11:42 +0200 Bastian Blank 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 t

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

2020-03-30 Thread Bastian Blank
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

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

2020-03-25 Thread Bob Proulx
Wietse Venema wrote: > Ranjan Maitra: > > Thanks, except that it does not send even when VPN is up. I get > > the same message and I can get it to send only when I change my > > relayhost back to the default. What is your relayhost setting? > 2) the remote relayhost must only accept mail when the

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

2020-03-25 Thread Wietse Venema
Ranjan Maitra: > On Wed, 25 Mar 2020 10:31:11 -0400 (EDT) Wietse Venema > wrote: > > > Ranjan Maitra: > > > So, I have tried to set the relayhost to a specific mailhub address but > > > have not been able to make this work. I get a message then which reads > > > like: > > > > > > delivery tem

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

2020-03-25 Thread Ranjan Maitra
On Wed, 25 Mar 2020 10:31:11 -0400 (EDT) Wietse Venema wrote: > Ranjan Maitra: > > So, I have tried to set the relayhost to a specific mailhub address but > > have not been able to make this work. I get a message then which reads like: > > > > delivery temporarily suspended: lost connection wi

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

2020-03-25 Thread Wietse Venema
Ranjan Maitra: > So, I have tried to set the relayhost to a specific mailhub address but have > not been able to make this work. I get a message then which reads like: > > delivery temporarily suspended: lost connection with the mailhub server > while receiving the initial server greeting This

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

2020-03-24 Thread Ranjan Maitra
On Tue, 24 Mar 2020 16:51:38 +0100 Jaroslaw Rafa wrote: > Dnia 24.03.2020 o godz. 08:49:26 Wietse Venema pisze: > > Ranjan Maitra: > > > However, I am a little confused as to what I should do. It appears > > > to me that an example such as here: > > > https://blog.skbali.com/2019/03/start-a-scrip

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

2020-03-24 Thread Jaroslaw Rafa
Dnia 24.03.2020 o godz. 08:49:26 Wietse Venema pisze: > Ranjan Maitra: > > However, I am a little confused as to what I should do. It appears > > to me that an example such as here: > > https://blog.skbali.com/2019/03/start-a-script-on-boot-using-systemd/ > > would be enough to get this started at

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

2020-03-24 Thread Ranjan Maitra
On Tue, 24 Mar 2020 08:49:26 -0400 (EDT) Wietse Venema wrote: > Ranjan Maitra: > > However, I am a little confused as to what I should do. It appears > > to me that an example such as here: > > https://blog.skbali.com/2019/03/start-a-script-on-boot-using-systemd/ > > would be enough to get this

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

2020-03-24 Thread Wietse Venema
Ranjan Maitra: > However, I am a little confused as to what I should do. It appears > to me that an example such as here: > https://blog.skbali.com/2019/03/start-a-script-on-boot-using-systemd/ > would be enough to get this started at boot? I suggest that you ask about how to run a command at boot

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 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/ d

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 t

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
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

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... HTH,

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 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 comes

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? Wiets

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 abo

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 come

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? Befo

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 espec