Patch #8257

Proposal for supporting project-specific wildcard addresses in default mail handler

Added by Marcus Ilgner about 9 years ago. Updated almost 2 years ago.

Status:ClosedStart date:2011-04-30
Priority:NormalDue date:
Assignee:johann sebatian% Done:


Category:Email receiving
Target version:-


While I saw that there's a python script to support project-specific email address extensions, I propose a simple change to the default Ruby mailhandler script. The python script exited with some error message I couldn't quite follow and anyway chaining two scripts seemed to be somewhat inefficient to me.
I just hacked this the quick and dirty way, so the regex is a bit rough around the edges, but it should do the job. At least it's working great on my setup.

>     m = email.match(/To: .*<.*-(.*)@/)
>     issue_attributes['project'] = m[1] unless m.nil?

This will automatically assign any mail to redmine-[yourproject] to the project [yourproject].

I thought about extending it even further so that one can write mails to redmine-yourproject-feature to have it assign the ticket to the 'feature' tracker.

Related issues

Related to Redmine - Patch #20732: MailHandler: Select project by subaddress (redmine+projec... Closed


#1 Updated by Marcus Ilgner about 9 years ago

Ok, improved regex with support for specifing tracker as well as project (as long as one doesn't use dashes in the project name, I suppose...)

>     m = email.match(/^To: [^-]+-([^-]+)(?:-([\w]+))?@/)
>     issue_attributes['project'] = m[1] unless m.nil?
>     issue_attributes['tracker'] = m[2] unless m.nil? || m[2].nil?

#2 Updated by johann sebatian about 9 years ago

  • Assignee changed from Marcus Ilgner to johann sebatian

#3 Updated by Go MAEDA almost 2 years ago

  • Status changed from New to Closed

You can select a project by subaddress since Redmine 3.2. It means that you can use email addresses like this: See #20732 and RedmineReceivingEmails for details.

#4 Updated by Go MAEDA almost 2 years ago

  • Related to Patch #20732: MailHandler: Select project by subaddress ( added

Also available in: Atom PDF