Mailhandler Frontend for SubAddressing

This page was written for early versions of Redmine. In Redmine 3.2 and later, you can enable sub-addressing with "--project-from-subaddress" option of rdm-mailhandler.rb (#20732). See Receiving emails.

When using rdm-mailhandler.rb, one thing that can be very useful is having a single email address to enable multiple projects without having to override the project all the time in the email body. This is possible using the subaddress format as defined in the following RFCs:

RFC 3598
RFC 5233

How it works

The subaddress is separated from the real address using the "+" sign, so for example, the email:
will become

Compatible MTAs will still send these emails to the <> recipient, and it is up to that recipient to make good use of the subaddress portion.

The script is a front-end for rdm-mailhandler.rb that reads the header of the email, looks for a subaddress and then launches rdm-mailhandler.rb with the specified project, or the default project if specified. It can literally be "inserted" in front of the command line.


Usage: -h | -e <email> [ -p <project> ] -- <command-line>

The <command-line> portion is the full rdm-mailhandler.rb command that would
normally be executed as the mail handler. The full path to the executable is
required. This command should not include a project; use the build-in
--project argument instead.

  -h, --help            show this help message and exit
  -e EMAIL, --email=EMAIL
                        Known email to look for (i.e. redmine recipient)
  -p PROJECT, --project=PROJECT
                        Default project to pass to rdm-mailhandler.rb if there
                        is no subaddress


Lets say you have this .forward file:

"|/home/redmine/rdm-mailhandler.rb --url --project myproject --allow-override project,tracker,category,priority,status --key xxxxxxxxxxxxxxx"

You always have to provide the recipient email, and in this case you would have to move the default project argument to Everything else is copied verbatim:

"|/home/redmine/ --email --project myproject -- /home/redmine/rdm-mailhandler.rb --url --allow-override project,tracker,category,priority,status --key xxxxxxxxxxxxxxx"

Now, you can still send email to <> and have the default project (and override it). However if you want to send an email for "projectx", then you cen send it to <> and the project will be set accordingly.


This script and wiki page have been originally written by Thomas Guyot-Sionnest <> Magnifier - Frontend for rdm-mailhandler.rb (4.11 KB) Thomas Guyot-Sionnest, 2010-07-14 23:59 Magnifier - Frontend for rdm-mailhandler.rb (3.97 KB) Thomas Guyot-Sionnest, 2010-07-30 04:48 Magnifier - Frontend for rdm-mailhandler.rb (v.1.0.2) (4.07 KB) Thomas Guyot-Sionnest, 2011-11-10 06:29