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.comasmyhostnameand add172.17.0.0/16tomynetworksso Discourse container can talk with Postfix without authentication.172.17.0.0/16is the default network used by Docker containers. -
Make sure postfix can sending out emails. I prefer using
swaksswaks -t your_name@gmail.comYou 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_PASSWORDandDISCOURSE_SMTP_ENABLE_START_TLSand set
DISCOURSE_SMTP_DOMAINto 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 bashand run:apt update apt install -y swaks swaks -t name@gmail.com --server forum.domain.comYou 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.