SMTP issue with Postfix

I installed Discourse on Ubuntu 18.04, also installed Postfix for SMTP email but Discourse is not sending any email. I’m not able to register admin account. Could anyone help me please on this.

Followed instruction from this.
https://meta.discourse.org/t/emails-with-local-smtp/23645/13

If I use below command to send email then I’m getting emails. It means Postfix is working.

echo "This is the body of the email" | mail -s "This is the subject line" user@example.com

Here is SMTP section from my /var/discourse/containers/app.yml

#TODO: The SMTP mail server used to validate new accounts and send notifications
#SMTP ADDRESS, username, and password are required
#WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
DISCOURSE_SMTP_ADDRESS: 33.165.221.244
#DISCOURSE_SMTP_PORT: 587
#DISCOURSE_SMTP_USER_NAME: 
#DISCOURSE_SMTP_PASSWORD: ""
#DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

Am i missing something here for SMTP settings??

has anyone faced this kind of issue? any help on this? thanks!

I’m guessing this is the IP of the server on which Discourse is running, and you also have a local SMTP server?

From inside the container can you connect to 33.165.221.244 port 25?

If not, you may have better luck using the host’s IP address of the docker0 bridge instead of the public IP. Can you connect to the host’s docker0 IP on port 25 from the container?

4 Likes