Saturday, April 16, 2011

Thunderbird hack: Domain Specific Move

One of the most frequent actions in Thunderbird is to move a message that I received from a business partner or customer to a message folder for exactly this partner/customer. Same for messages I sent to them.

However, as you communicate with more customers and partners, the folder hierarchy will become more complex and I already need about 6 clicks to select the specific folder.

Sometimes I'm lucky and it is the most recently used folder, then I can do it with the "move again" function directly in the context menu; sometimes, it is at least in the recent folder menu, still 3 clicks.

WIBNI if TB could just remember that I always move messages from domain A to the folder X, lets say from "" to folder "/Vendors/IBM" or something like that, and then present me with a one-click option on the menu.

So I wrote an add-on for this and called it "Domain Specific Move".
It does exactly what I described.

I find the most frequently used domain in the email (counting all from sender, recipient, cc-list).
If I already find a setting for this, I create an additional menu item in the move message menu for a move to this folder.

If not, I present a "learn" menu item, that lets you train the extension on where to put mails for this extension (i.e. register a folder for this domain). You pick the destination folder yourself. No magic included there.

Once I thus learned and stored the folder for this domain, I can - next time this domain appears - present the "Move to " menu item as above.

Configuration is stored in the preferences under "extensions.domainmove.".
Currently I have no options page for this, so if you want to change or remove an entry, you have to go to the prefs.js file or the about: dialog.

Yes, I know, filters can do the same; but when I select to manually run the filter, it will not tell me what exactly it is up to... The beauty of my approach (IMHO) is, that I see it on the menu and can decide otherwise, because not always does the folder registered for this domain really match.

In essence this is only a short cut with an educated suggestion. No behind-the-scenes magic.

  • more flexibility with domains with more than 2 parts (e.g. should map to if there is no
  • unlearn domains (without going to the about: dialog)
  • option for domains-to-ignore; currently I ignore non-specific domains as,,,, [1].
  • ignore "my" domain (see comment re
Available for TB3+ only.

I will polish the code and implement some of the above todos, then I will post the first beta.

[1] well for me as an former Sun and now Oracle employee, all emails contain either an or address and this domain contains no information on where to archive the email.


Max said...

Ever looked at "Nostalgy" plugin for Thunderbird?

Roman said...

@mhantsch: not yet, but it looks cool; will try it
thx for the hint