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: 145
Joined: Jan 04, 2017 12:41 pm

Enhancement: way to use regexp to parse project destination

Post by mushu » Oct 24, 2017 5:12 pm

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: 576
Joined: Jul 06, 2011 9:17 am

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

Post by SL-Gundam » Oct 24, 2017 8:55 pm

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: Aug 24, 2015 6:37 am

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

Post by cproensa » Nov 03, 2017 2:01 pm

> 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: 180
Joined: Feb 13, 2006 9:53 pm
Location: USA
Contact:

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

Post by Starbuck » Nov 08, 2017 4:57 pm

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: 576
Joined: Jul 06, 2011 9:17 am

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

Post by SL-Gundam » Nov 08, 2017 5:11 pm

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