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.
Prerequisities
I searched the forum for a clear article on how to setup a ticket system using Discourse and found some brilliant topics:
- Configure incoming email to create new topics or group messages
- Use Discourse as a Private Support/Ticket System
Questions
Unfortunately, I am not enough familiar with some mail server features, and I don’t know how to configure the support of reply+mailbox@server.com
or somerandomcode+mailbox@server.com
. How does it work at all, omg?
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 master@server.com
and two categories:
feature
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):
ssh login@server.com
sudo su - postgres
psql
Then switch to vmail
schema and create two aliases:
postgres=# \c vmail
postgres=# INSERT INTO alias (address, domain, active)
VALUES ('feat@server.com', 'server.com', 1);
postgres=# INSERT INTO alias (address, domain, active)
VALUES ('staff@server.com', 'server.com', 1);
Next step you create forwardings:
postgres=# INSERT INTO forwardings (address, forwarding,
domain, dest_domain,
is_list, active)
VALUES ('feat@server.com', 'master@server.com',
'server.com', 'server.com', 1, 1);
postgres=# INSERT INTO forwardings (address, forwarding,
domain, dest_domain,
is_list, active)
VALUES ('staff@server.com', 'master@server.com',
'server.com', 'server.com', 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 (
master@server.com
) - 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:
/admin/email/received
/admin/email/rejected
Now all emails sent both to master@server.com, feat@server.com OR staff@server.com
will put into one mailbox master@server.com
. 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!
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.