Mailgun setup fails certificate validation

While setting up Mailgun with either:

HOST=smtp.mailgun.com:587
IS_TLS_ENABLED=true

or

HOST=smtp.mailgun.com:465
IS_TLS_ENABLED=false

Returns the following error while sending a test email:

gomail: could not send email 1: StartTLS: x509: certificate is valid for *.mailgun.org, mailgun.org, not smtp.mailgun.com

Seems like a bug in validation, since *.mailgun.org is a wildcard that covers smtp.mailgun.com

I just now realized that it’s a different TLD :man_facepalming:

For folks who came across this, just use the correct smtp server host: smtp.mailgun.org