Hostname non corrisponde al certificato del server (Let's Encrypt)

Ciao, ho un problema con la ricezione dell’email di attivazione dopo l’installazione di Discourse.

Il mio processo:

Attualmente non ho un server di posta, quindi volevo eseguire sia il server di posta che Discourse sulla stessa macchina. Ho deciso di usare docker-mailserver. Ho ordinato un VPS da un provider tedesco e sto usando un dominio Namecheap che non utilizzavo più.
Poiché non voglio che questo dominio sia pubblico, l’ho sostituito con “domain.com” qui sotto. Spero non ci siano problemi.

  1. Server di posta: Ho installato il server di posta, creato alcuni indirizzi email con setup.sh, generato DKIM e creato un record TXT presso il mio provider DNS. Ho testato gli indirizzi con Thunderbird e sono riuscito a inviare e ricevere email senza problemi. Telnet restituisce anche 220, quindi sembra tutto a posto.
    Ecco uno screenshot dei record DNS:


    Risultato di SSL-Tools:
    Imgur: The magic of the Internet

  2. Discourse: Ho installato Discourse seguendo la Guida all’installazione Docker per principianti .
    Ho eseguito discourse-setup e inserito i seguenti dati:

    Hostname      : domain.com
    Email         : dun@domain.com
    SMTP address  : domain.com
    SMTP port     : 587
    SMTP username : discourse@domain.com
    SMTP password : ABCDEFG123
    LETSENCRYPT_ACCOUNT_EMAIL: tls@domain.com
    

Poi ho proceduto a inviare il link di attivazione a dun@domain.com, ma non è mai arrivato.

dun@server:~$ tail /var/discourse/shared/standalone/log/rails/production.log 

Sent mail to dun@domain.com (69.5ms)
Job exception: hostname "domain.com" does not match the server certificate

Sent mail to dun@domain.com (61.3ms)
Job exception: hostname "domain.com" does not match the server certificate

Sent mail to dun@domain.com (22.8ms)
Job exception: hostname "domain.com" does not match the server certificate

Non capisco pienamente cosa significhi perché è la prima volta che configuro TLS. Immagino sia perché sto usando un certificato diverso per il server di posta. Come potrei utilizzare lo stesso certificato per entrambi i container?

This is an issue with the mail server certificate. You can probably get one with Let’s Encrypt, but it’s not a problem with Discourse, so ask for help from the docker-mailserver people. If you want people to receive your mail and not to spend a long long time getting your mail server trusted, you’ll be better off using a mail service like Mailgun.

1 Mi Piace

Thanks for your reply.
I guess I understand it a little bit better now. With my configuration Discourse already created the LE certificate while installing. The next step to get this running would be using that certificate on my mailserver which seems to be kinda tricky. At least I didn’t found anyone mentioning a process like this. I searched for pem files in the Docker VM and found them in /etc/ssl/certs and in ruby-folders under /usr/local/lib and /var/www/discourse/vendor. But I don’t really know if I could just copy them to the virtual machine that’s running the mailserver.

So the conclusion is, that it’s not possible to make this setup run without having more knowledge about TLS.