Configuração do Gmail SMTP Relay não está funcionando

Hi Folks,

I’ve installed discourse on an Ubuntu 18.04 by this guide (it’s with Ubuntu 16.04, but I think its quite the same):

Then I setup the email configuration like here discribed:

Note: It dont worked for me to apply just a IP range, only full IP-Address worked.

But I still dont get emails working. When I do the doctor test, it says:

==================== MAIL TEST ====================
...
...
SMTP server connection successful.
Sending to info@likamundi-lernen.de. . . 
Sending mail failed.
Replacing: SMTP_PASSWORD
Replacing: LETSENCRYPT_ACCOUNT_EMAIL
Replacing: DEVELOPER_EMAILS
Replacing: DISCOURSE_DB_PASSWORD
Replacing: Sending mail to

==================== DNS PROBLEM ====================
This server reports NOT FOUND, but discourse.likamundi.de reports Discourse 2.4.0.beta2 .
This suggests that you have a DNS problem or that an intermediate proxy is to blame.
If you are using Cloudflare, or a CDN, it may be improperly configured.

I also tried to set “Allowed senders” in the gmail suite to “all”, but that also not helped.

And of curse, if I try to setup the admin account, I just dont get a mail…

Can anybody help me here, cant be possible that thats so hard to setup ^^

Kind regards,
Zacharias

Relaying through Gmail is a violation of their Terms of Service, so we do not support it. We recommend using a service like Mailgun.

Hmm. So maybe you’ve got a reverse proxy? Since

You’re in good shape there.

If you’re paying for Gsuite (and not Gmail) it’s not a violation of their TOS to have Discourse send mail, but it’s still a huge pain and you can’t get much help here. If you have a credit card your life will be much easier if you go with Mailgun (or similar).

Provavelmente é um pouco tarde para ajudá-lo aqui, mas posso confirmar que é possível usar o relay SMTP do GSuite para enviar seus e-mails do Discourse.

A seguir está uma configuração para usar o relay SMTP (nas configurações do aplicativo do Gmail) sem autenticação (apenas endereço IP). Primeiro, como você disse, você precisa configurar as opções do aplicativo para “Aceitar apenas e-mails dos endereços IP especificados”, adicionando os endereços do seu servidor Discourse.

A configuração no lado do Discourse é então –

DISCOURSE_SMTP_ADDRESS: smtp-relay.gmail.com      
DISCOURSE_SMTP_PORT: 587                        
DISCOURSE_SMTP_USER_NAME:    
DISCOURSE_SMTP_PASSWORD:     

A coisa principal, e o que me confundiu por uma hora ou mais, é que você precisa especificar as variáveis de nome de usuário e senha, mas deixá-las em branco. Qualquer outro valor (none, ‘’, etc.) não funcionará.

Não, isso não funciona. E sem má intenção, é uma ideia terrível de plataforma exigir tanto domínios quanto servidores de e-mail, pois ao alterar o DNS na maioria dos provedores de domínio, o servidor de e-mail local deles é prejudicado. Estou tentando instalar isso há 4 horas.

Obrigado pela solução alternativa! Posso confirmar que funciona :slight_smile:

Isso funcionou para mim agora mesmo