Use aliases in iRedMail for categories with incoming email feature enabled

:mega: WARNING – this topic is very specific to a particular rare use case and is likely not what you should be doing. Refer to the first two links, below, for the recommended setup.


I searched the forum for a clear article on how to setup a ticket system using Discourse and found some brilliant topics:

  1. Configure incoming email to create new topics or group messages
  2. Use Discourse as a Private Support/Ticket System


Unfortunately, I am not enough familiar with some mail server features, and I don’t know how to configure the support of or How does it work at all, omg? :man_facepalming:

How can I use multiple emails assigned to different categories? How does it work if the forum settings support only one email address?

Yes, it works perfectly. Based on those two howtos I understood the principles of incoming emailing and proper forum settings. As previously mentioned, the main in mail server’s forwarding feature.

Basic fully-functional mail server

For those who want to setup a zero-cost mail server I recommend iRedMail

  • Here it is an article to setup a mail server based on ubuntu + postfix + iredmail in English
  • here the same for centos in Russian

Mail aliases

After a default installation, you get mail server ready to connect to Discourse. Follow steps 1 and 2 above and next steps how to use mail aliases in iRedMail.

For example, you created mailbox and two categories:

feature -> internal [private]

You need to use your mailbox credentials in pop polling settings.

Connect to your server shell, use user postgres and connect to the database (I use postgres):

sudo su - postgres

Then switch to vmail schema and create two aliases:

postgres=# \c vmail
postgres=# INSERT INTO alias (address, domain, active)
VALUES ('', '', 1);

postgres=# INSERT INTO alias (address, domain, active)
VALUES ('', '', 1);

Next step you create forwardings:

postgres=# INSERT INTO forwardings (address, forwarding,
                              domain, dest_domain,
                              is_list, active)
VALUES ('', '',
'', '', 1, 1);

postgres=# INSERT INTO forwardings (address, forwarding,
                              domain, dest_domain,
                              is_list, active)
VALUES ('', '',
'', '', 1, 1);

postgres=# \q OR CTRL+D to exit

You may check two tables, aliases and forwardings in your favorite DB manager:

Pay attention to active key, it must be 1.

Check settings

Assign email aliases to categories and sent email from the email of your registered user. If necessary, you may allow anonymous emailing and auto-creating staged users by the following settings:


  • Accept emails from anonymous users with no accounts (optional, category setting)
  • enable staged users (if true, check approve unless staged as well )
  • pop3 polling enabled = true
  • pop3 polling host (your host FQDN)
  • pop3 polling port (usually 995)
  • pop3 polling username (
  • pop3 polling password
  • pop3 polling delete from server (optional, I leave as disabled to have the original message in my mail client)
  • log mail processing failures (optional, because you can monitor all events at Emails tab)
  • email in = true
  • email in min trust (I use 0 at first after starting my forum, also check clean up inactive users after days)
  • email prefix (optional, if your site title has CAPSED name, it may add spam score to auto-replies)
  • enable forwarded emails (optional, it is still BETA in 2.4.0beta2, sometimes it cannot find email body)

Check incoming emails

Send emails to your aliases and check:


Now all emails sent both to, OR will put into one mailbox The difference is - mails sent to feat@ will be processed by feature category, mails sent to staff@ will be processed by internal.

Ensure that new topics have appeared! :sunny:

Some notes

  • Even you assign primary email master@ to some public or private category, all emails will be processed in the right way (no duplicates, no reveal privacy)
  • The setting min topic title length does not affect the length of email subject.

The one I recommend is Straightforward direct-delivery incoming mail. You don’t need to configure much more than a couple things to set it up and after that you can just use whatever email addresses for groups or categories and it will Just Work.


Thanks for sharing @pfaffman, I did not find that topic. I am old-school guy, therefore I trust the proven schemes used in production. I just suggest rather fast and stable solution. Also I did not find any mention of word alias in relevant search results. So let it be in this howto).

1 Like

To each his own, but for handling incoming mail to Discourse a container running Postfix is a pretty proven solution. It’s hard to imagine that iRedMail could be faster or more stable, if only because iRedMail includes a bunch of components that you don’t need if all you want to do it get mail delivered to Discourse.

This topic is OK but highly specific to your rather unusual use case. I’m adding a warning to the top of the topic to that effect.