Hostname stimmt nicht mit dem Serverzertifikat (Let's Encrypt) überein

Hallo, ich habe ein Problem mit dem Empfang der Aktivierungs-E-Mail nach der Installation von Discourse.

Mein Vorgehen:

Ich habe derzeit keinen Mailserver, daher wollte ich Mailserver und Discourse auf derselben Maschine betreiben. Ich habe mich für docker-mailserver entschieden. Ich habe einen VPS bei einem deutschen Anbieter bestellt und verwende eine Domain von Namecheap, die ich nicht mehr nutzte.
Da ich nicht möchte, dass diese Domain öffentlich ist, habe ich sie unten durch „domain.com" ersetzt. Ich hoffe, das ist in Ordnung.

  1. Mailserver: Ich habe den Mailserver installiert, einige E-Mail-Adressen mit setup.sh erstellt, DKIM generiert und einen TXT-Eintrag dafür bei meinem DNS-Anbieter angelegt. Ich habe die Adressen mit Thunderbird getestet und konnte problemlos E-Mails senden und empfangen. Telnet liefert ebenfalls 220 zurück, also scheint alles in Ordnung zu sein.
    Hier ist ein Screenshot der DNS-Einträge:


    Ergebnis von SSL-Tools:
    Imgur: The magic of the Internet

  2. Discourse: Ich habe Discourse installiert, indem ich den Anfänger-Docker-Installationsleitfaden befolgt habe.
    Ich habe discourse-setup ausgeführt und folgende Daten eingegeben:

    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
    

Anschließend habe ich versucht, den Aktivierungslink an dun@domain.com zu senden, aber er ist nie angekommen.

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

Ich verstehe nicht ganz, was das bedeutet, da dies das erste Mal ist, dass ich TLS konfiguriere. Ich vermute, es liegt daran, dass ich ein anderes Zertifikat für den Mailserver verwende. Wie könnte ich dasselbe Zertifikat für beide Container verwenden?

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 „Gefällt mir“

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.