Hello everybody.
I run a VPN with a few Dockers, one of them mailcow, all of them behind an apache reverse proxy. Mailcow is handed new externally created letsencrypt-certificates every month via a cronjob. All is well. Except:
I want to SMTP-send Mails from the other dockers (e.g. vaultwarden and ghost) via my mailcow-instance.
I am stuck since a few weeks now, and the documentation on this is meager and above my head.
I have two different ways of debugging. I change the config of vaultwarden and send test-mails, and i use openssl s_client -connect from the dockers internal shell. I read the dockers and mailcows postfix logs.
I have tried so far:
using the mail.example.com FQDN host from vaultwarden, and it returns: SMTP error: Connection error: Connection refused (os error 111)
using the internal IP of mailcow 172.22.1.1 and I get the error SMTP error: Connection error: error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1889: (IP address mismatch)
How is that internal relay adress used anyway? I use Letsencrypt-Certificates for the FQDN and the autodiscover domains, but they dont contain local hostnames or IPs. Are they supposed to? I don’t want to allow unencrypted transfer via port 25, or is there a way to allow it only from the inside?
- I added the vaultwarden docker to the mailcow-network, and tried to use postfix’ internal IP 172.22.1.253 (same erorr as above, and postfix container name, then I get the error
SMTP error:
Connection error: error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1889: (hostname mismatch)
When I check vaultwardens option to accept invalid certs I can send mail, but the other docker I want to use (ghost) does not have that option.
And, why does mailcow block my request from the other docker when using the FQDN? I can SMTP that way from my laptop, with openssl and thunderbird, why not from the other docker? Also, while vaultwarden and ghost have the identical problem, nextcloud doesn’t seem to mind at all, it just works with the same SMTP configuration. Firewall is off for now.
I tried to follow this guide: https://docs.mailcow.email/de/post_installation/firststeps-local_mta/ but it didn’t make any difference.
Thank you for thinking with me! I feel kind of stupid here, I have a feeling the solution is going to be so very obvious…