I have this setup for my mail domain
client->cloudflare->VPS Host->HAProxy->wireguardvpn->nginx reverse proxy->Mailcow Server .
I have the mail domain A/CNAME/MX/TXT records all pointed at the VPS servers IP address.
When the acme script tries to validate that the mail domain resolves to the mailcow server’s IP address, it gets my router’s IP address instead of the VPN server’s address, so validate fails. The output looks like this (redacted ):
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:04 MST 2022 - Detecting IP addresses...
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:05 MST 2022 - OK: redacted ip, 2601:283:4602:37c0::1f3
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:05 MST 2022 - Found A record for <redacted domain: redacted IP
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:05 MST 2022 - Cannot match your IP 73.243.40.30 against hostname redacted doman (DNS returned redacted IP)
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:05 MST 2022 - Cannot validate any hostnames, skipping Let's Encrypt for 1 hour.
mailcowdockerized-acme-mailcow-1 | Wed Feb 9 21:35:05 MST 2022 - Use SKIP_LETS_ENCRYPT=y in mailcow.conf to skip it permanently.
In my mind, the easiest solution would be to use the DNS challenge. Can the **acme container be configured to use the DNS challenge method to validate my domain?
Some other idea’s I have are
- configuring the mailcow docker bridge network to route through the wireguard VPN which goes through the correct gateway to the Internet.
- put mailcow into a virtual machine that routes through the wireguard vpn to get to the Internet.
For the short term, I manually created the ssl certificate for the mail domain using certbot, and I configured the certificate path in my nginx server block for mailcow. That’s working in that I can access the mailcow web interfaces over https , but I’d rather that mailcow manage it’s own certificate.