Version 1 (modified by lucid, 4 years ago) (diff)

New hack MailArchivePlugin, created by lucid

Email archive for storing emails in Trac


This plugin adds a new main menu item Mail Archive that can be used to browse and view archived emails and email attachments.


  • Import emails to Trac's database from an IMAP account
  • A new mailarchive resource realm
  • mailarchive: wiki links (plus mail:, email:, and emailarchive: synonyms)
  • [[MailQuery(searchterm)]] macro
  • New trac-admin mailarchive fetch command
  • New Trac permission MAIL_ARCHIVE_VIEW
  • Trac Search integration

Bugs/Feature Requests

Existing bugs and feature requests for MailArchivePlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from here.


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


Installation of the plugin requires the usual step, e.g. easy_install and enable it in Trac's plugin admin page or by adding mailarchive = enabled to the [components] section in trac.ini.

A database upgrade will be required as usual (trac-admin path-to-your-trac-environment upgrade).

Assign the new MAIL_ARCHIVE_VIEW permission to the appropriate Trac groups / users (e.g. in Trac's permission admin page).

Additionally you need an email IMAP account that only contains all the emails you want to archive. If you don't already have this, you could create a new separate email account (e.g. and copy all emails you want to appear in Trac's mail archive to that account.

Actually archiving the emails from that IMAP account into Trac's database must be done separately using a new trac-admin mailarchive fetch <host> <username> <password> command. You should configure (e.g. using a cron job in Unix, or using a scheduled task in Windows) it to be periodically called. Replace <host>, <username> and <password> with your email host, username and password.

Example: Schedule a task to call the following command every 15 minutes: trac-admin path-to-your-trac-environment mailarchive fetch password123

Make sure that the emails to be archived are marked as unseen / unread (or very recent, i.e. from today) as only such mails will be considered for archiving.

Recent Changes

16717 by lucid on 2017-07-23 20:00:02
MailArchivePlugin: Fix attachment filenames.
(see #13243)
16565 by rjollos on 2017-05-01 01:40:27
Fix indentation
16138 by lucid on 2016-12-21 21:19:56
MailArchivePlugin: Bump version to 1.1
(see #13005)


Author: lucid
Maintainer: lucid

Attachments (2)

Download all attachments as: .zip