I’m tickled pink about ThunderBayes!

After several days of using ThunderBayes/SpamBayes, I’m happy to report that it’s just as awesome as it was rumored to be! 😀

Even better, I’ve been able to fix one of the problems that I had with setting it up (the multiple-accounts bug). I sent the code changes to Daniel Miller, the original ThunderBayes developer, and we’ve been discussing them. I suspect there will be an official update to ThunderBayes in the near future.

I’m looking into what’s necessary to include the newer version of SpamBayes with ThunderBayes too. It’s not a drop-in replacement, because there’s a bug in the ProxyUI code that causes SpamBayes to crash when trying to update the proxy list. I’m trying to track that down now; once it’s fixed, I’ll pack it up with the new version, and another problem that I had (setting up SSL accounts through it) will be toast too. 🙂

ThunderBayes is written in JavaScript (a necessity for Thunderbird extensions) and Python (required because SpamBayes is written in Python). I hadn’t dealt with JavaScript at all before — it’s quite interesting, though apparently a fairly limited language. I’d looked at Python’s syntax before, but I’d never done any work in the language. The hardest parts of fixing the multiple-accounts bug were figuring out the syntax (online manuals and tutorials on both JavaScript and Python helped a lot with that) and figuring out how to get each of the languages to show me what was going on in them.

Since the SpamBayes/ThunderBayes Python interface exchanges information using HTTP, which I’m already familiar with (I’ve written an HTTP server from scratch in C++, just to see what all was involved), it was simple enough to include extra information in the reply packets. But JavaScript stumped me for a while, until I found something on another Thunderbird developer’s page that described how to do it: it seems that the JavaScript dump() command has to be enabled first in Thunderbird, by opening the Error Console from the Tools menu and entering this command (all one line):

Components.classes ['@mozilla.org/preferences;1'].getService (Components.interfaces.nsIPref).SetBoolPref ('browser.dom.window.dump.enabled', true);

(To turn it off again, enter the same command, but with the true at the end changed to false. If you get the command right, there won’t be any confirmation on either of them.) After that, you have to run Thunderbird from a command-line window, and things sent to the dump() command will appear in that window.

Now that I’ve figured out how Thunderbird extensions are put together, I’ve already applied the knowledge to fix a minor irritant in Enigmail as well (bug report and fix submitted). These make for some nice little hobby projects, for when I just can’t force myself to work on Project X any longer at the moment.

3 Comments

  1. Hey Geek, It would have been nice if you had told us what you did to get ThunderBayes working on multiple-accounts instead of dng all the back patting about how smart you are that yu got it working. Not much help!

  2. Sorry it wasn’t much help. From what he’d said, I thought that Mr. Miller would release an update to ThunderBayes, but he never did. If you’d like, I’ll dig up the e-mail thread and post the steps needed to get it working…?

    (I’d do it without asking, but I don’t want to spend the time if no one is going to look at it.)

Comments are closed.