Easiest case if the default route for the postfix server points to the vpn tunnel.
If def gw does not point to vpn then you could use nat rules on vpn server to replace the src address with the vpn servers vpn address. If NAT is not an option then you will have to setup a policy based routing aka source based routing on postfix server to ensure answers from postfix go back via the same gateway they came in. Cheers tobi ----- Originale Nachricht ----- Von: Yubin Ruan <ablacktsh...@gmail.com> Gesendet: 01.08.2017 - 06:07 An: postfix-users@postfix.org Betreff: Specify VPN for postfix > 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