mirror of
https://github.com/mjl-/mox.git
synced 2025-06-28 01:48:15 +03:00

ip addresses are invalid in server names. for ipv6 addresses, the autocert.GetCertificate calls would return an error, which we logged, and increased a metric about. but the alerts for this situation aren't helpful. so recognize ip addresses early. if we are lenient about unknown server names (for incoming smtp deliveries), we switch to the fallback hostname, otherwise we return an error. this was the error logged: l=error m="requesting certificate" err="acme/autocert: server name component count invalid" for ipv4 addresses, the name wouldn't be in our allowlist and should already have caused us to switch to the fallback hostname.