SMTP issue with Postfix

AI-generated summary

SMTP issue with Postfix

User satish is experiencing issues with Discourse sending emails via Postfix on Ubuntu 18.04. Despite following instructions from this guide and Postfix working with the mail command, Discourse is not sending emails. satish has provided their SMTP settings from the /var/discourse/containers/app.yml file.

supermathie suspects the issue might be related to the IP address used in the SMTP settings, suggesting that the IP 33.165.221.244 might be the server’s public IP and not the local SMTP server’s IP. supermathie recommends checking if the container can connect to the host’s docker0 IP on port 25 instead of the public IP.

satish is seeking help on this issue.

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?