Configure direct-delivery incoming email for self-hosted sites with Mail-Receiver

On my dedicated server (running Ubuntu 22.04, with Postfix installed) I use a separate mail-receiver.yml paired to each instance of Discourse where I have enabled the mail-in posting feature.

This setup creates a separate container for each instance of Discourse on my server (alongside the typical app container) which receives and processes the e-mails for its corresponding Discourse instance.

Incoming emails for all of the Discourse forums on the server are received by Postfix through the standard port 25, where the main Postfix configuration file uses a “transport map” to “relay” each email to its intended Discourse forum by parsing out the domain name in the email’s “To:” address.

So, in addition to the instructions of this Topic, I…

  1. modified the existing postfix configuration file at: /etc/postfix/main.cf

  2. then, I added the corresponding postfix transport map file at: /etc/postfix/transport

  1. lastly, I added the corresponding files to create the email container for each of the forums:
    /var/discourse/containers/mail-receiver-domain1.yml
    /var/discourse/containers/mail-receiver-domain2.yml
    /var/discourse/containers/mail-receiver-domain3.yml
    /var/discourse/containers/mail-receiver-domain4.yml
    /var/discourse/containers/mail-receiver-domain5.yml

2 Likes