After some trials and errors, I’ve been able to make Discourse work with Postfix. Here are steps that I’ve used, hope they can be helpful:
-
Set a A record to point to your new server, says
forum.domain.com
-
install postfix, set
forum.domain.com
asmyhostname
and add172.17.0.0/16
tomynetworks
so Discourse container can talk with Postfix without authentication.172.17.0.0/16
is the default network used by Docker containers. -
Make sure postfix can sending out emails. I prefer using
swaks
swaks -t your_name@gmail.com
You should receive an email “This is a test mailing”.
-
In
containers/app.yml
, make sure to comment out the 3 lines forDISCOURSE_SMTP_USER_NAME
,DISCOURSE_SMTP_PASSWORD
andDISCOURSE_SMTP_ENABLE_START_TLS
and set
DISCOURSE_SMTP_DOMAIN
to theforum.domain.com
(make sure to replace by your domain name here) -
To test, you can connect to the Discourse container by
docker exec -it app bash
and run:apt update apt install -y swaks swaks -t name@gmail.com --server forum.domain.com
You should receive an email “This is a test mailing”.
-
Restart discourse with
./launcher rebuild app
. You should now be able to create new account and receive verification email.