Per folder mail notification in Thunderbird

| Comment | No TrackBacks

I've long relied on the notification area (aka system tray) notification feature of Thunderbird to inform me of new mail. Its main weakness is that it notifies of any new mail which in my case means its triggered by list mail which arrives constantly throughout the day, making the notifications somewhat useless. I only want it to notify me of new mail directly addressed to me which, after filtering, is anything left in the Inbox. Unfortunately its not possible to enable the system tray alerts for specific folders; its a global on/off feature.

After much searching I discovered the Mailbox Alert extension which allows you to configure specific types of notifications on a per folder basis. Its only half of the solution though as it doesn't support the Windows system tray but it does allow you to run any executable as an alert. Now all I needed was some utility to create a system tray icon which when clicked will activate the Thunderbird window. Sadly I'm not a Windows programmer so writing such a tool from scratch is a bit beyond me.

I searched high and low and eventually found my solution in the most awesome AutoHotKey. Despite its name its a lot more powerful than just hot keys; it can control almost any part of the Windows GUI, and the Tray module provides functions to manipulate system tray entries.

I ended up with this script which I compiled into an .exe using ahk2exe. Then I told Mailbox Alert to run said .exe for any new mail in my Inbox.

If you don't understand how AutoHotKey works biff.exe should work for most people.

If it doesn't work then you will need to edit the source. A couple of foreseeable issues are the path to the Thunderbird .exe (in order to use their notification icon), and that the script searches for "Mozilla Thunderbird" as the title of the window to activate.

Some other notes about how the script works: in the general case SingleInstance ignore ensures that only one copy of this script is running at any time, i.e. if several batches of emails arrive in my Inbox before you notice the alert you'll only get one icon in my system tray. If you then click the system tray icon it will foreground the Thunderbird window and exit the script. The remaining WinWaitActive call is to ensure that if alert has been fired (i.e. the notification icon is in the system tray) and I switch to Thunderbird via Alt-Tab or via the Task Bar that the system tray notification is still cleared.

In short, this hack should behave identically to the native Thunderbird system tray notification feature except that you can configure it per folder, and even have different notification icons for each folder with a bit of creative editing.

No TrackBacks

TrackBack URL:

OpenID accepted here Learn more about OpenID

Recent Comments

  • Lee Binder: Hi goosmurf. Mailbox Alert 0.14.5/ TB 3.1.10/ Windows 7 SP1 read more

About this Entry

This page contains a single entry by goosmurf published on January 14, 2011 10:09 PM.

The real cost of the big retailers push for GST on retail imports was the previous entry in this blog.

How games mimic the "real" world is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.