Getting notified when new mail arrives in Thunderbird
When writing an extension for Thunderbird, it’s a common goal to be able to tell when new mail has arrived. In versions of Thunderbird before 2.0, the accepted practice was to get a pointer to the nsiMsgMailSession and add a listener that got called when a new mail event happened. The code would look something like: