# How to get Discourse to work with Postfix

**URL:** https://meta.discourse.org/t/how-to-get-discourse-to-work-with-postfix/160602
**Category:** Self-hosting
**Created:** [August 12, 2020, 9:13am UTC](https://meta.discourse.org/t/how-to-get-discourse-to-work-with-postfix/160602 "2020-08-12T09:13:38Z")
**Posts on this page:** 1
**Showing post:** 18

<div class="post-metadata">

### Author: ![sonmicrosystems](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sonmicrosystems](https://meta.discourse.org/u/sonmicrosystems)
#### Post date: [November 4, 2021, 10:08am UTC](https://meta.discourse.org/t/how-to-get-discourse-to-work-with-postfix/160602/18 "2021-11-04T10:08:49Z")

</div>

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:

1. Set a A record to point to your new server, says `forum.domain.com`

2. install postfix, set `forum.domain.com` as `myhostname` and add `172.17.0.0/16` to `mynetworks` so Discourse container can talk with Postfix without authentication. `172.17.0.0/16` is the default network used by Docker containers.

3. Make sure postfix can sending out emails. I prefer using `swaks`

4. In `containers/app.yml`, make sure to comment out the 3 lines for `DISCOURSE_SMTP_USER_NAME`, `DISCOURSE_SMTP_PASSWORD` and `DISCOURSE_SMTP_ENABLE_START_TLS`

5. To test, you can connect to the Discourse container by `docker exec -it app bash` and run:

6. Restart discourse with `./launcher rebuild app`. You should now be able to create new account and receive verification email.

---

_[View the full topic](https://meta.discourse.org/t/how-to-get-discourse-to-work-with-postfix/160602)._
