Configure the new install discourse SMTP Email with Mailgun on AWS Lightsail server

Dear all,

I got an issue with my new install discourse server at the email invitation for admin account setup.

I follow the troubleshooting as this guide here but still not figuring what I am missing https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326

My setup as follow:
Server on AWS Lightsail open port 22, 443, 80 - Ubuntu 20.04 - 2GB
Mailgun has credit card applied, verified DNS with SMTP sending account
test with the command below:

./discourse-doctor

I got the message below:

SMTP server connection successful.
Sending to info@mysite.com. . .
Mail was not sent.

Reason: 501 Invalid command or cannot parse from address

I also double checked this settings with YML

DISCOURSE_HOSTNAME=forum.mysite.com
SMTP_ADDRESS=smtp.mailgun.org
DEVELOPER_EMAILS=info@mysite.com
SMTP_PASSWORD=84af596*********
SMTP_PORT=587
SMTP_USER_NAME=postmaster@forum.mysite.com
SMTP_DOMAIN_NAME=mysite.com

Thanks so much for your help
Cheers,
Quang

What is your discourse_notification_email set to?

Hi @itsbhanusharma,

Thanks for jumping in.

I set my DISCOURSE_NOTIFICATION_EMAIL: hi@mysite.com,mymail@gmail.com
and my DISCOURSE_DEVELOPER_EMAILS: 'info@mysite.com,hi@mysite.com,mymail@gmail.com

Cheers,
Quang

Yup, there lies the problem.

You first need to remove that gmail address and set it to something like noreply@forum.mysite.com so that it can be served by mailgun.

The discourse_notification_email is an out only address used to send emails from discourse and it can not be multiple addresses afaik.

1 Like

Awesome @itsbhanusharma. Thanks so much. That exactly solved my issue.

  • Solution note for anyone in the future if facing with the same issue:
1 Like

Aren’t those the defaults offered by Discourse-setup?