Enhancement: way to use regexp to parse project destination

This plugin allows you to report an issue in MantisBT by sending an email to a particular mail account

Moderators: Developer, Contributor

Post Reply
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Enhancement: way to use regexp to parse project destination

Post by mushu »

Is there a way to use a regular expression to parse the email subject line in order to put the new Mantis ticket into the correct Project automatically when the email is parsed? Instead of using a new email address for EVERY project we have, we would like to use a single email address and have the plugin parse through the subject based on a regexp and locate the correct Project to use. Can this be done now or is it a future enhancement request only?
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Enhancement: way to use regexp to parse project destinat

Post by SL-Gundam »

In the future this should be possible. We have a rule system in development... but it has been for years now so it might still be years before it is finished.

Currently you have 2 options to get what you want
  1. Use IMAP and mail rules to route emails into proper folders. You will need to use "Create project subfolder structure"
  2. Modify EmailReporting yourself as required to get the desired result
cproensa
Posts: 8
Joined: 24 Aug 2015, 11:37

Re: Enhancement: way to use regexp to parse project destinat

Post by cproensa »

> Use IMAP and mail rules to route emails into proper folders

Yes, this works great. This is how i use it:
there is a configured gmail account, eg: bugreport@xxx
with said option, a new label (gmail approach for imap folders) is created for each project
configure rules based on "to: address" using pattern "bugreport+projectalias@xxx", so it moves to a specific project label
then sending the email to the address "bugreport+project1@xxx" will make the plugin to create the issue in "project 1"
Starbuck
Posts: 219
Joined: 14 Feb 2006, 02:53
Location: USA
Contact:

Re: Enhancement: way to use regexp to parse project destinat

Post by Starbuck »

cproensa wrote: Yes, this works great. This is how i use it:
there is a configured gmail account, eg: bugreport@xxx
with said option, a new label (gmail approach for imap folders) is created for each project
configure rules based on "to: address" using pattern "bugreport+projectalias@xxx", so it moves to a specific project label
then sending the email to the address "bugreport+project1@xxx" will make the plugin to create the issue in "project 1"
I'm looking at exactly this today! Thanks for the discussion.
I didn't know that a TO: of user+label will send the mail item to the label folder for user. Am I reading that correctly? Is that supposed to work for all IMAP servers?

Your "routing" is also something that has eluded me: how did you map folder "project1" to "project 1" (with the space)? I know extra spaces are removed from project names. In my IMAP server it doesn't allow me to set a filter to (freeform-entered) folder names with embedded spaces. So I need to somehow relate new constricted IMAP folder names to the project names in MantisBT.

Thanks!
SL-Gundam
Posts: 722
Joined: 06 Jul 2011, 14:17

Re: Enhancement: way to use regexp to parse project destinat

Post by SL-Gundam »

Every IMAP server is different. Gmail is really something special since labels are interpreted as folders.
The rule system a mail server supports is also different for every mail server since its not related to IMAP or POP3 protocols and therefore not standardized. Some mail servers have a simple rule system, some advanced, some don't have a rule system at all. If there isn't a rule system available on the mail server, usually the mail client is responsible for this task. But the EmailReporting mailbox is often not accessed with an actual client so we are are fully dependent on the mail server to provide this functionality

Usually the rule would look something like this

Code: Select all

If emailaddress = bugreport+project1@xxx then move email to folder "project 1"
So you would need to create a rule for every project folder that EmailReporting creates for you.

What mail server software are you using?
Post Reply