Take a look at your header file when using the VPN to email yourself. I think what you want happens automatically.
Received: from [10.8.0.6] (unknown [MYIPADDRESS]) 10.8.0.6 is the local IP space created by my VPN. But my IP address also shows up, so hopefully a guru will chime in as to how this all works. One thing to consider is that you may run into an internet provider (probably public wifi) that blocks the use of a VPN. Somewhat common with IPSEC. Perhaps less with openvpn. So you wouldn't want to make the VPN be a mandatory requirement. On Tue, 1 Aug 2017 12:07:26 +0800 Yubin Ruan <ablacktsh...@gmail.com> wrote: > Hi, > Can anyone tell me how to point postfix to a VPN connection? I have > setup a VPN listening at background on my Ubuntu and I want to point > postfix to that listening port whenever postfix try to connect to the > internet. > > Thanks, > Yubin