Email-in Filtering or Multiple Emails per Category/Group

Summary

Allow admins to create filters for incoming emails, or allow more than one email to post to a category/group.

Description

Sometimes a 1:1 map of an email address to a category or group is inconvenient. Sometimes, a sender will insist on using an email that is not appropriate to your setup (e.g., because its usage pre-dates your setup, or because they stubbornly use the wrong email despite your attempts at regularizing their behavior).

In such cases, two approaches can co-exist:

  1. Allow multiple emails to arrive at a single place (category or group)
  2. Allow automatic filtering of incoming email to enable re-categorization based on criteria (Subject, From, etc.)

Use-Cases

Invoices

You have set up a category to receive invoices via invoice@example.net, but some providers send their invoices to contact@example.net. Having a filter on the Subject field + attachment present would ensure all your incoming invoices go to the same place, where your accountant can see them.

Too much spam

Your contact@example.net became way too public, and your contact group starts being the target of spam. You could add a transitional contact-A4B6C23@example.net address and start moderating everything that comes from the former address. Then you can rotate contact addresses to make it harder for spammers to reach your inbox.

Multiple domains

You’re using multiple domains and would prefer that your users coming from example.org use that domain instead of wildly-different.example domain that might confuse them. Or you’ve been using two domains and want to consolidate and use only one. Adding category@example.org to your existing category@wildly-different.example incoming address would solve both cases.

1 Like

If you’re willing to filter on subject or contents rather than to-address, I think your first use case might be something that Discourse Automation could handle. Have a hidden “incoming mail” category and a trigger which fires the script when there is a new post there. That script would have your custom rules and based on those move the message to the right category (or tags!)

The second and third seem like they might be better handled by an email forwarding service external to Discourse.

Thank you @mattdm. I will look into Discourse Automation.

I don’t think having an extra category would help, as it would certainly complicate things.

Email forwarding may or may not work, since email-in will detect the original email instead of the forwarded address in most cases.

Discourse Automation might work, but requires a bit of knowledge to make these use-cases work. Let’s see:

  1. When Group A receives an email
  2. If the sender is foo@bar AND the Subject starts with INVOICE
  3. Tag topic with ‘invoice’
  4. Move topic to category X
  5. End of filter.

Can someone translate this into Discourse Automation?