Thunderbird extension for external archival of mails

I wrote a small and rudimental extension for the thundbird email client. The intention is to be able to archive emails with an external application outside of thunderbird.

The extension does basically the following:

  1. Save the selected msg in a temporary folder in the filesystem in eml format (meaning the mail as is)
  2. call an external application (or wrapper script) from inside thunderbird with the temporary filename as parameter

You can download the source and use it as template for your own archival solution. I have intentionally not generated a XPI package, because you have to alter the source anyway. If you don’t want to generate a XPI yourself, you can do a developer install of the extension. Just unzip it in a folder of your choice, e.g. c:\tbmailarchival. Then activate it in thunderbird by creating a file called tbmailarchive@georglutz.de in the directory extension of your profile directory. In tbmailarchive@georglutz.de you have to write the path of the extension directory.

In order to use the extension you have to alter at least extCmd and extArgs of content/overlay.js to match your external archival script. After a restart of thunderbird there is a menu entry “Archiv”in the context menu of the message thread pane:

Screenshot of the extension entry in the context menu

In the archive there is also the windows scripting host script mailarchiv.js. Its a sample archival script which simply copies the mail to a central repository.