Version 3 (modified by anonymous, 6 years ago) (diff)


Pluggable email handler for Trac


provides a command line script and extension point that allows email messages to be handled by Trac plugins. This ticket provides a command-line script, mail2trac which may be called by an MTA (e.g. postfix) to open a Trac environment and run through each enabled IEmailHandler and executes its invoke() method if its match() method returns True. If invoke returns an email message, then subsequent IEmailHandlers will also process the message. If None is returned, then the message is consumed and execution stops.

To enable the plugin for postfix, add an appropriate line to the aliases file (usually /etc/aliases or /etc/postfix/aliases and then refreshing the aliases database (see man aliases). The mail2trac script takes a -p command line argument for the path to the project environment. The incoming email address should equal

smtp_replyto =

in the trac.ini file.

As an example, if smtp_replyto is set to and the project is in /var/trac/bar, the aliases file on should have a line like

foo: "|/path/to/mail2trac -p /var/trac/bar"

Bugs/Feature Requests

Existing bugs and feature requests for MailToTracPlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


You can check out MailToTracPlugin from here using Subversion, or browse the source with Trac.


email2ticket is an example IEmailHandler plugin to convert an email message to a ticket.

Recent Changes

[10898] by zitune on 2011-11-10 14:29:33
should improve python2.4 compatibility, see #9527
[10884] by zitune on 2011-11-07 10:13:16
mail2trac adapt according to encoding in header
[10883] by zitune on 2011-11-04 17:44:08
correction after bad merging


Author: k0s