Hostname does not match the server certificate - none of the other threads provide solutions to this

Searching threads in this Forum came up blank. It’s seems this is the issue everyone is asking about but there are little solutions.

I’ve got working credentials and a working DirectAdmin mail server that I share among several domains I run. So naturally the hostname does not equal the sending domain name.

I’ve got Lets-encrypt certificates setup for the domain name and mail-server. SPF and Dkim records are valid as well.

However Discourse keeps bumping into this issue and won’t accept the mail server.One of the other threads suggested adding to app.yml:


This too has not worked.

My Discourse is a small private community for a group of tech colleagues. As a result I’m having a hard time getting any participation from transactional mail services. So I need a private mail server to work.

I’ve tried several ways of solving this for 4months. Setting up a service should not be this hard.

Do you have any logs you can provide to show the actual error you’re seeing and where it’s happening?

It sounds like you’re talking about Discourse sending emails via your DirectAdmin mail server. If this is the case, the sending domain has no bearing on SSL, the DirectAdmin server would just need a valid certificate for the domain used for DISCOURSE_SMTP_ADDRESS in your Discourse app.yml file.

When you added DISCOURSE_SMTP_OPENSSL_VERIFY_MODE to app.yml, did you also rebuild the container? Any change to app.yml will require the container to be rebuilt before it takes effect. Note however that even if that option does work, disabling OpenSSL verification is a security risk and should not be used unless the mail server is on the same machine or at least within the same closed network.