Using Postfix with Discourse

So I installed Postfix in my server with discourse (I know its not suggested).
My Postfix works fine and I send email with it.

The issue is with Discourse/docker not wanting to send email (can’t even get the admin activation)

I read that:

  1. It is a docker issue
  2. You shouldn’t have postfix in the same server
  3. I will be put in the spam box pretty fast

What are you guys using as an smtp server?

Postfix and Discourse are perfectly compatible so I suggest you change the title of your topic accordingly :wink:
You probably have a configuration issue.

If you configure everything right then you will deliver everything straight into inbox.


I tried every configuration in the book.

For my postfix /etc/postfix/

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = discourse-mydomain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = discourse-mydomain,, discourse-mydomain, localhost.localdomain, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128,,
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces =
inet_protocols = all
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual

I actually even changed the inet_interfaces to match my docket container.


Don’t see where the config is wrong. any ideas?

Welcome to the forum, @cmoi! Glad to have you here. :wave:

I find and to be pretty solid.

Does anyone know where is my mail logs sent by Discourse?

Maybe you can start by telling us what your actual problem is instead of “does not work”…

  • What are you doing? (please be verbose)
  • What is your expected outcome?
  • What is happening instead?
  • Do you see any error messages?
  • Is there anything else worth telling us?

I actually gave up and took Amazon SES instead.

1 Like

Hey There,

Running into a similar issue with a Bitnami docker container of Discourse. The emails just aren’t sending.
Here is the error I’m getting:
There was a problem sending the test email. Please double-check your mail settings, verify that your host is not blocking mail connections, and try again.

Here are my SMTP settings:

Delivery Method
port 465
user_name apikey
authentication login
enable_starttls_auto true

Any guidance on where I need to look/troubleshoot next?

Edit: Have tried 587, plain authentication method, different apikey/password. Have setup this on other apps no problem with similar settings.

Expected outcome is for the email to send from Discourse to the inbox of the test account.


Yes. Follow the Discourse official Standard Installation and see if the problem persists.

EDIT: it’s also possible that your VM is blocking port 465. You might try 2525 (not sure if sendgrid supports that, but they probably do).