Hostname não corresponde ao certificado do servidor (Let's Encrypt)

Olá, tenho um problema com o recebimento do e-mail de ativação após a instalação do Discourse.

Meu processo:

Atualmente não possuo um servidor de e-mail, então quis executar o servidor de e-mail e o Discourse na mesma máquina. Decidi usar o docker-mailserver. Solicitei um VPS a um provedor alemão e estou usando um domínio da Namecheap que não utilizava mais.
Como não quero que este domínio seja público, substituí-o por “domain.com” abaixo. Espero que isso esteja correto.

  1. Servidor de e-mail: Instalei o servidor de e-mail, criei alguns endereços de e-mail com o setup.sh, gerei chaves DKIM e criei um registro TXT correspondente no meu provedor de DNS. Testei os endereços com o Thunderbird e consegui enviar e receber e-mails sem problemas. O Telnet também retorna 220, então tudo parece estar correto.
    Aqui está uma captura de tela dos registros DNS:


    Resultado do SSL-Tools:
    Imgur: The magic of the Internet

  2. Discourse: Instalei o Discourse seguindo o Guia de instalação Docker para iniciantes .
    Executei o discourse-setup e inseri os seguintes dados:

    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
    

Em seguida, prossegui para enviar o link de ativação para dun@domain.com, mas ele nunca chegou.

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

Não entendo totalmente o que isso significa, pois é a primeira vez que estou configurando o TLS. Acredito que seja porque estou usando um certificado diferente para o servidor de e-mail. Como posso usar o mesmo certificado para ambos os contêineres?

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 curtida

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.