SMTP setup not working with GMail's smtp-relay

I can’t get SMTP setup working with Discourse and GMail’s SMTP

I enabled SMTP Relay in Google’s settings, allowed sending from my domain (no IP whitelisting), using SMTP auth + encryption.

Discourse is hosted on forum.mydomain.io

DISCOURSE_SMTP_ADDRESS: smtp-relay.gmail.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: noreply@mydomain.io
DISCOURSE_SMTP_PASSWORD: password
DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_DOMAIN: mydomain.io
DISCOURSE_NOTIFICATION_EMAIL: noreply@mydomain.io
DISCOURSE_SMTP_ENABLE_START_TLS: true

I had generic error Job exception: end of file reached, when I added NOTIFICATION_EMAIL and SMTP_DOMAIN envs, now I’m seeing

503 5.5.1 bad sequence of commands x20sm63393lfr.126 - gsmtp

when running doctor and trying to send email to myself.

Changed DISCOURSE_SMTP_DOMAIN to match forum.mydomain.io and still have the same error.

How I’m supposed to debug this further other than changing env, rebuilding and hoping that it works?

Thanks in advance.

Instead of rebuilding you can

./launcher destroy app 
./launcher start app 

There are some topics about getting the Google whatever working. It’s possible, but not easy. And it probably changes every month. :wink:

1 Like