I wrote what happened with STARTTLS and Port 25 up here:
funktionierbar
It seems I could not communicate what I wanted here. I didnt want to just make vaultwarden work, i wanted to understand and fix the underlying problem, as while vaultwarden does have an option to accept invalid certificates and is therefore able to use The VPNs IP as the SMTP host, Ghost and other dockers do not, and have the same problem.
I found another strange clue, when I nmap the localhost from inside the container I get the following result:
root@[docker id]:/# nmap -p 60-1000 localhost
Starting Nmap 7.93 ( https://nmap.org ) at 2024-10-01 08:42 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000070s latency).
Other addresses for localhost (not scanned): ::1
Not shown: 940 closed tcp ports (reset)
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.15 seconds
but when I nmap the VPN IP, the correct ports are accessible.
root@bc5670c8e7b4:/# nmap -p 60-1000 [VPN IP]
Starting Nmap 7.93 ( https://nmap.org ) at 2024-10-01 08:42 UTC
Nmap scan report for [VPN IP](128.0.64.168)
Host is up (0.0000070s latency).
Not shown: 929 closed tcp ports (reset)
PORT STATE SERVICE
80/tcp open http
110/tcp open pop3
143/tcp open imap
443/tcp open https
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
995/tcp open pop3s
Nmap done: 1 IP address (1 host up) scanned in 0.14 seconds
I dont know why that is. Why are the hosts ports closed to requests from inside a docker?
But it led to to find a workaround myself. I found out the reason for my FQDN being resolved to localhost is that the FQDN was in my /etc/hosts file on the host, and removed it from there. Now my requests to FQDN dont get resolved to localhost but to the VPN IP and everything suddenly works.
Thank you for thinking with me.