logo
News About Projects Publications Desktop Gallery CV Friends Site Map Misc
clcms Small Stuff Linktag RRTypes NSEC3 DNSSEC Mailbox Alert
Page contents:
About
Usage
Download
Mailing List
Changelog
Old Versions
Usage Example
notify-more
External Windows Alert Tool
More control over sounds in Windows
Mailbox Alert for OSX
mNotify
Last updated:
2010-06-29
PageNav:
Next: Publications
Up: Projects
Prev: DNSSEC

About

(any news can be found on my general news page)

This extension for Mozilla Thunderbird allows you to specify, for each separate mail folder, a message, sound and/or a system command that will be executed when new mail is found there. This way, you specify different actions for less important folders, or no action at all.


Back to top

Usage

After you have installed the extension, you get a new menu item 'Mailbox Alert' if you right-click on a folder in your folder pane. This option opens a preferences screen that allows you to specify a message, sound, or system command that will be executed if Thunderbird notices that there is new mail there.

For Execute, you should always use the complete path to the executable, for example:

/usr/bin/gmessage %sender %subject
or
C:\tools\Popup.exe %sender %subject

Mailbox Alert Preferences Screen

You can use a few macros that will be substituted by appropriate values:

  • %server The name of the server where the mail folder resides
  • %folder The name of the mail folder the alert was set on
  • %originalfolder The name of the mail folder where new mail arrived
  • %count The number of unread messages in the folder where new mail arrived
  • %countall The number of unread messages in the folder where the alert was set and all of its subfolders
  • %sender The sender of the last unread message
  • %sendername This is replaced by the name part of the sender's address (up to the first <). Surrounding quotes are stripped.
    (If the address does not contain < and >, this value is the same as %sender)
  • %senderaddress This is replaced by the address part of the sender's address (between the < and the >).
    (If the address does not contain < and >, this value is the same as %sender)
  • %subject The subject of the last unread message
  • %charset The character set of the folder
  • %messagebytes The size of the message in bytes
  • %messagesize The size of the message in human readable format

If you toggle the 'Use HTML codes' checkbox, the following characters are replaced within macro expansions:

  • " is replaced by &#34;
  • & is replaced by &#38;
  • ' is replaced by &#39;
  • < is replaced by &#60;
  • > is replaced by &#62;

Characters you put in the command line yourself are not replaced. Use these codes directly in those cases.

Be sure to escape arguments if they contain spaces. Spaces are read as argument separators so, for instance, if you want the string "My Mail" to be 1 argument, the space in that string must have a \ in front of it. Quoting them does not work. Spaces in macro expansions are automatically escaped.

If you set the value 'browser.dom.window.dump.enabled' to true, and start thunderbird from a terminal, debug messages are printed to that terminal. Don't edit prefs.js while thunderbird is running, because it gets overwritten on exit. I hear that this does not under windows, if someone knows how to do this, please let me know :).

Mailbox Alert Preferences Screen


Back to top

Download

The current version is 0.13.3.

To install it in Thunderbird, right-click the link, choose "Save as", go to Tools->extensions in Thunderbird, choose Install, and select the downloaded xpi file.

You can also download and install it through Mozilla's AMO website or, depending on your version, the dialog within Thunderbird.


Back to top

Mailing List

There's a mailing list for users of Mailbox Alert, where you can post questions, bugs, and usage tips. You can subscribe at http://jelte.nlnetlabs.nl/mailman/listinfo/mailboxalert-users.


Back to top

Changelog

  • [0.13.2-0.13.3]
    • Updated to work with Thunderbird 3.1
    • Updated allowed programs to include SeaMonkey 2.0.x

  • [0.13.1-0.13.2]
    • Updated to work with Thunderbird 3

  • [0.13-0.13.1]
    • Fixed a bug in the command section of the preferences screen
    • Fixed a bug in the no-alert-to-parent section

  • [0.12-0.13]
    • the popups no longer uses the internal alerts service (which was very limited and on some platforms missing altogether). I have replaced it with a personal version of something that works a bit like the alerts in tb2.
    • This means that there is now an extra settings screen, available through 'global alert settings' in the normal prefs screen, where you can set:
      • the delay of the popup
      • the duration of the popup
      • the position of the popup
      • an appearance effect
      • what to do when you click on the popup (open message or close popup)

    • This also means that popup alerts should be available to OS X users
    • The icon is now optional in alert popups
    • Major change in settings storage: only non-default settings are stored; this should mean that the problems for people with a lot of mailboxes should be mitigated, unless they specify maximal separate settings for each and every folder
    • Added it-IT locale
    • Added pt-PT locale

  • [0.11-0.12]
    • Updated allowed version of Thunderbird to include 2.0 Release candidates
    • It does not make any use of the improved alerts system, but still uses the old one, which has been tested and still seems to work.
    • Fixed a bug in the %folder macro where the complete URI was shown instead of just the folder name

  • [0.10-0.11]
    • Added localization for de_DE (thanks Archaeopteryx)
    • Complete change to the way the settings are stored, settings should now be kept if you use localization, or change the name of a folder)
      • IMPORTANT: YOUR OLD SETTINGS WILL BE GONE IF YOUR REVERT TO AN OLD VERSION
      • Settings will be back when you upgrade back to 0.11
      • Before you restart, you can copy your prefs.js file if you only want to test first

    • Fixed bugs where localization broke storing settings, see previous point
    • Fixed a bug in charset conversion

  • [0.9-0.10]
    • Localization support (current locales: en_US, nl_NL and fr_FR, thanks Jean-Michel).
    • Alerts that fail are automatically disabled,
    • The built-in alert service is disabled for setups that don't support it (OSX, old Thunderbird versions)
    • The preferences screen has been reduced in size, and the macro explanations have been moved to a separate window.
    • Mailbox Alert is now triggered by additions to folders and does not need to search through the whole folder again, so the speed problems ('hanging script alerts') should be gone now.
    • Manually setting a message to unread no longer triggers an alert.
    • Virtual folders can no longer be configured, and are disabled if they are.
    • Error messages are now more clear.
    • File paths should now be displayed correctly on all platforms (OSX gave some Base 64 string instead of the file name).

  • [0.8-0.9]
    • You can now set a folder to alert for its subfolders, and you can set alerts on complete accounts
    • Alerting is now done through a delayed queue, which means that:
      • When multiple new messages arrive for one folder, only one alert is shown
      • When new messages arrive in different folders, the alerts are shown one at a time
      • There is a 2 second delay before alerting so the junk filter can run first

    • Preferences screen has been improved, unused settings boxes are disabled
    • The Test option from the tools menu has been removed, use the button from the preferences screen now
    • Bugfixes, most notably:
      • Different charsets are now displayed correctly in the default message popup
      • Empty values for macro replacements (like subject) don't break the alert anymore
      • Alert are now shown as soon as mail arrives (sometimes this did not work with IMAP or user-defined filters)

  • [0.7-0.8]
    • Added direct show message option (which calls built-in alert service)
    • Added play sound option
    • %sendername is stripped from surrounding quotes
    • Added test button in preferences dialog
    • Updated icons

  • [0.6-0.7]
    • Added a Browse button to select the program to execute
    • Added a Last command button that copies the last saved command to the current command field (convenient when setting the same command to multiple folders).
    • Better error messages

  • [0.5-0.6]
    • There is a toggle in the settings that replaces special characters in the macro contents by their HTML Entity numbers. Only the ASCII Entities from the HTML specification are replaced (", ', &, < and >).
    • There are two new macros:
      1. %sendername
        This is replaced by the name part of the sender's address (up to the first <).
      2. %senderaddress
        This is replaced by the address part of the sender's address (between the < and the >).

      • If the address does not contain < and >, these values are the same as %sender

  • [0.4-0.5]
    • Arguments to executable are nog longer prepended by a space (which breaks everything you call with it that uses options).
    • The actual command and it's arguments are now dump()ed if you set browser.dom.window.dump.enabled to true.

  • [0.3-0.4]
    • Added some debug messages using the dump() function (enable them by setting browser.dom.window.dump.enabled to true in your settings)
    • No longer alerts with 'locked' or exceptions, instead it ignores the locked setting (doesn't seem to matter anyway for reading out folder data) and uses dump() for exceptions.

  • [0.2-0.3]
    • Changed the possible Thunderbird version to 1.0 - 1.9+ so that it also works in 1.5
    • Fixed bad backslashes in front of < > and & characters in the messages

  • [0.1-0.2] Made the function call non-blocking
  • [0.0-0.1] Initial version


Back to top

Old Versions

  • mailboxalert-0.13.2.xpi
  • mailboxalert-0.13.xpi
  • mailboxalert-0.12.xpi
  • mailboxalert-0.11.xpi
  • mailboxalert-0.10.xpi
  • mailboxalert-0.9.xpi
  • mailboxalert-0.8.xpi
  • mailboxalert-0.7.xpi
  • mailboxalert-0.6.xpi
  • mailboxalert-0.5.xpi
  • mailboxalert-0.4.xpi
  • mailboxalert-0.3.xpi
  • mailboxalert-0.2.xpi
  • mailboxalert-0.1.xpi


Back to top

Usage Example

If you don't like the default system messages, you can use libnotify (Thanks for the tip, Alf :) ) to show new mail arrived:

/usr/bin/notify-send -i /usr/share/pixmaps/mozilla-thunderbird.xpm %sendername\ %folder %subject

Mailbox Alert Example with notify-send

Don't forget to turn on the HMTL tags checkbox, otherwise the texts don't appear if there is a '<' character in it.


Back to top

notify-more

If you want a more interactivity, and your operating system contains the python-notify (or notify-python, names seem to differ) package, you can also use notify-more, with this you can add a 'show' button to the popup message.


Back to top

External Windows Alert Tool

A friend of mine, who wishes to remain anonymous, whipped up some c++ code to show a popup from the system tray, so you can have nice messages in Windows too.

There is a second version already, this one shows the Thunderbird icon, and has a third optional argument; the timeout in milliseconds.

You can download the source and binary:

  • Popup2.zip
  • Popup.zip

To use it, copy the file Popup.exe from the zip to a directory on your hard drive, and set the mailbox alert to:

c:\<dir>\Popup.exe %sender %subject

If your directory has spaces in it, put a \ in front of them. Quoting does not work. It looks weird with the backslash also being the directory separator, but it works.

This code is unsupported. I do not have access to a windows machine with a compiler and will not be able to improve on this. I have tested it briefly on a Windows XP machine and it seems to work.

If you do have a compiler, and can improve on it, I will gladly put it up on this page, or link to your site, provided the source is up there too.


Back to top

More control over sounds in Windows

Scott Crevier has written a little tool to provide more control over what sounds are played in Windows. I haven't tried it, or looked at it in depth, but you can find it here.

Please let me know how it works for you.


Back to top

Mailbox Alert for OSX

(this is for versions before 0.13, or for people who like Growl better than the internal system. Which would be understandable)

I have had reports that Mailbox Alert's 'show a message' option produces an error when using it on mac OSX. Apparently this part of the Thunderbird/XPCOM library is disabled for OSX at the moment.

Users are adviced to use Growl for showing alerts.

A nice example line for growl is:

/usr/local/bin/growlnotify -a thunderbird %folder %sender %subject

Here is more information on how to use Growl.


Back to top

mNotify

Another option to use with Windows is mNotify which looks pretty nice if you don't mind the color. It takes two arguments (remember, if you want spaces within the arguments, put a backslash in front of them.