I'm a bit stuck here at the moment and will appreciate every push towards the right direction to solve this issue.
My two goals are to get an OpenVPN server running on a remote VM (Digital Ocean Droplet) and also run my postfix server on that VM. The OpenVPN connection is routing my DNS queries to a Pihole which provides me with proper ad blocking when I am not at home (where there is a pihole on an actual rpi running).
This setup working almost perfectly fine but with one exception. Once connected to the OpenVPN, I cannot receive or send emails anymore. Nothing pops up in my mail log (postfix and dovecot are running and logging) at all. Neither postfix nor dovecot is logging any connection attempt from my copmuter (which then is connected to the VPN). Once I disconnect from the VPN sending and receiving mails is working again.
I have ufw running and logging but nothing pops up in its logs neither.
I assume it has something to do with postfix running on localhost and once connected to the VPN interface there is a bridge I somehow have to build. But I got to be honest with you guys, I have no idea where to start with this, as I can't find anything online where exactly this issue is discussed.
What would you say where should I start looking? Firewall, VPN config, mailserver config? I'm a bit lost.
$ ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 8a:0c:da:93:21:88 brd ff:ff:ff:ff:ff:ff
inet XXXXXXXXXXX/20 brd XXXXXXXXXXXX scope global eth0
valid_lft forever preferred_lft forever
inet 10.19.0.5/16 brd 10.19.255.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 XXXXXXXXXXXXXXXXXXXXXX/64 scope global
valid_lft forever preferred_lft forever
inet6 XXXXXXXXXXXXXXXXXXXXXX/64 scope link
valid_lft forever preferred_lft forever
[...]
21: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100
link/none
inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
valid_lft forever preferred_lft forever
inet6 XXXXXXXXXXXXXXXXXXXXXX/64 scope link stable-privacy
valid_lft forever preferred_lft forever
$ cat /etc/openvpn/server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "route 192.168.10.0 255.255.255.0"
push "route 192.168.20.0 255.255.255.0"
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.8.0.1"
keepalive 10 120
tls-auth ta.key 0
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log /var/log/openvpn/openvpn.log
verb 3
explicit-exit-notify 1
OpenVPN logs the connection of my computer
Sat Dec 25 09:10:51 2021 macbook/XXXXXXXXX:59001 MULTI: primary virtual IP for macbook/XXXXXXXXX:59001: 10.8.0.10
Sat Dec 25 09:10:51 2021 macbook/XXXXXXXXX:59001 SENT CONTROL [macbook]: 'PUSH_REPLY,route 192.168.10.0 255.255.255.0,route 192.168.20.0 255.255.255.0,redirect-gateway def1 bypass-dhcp,dhcp-option DNS 10.8.0.1,route 10.8.0.1,topology net30,ping 10,ping-restart 120,ifconfig 10.8.0.10 10.8.0.9,peer-id 0,cipher AES-256-GCM' (status=1)