Getting SpamBayes/ThunderBayes Working (Under Linux)

Thunderbird’s built-in spam filter is pretty good, more accurate (and a lot easier to set up and use) than several others I’ve tried, but even so it’s accuracy still leaves something to be desired. I don’t get anywhere near as much spam now as I used to, but roughly half of my daily e-mail is still spam, so I’m always on the lookout for potential improvements to my filtering system.

Though I’ve long wanted to use SpamBayes, an open-source project that’s reputedly one of the most accurate anti-spam systems going, reading through the daunting setup instructions has always deterred me. They seemed to imply that procmail or some other arcane server-type mail system was required for it. But while poking around the Internet today, doing research for another project, I discovered that there’s a Thunderbird plug-in for it, ThunderBayes! I immediately tried to install it.

From the beginning, the setup was plagued by problems. Not in ThunderBayes itself, so far as I can tell — it was as simple to set up and use as I could hope — but others. At first, I couldn’t add the spam/ham button to the toolbar, because when I told Thunderbird to “configure” the bar, it wouldn’t show the window with the new icons. That turned out to be a glitch with Thunderbird in the multiple monitor setup I use, and was easily solved by moving the Thunderbird window to the other monitor before trying to configure the toolbar (though figuring that out wasn’t so simple).

The second problem was due to the fact that I have four e-mail accounts. When I set up ThunderBayes on one of them, everything worked — but when I tried to set it up on a second, the settings for the first one got completely screwed up. This was reported once before, recently, but with no solution. I played with it and discovered that it seemed to be a bug in the SpamBayes configuration program itself. (Maybe it’s specific to Linux, due to the different line-endings? That’s all I’ve been able to come up with so far.) The solution to that was to configure all four of the servers at the same time, in the SpamBayes settings themselves. From Thunderbird, select Tools -> Add-ons; press the Preferences button for ThunderBayes; press the “SpamBayes Config…” button; and click the “Configuration page” link in the upper-right corner of the browser window that appears. I had to enter all four remote servers, and all four SpamBayes ports, at the same time and then scroll down to the bottom of the page to click the Save button. I had to do this several times, at different times while I was playing with it, because SpamBayes seems to want to rearrange the servers and ports, and sometimes loses some of them when it does so. Once I got that all set up, with the SpamBayes ports in numerical order, they stayed where they were put. Then it was just a matter of going to Thunderbird’s Account Settings page and changing the Server Names and port numbers for each of the accounts to “localhost” and the port number I’d selected for it — after that, ThunderBayes automatically picked up the SpamBayes settings for each.

The third and final problem was a big one, though not a bug. I use SSL to connect with three of my four e-mail servers — two of them refuse to work without it, GMail and the company that mine does consulting for, and I’ve set it up on the third for security’s sake (the fourth server doesn’t support it, but I only use that account to communicate with one company). The version of SpamBayes that is included with ThunderBayes doesn’t support SSL. Having gotten this far, I wasn’t going to let that stop me, so I dug into it and figured out how to use a program called stunnel to make it work (I’m not going to describe how to do that here — it’s not a straightforward task — but you can find general instructions on it here). An alternative to this might be to install the latest SpamBayes instead — it includes support for SSL, and that path might have been easier — but I didn’t try it.

So now it’s just a matter of waiting for more e-mail to come in, so I can train it and see if it’s reputation is as well-deserved as I hope. 🙂

2 Comments

  1. Procmail is not really a mail server, it’s a mail filter program, and in my experience, not hard to set up for simple stuff if you’re careful with the syntax and testing before finalizing. In fact, it can be used as a very simple spam filter itself by hand, but today’s spam needs something more powerful than procmail alone.

    stunnel sounds neat, I think it has other applications of it too from what I recall.

  2. Be that as it may, it put me off. One new and unknown program at a time, please. 🙂

    It turns out that the “second problem” mentioned above is a problem with ThunderBayes, and I’ve apparently volunteered myself to fix it. 🙂 I’ve never dealt with JavaScript before, and have only a minor knowledge of Python, but it shouldn’t be all that difficult. I’ll post more once I have more info.

    stunnel is neat, but I’d prefer to use the version of SpamBayes that fully supports SSL instead. I may have volunteered myself for updating that part too, we’ll see.

Comments are closed.