IMAP4 NOTIFY addon for Thunderbird! (Thunderbird 60 compatible!)

Warning: I publish this addon as is. It is a Proof Of Concept. It works well enough for my needs, and I don't have the time neither the Javascript and Thunderbird internals expertise to create a real addon usable by regular users.

Sorry for that. I already invested too much time on this. I am a consultant, btw, so you could just pay me :-).

This code is BSD licensed.

In IMAP4 NOTIFY addon for Thunderbird! I proposed an ugly addon to add IMAP4 notify to Mozilla Thunderbird. I have been enjoying that addon for four years (since late 2014) and I forgot about it. Cool.

In november 2018 Mozilla published Thunderbird 60 and my addon was disabled as "incompatible".

OK, I thought, I will check it out when I have a spare cycle.

So I used Thunderbird 60 for like two weeks without my notify addon.

My friend, what a hell.

I am not going to explain the rational or the details for this Thunderbird addon. You can find them in IMAP4 NOTIFY addon for Thunderbird!. I am going to explain only the source code changes. They are actually quite minor.

File bootstrap.js:

--- bootstrap.js        2014-10-11 17:56:36.000000000 +0200
+++ /home/jcea/.thunderbird/XXXX/extensions/       2018-11-15 03:27:31.113372680 +0100
@@ -4,9 +4,9 @@

 var incomingServer = null;
 var rootFolder = null;
@@ -45,7 +45,8 @@
                        if (folder == "")
                                continue; // El \n final, si lo hay
                        folder = incomingServer.getMsgFolderFromURI(rootFolder, folder);
-                       Services.console.logStringMessage(folder.prettiestName+" "+folder.URI);
+                       //
+             " "+folder.URI);

                        // Costly, and running in the main thread.
                        // Would be wonderful if we could do this in a worker thread

Here we simply change the way we do the logging. You can find some details in We also change the name pretty printing, from the deprecated folder.prettiestName() to folder.prettyName().

Even without those changes, my addon should work in Thunderbird 60. Nevertheless Mozilla deprecated plenty of APIs so they decided that addons should be explicitly declared compatible. This is done in file install.rdf:

--- install.rdf 2014-10-11 17:56:36.000000000 +0200
+++ /home/jcea/.thunderbird/XXXX/extensions/        2018-11-15 01:32:07.938443225 +0100
@@ -6,7 +6,7 @@
   <Description about="urn:mozilla:install-manifest">
     <em:name>NOTIFY IMAP</em:name>
-    <em:version>0.0.14</em:version>
+    <em:version>0.0.16</em:version>

@@ -16,7 +16,7 @@
-        <em:maxVersion>31.*</em:maxVersion>
+        <em:maxVersion>60.*</em:maxVersion>

And that is all it's needed. We only need to declare the addon as compatible with Thunderbird 60. That is. The addon should be still compatible with previous Thunderbird versions.

Download version 0.0.16.