April 14, 2003

Using Mozilla 1.3's "Junk" email filter

- By Robin 'Roblimo' Miller -

My new Mandrake 9.1 installation includes Mozilla 1.3, which comes with a simple Bayesian email filter that does a pretty fair job of getting rid of junk email before you waste eyeball time on it. But it is not a perfect utility, and unless you set it up correctly some of the email you want to read will inevitably end up in the "Junk" folder. This article explains some tricks I found to prevent this from happening, all of which are dirt-simple to implement once you know about them.

The "Junk" feature implementation is easy: You start by clicking on the "Tools" button in the Mozilla header while you're in the email (messenger) section of Mozilla. You set the "Junk" filters up to your taste, including assigning an appropriate folder in which to place the auto-determined spam. Then, whenever you get a piece of email you consider spam you click the "Junk" button in the Mozilla header, which puts a little wastepaper basket next to that email's subject line in your list of inbox messages. Once "Junked," you send that message to your trash bin by using the usual "Delete" button. Before long, messages that are similar to the ones you have marked "Junk" automagically get shunted to your "Junk" folder. Yay! No more penis or breast enlargement offers, no more incomprehensible Chinese or Korean characters that take forever to display on an old/slow computer. No more spam.

Except it isn't quite that easy.

I subscribe to a number of email lists, and I found that emails from those lists were being consigned to the "Junk" folder along with all the offers to date beautiful Russian women, make big money from home with my computer, get paid for my opinions (which I already do. come to think of it), and buy wholesale pipe fittings from factories in Hong Kong.

So I did the RTFM (Read The Fine Manual) thing and clicked the "Help" button up in my Mozilla header, chose "Help Contents," and selected "Controlling Junk Mail" from the table of contents. That got me nothing but this sad entry:

Controlling Junk Mail

text to come

Using Junk Mail Controls

text to come

[ Return to beginning of section ]


Next step: Jumped on Google with the keywords "Mozilla 1.3 email junk filter" and scanned through the pages it brought up, starting with this FAQ, which turned out to be slightly outdated, and at the same time mentioned some "features to come" that don't seem to have been implemented in my copy of Mozilla.

I tried doing something else I figured out from reading Mozilla email filtering rules in general: Adding "good" email list addresses to my address book, since the "Junk" filter doesn't act against addresses you have chosen to save. This semi-worked, and I say "semi-worked" because to make it work 100% I'd need to save the email address of every person who posts to every email list I'm on that transmits the poster's email address as a "from" and uses the list address as a "reply to." Tedious!

Next phase: I used the original Mozilla email filters to create an "if message is 'to' [list address], put it in 'lists' folder" rule. This action eliminates the "list mail is probably junk" problem, but would give me false positives from many low-traffic lists I'm on until I spotted traffic from them in my "Junk" folder and made filters for all of them. Making an email filter in Mozilla is simple -- merely click-click -- but when you're a hard-core, commercial-level email user (as I am) who deals with heavy email traffic, this can take a substantial amount of time. Besides, I prefer (don't ask why; it's just an old habit) all my email in a single inbox, and to go through it in the order it is received.

Toggle magic!

This turned out to be the right trick. Although I didn't spot this feature in any of the (scanty) writings I found about Mozilla's "Junk" email sorting feature, it seems you can go through the "Junk" folder and unclick the "Junk" icon on all messages automatically consigned to that folder that shouldn't be there. Do this enough (like for two or three days), and the program will learn that Politech, SLUG, and other list emails aren't spam.

I now have a working spam filter that gets rid of at least 95% of all the junk people send me, but hasn't slapped any email I want to see into the "Junk" folder for several days. I still check because that's how I am, but it's been a while -- at least 1000 emails -- since I last saw a false positive. And it took no special program download or installation, and no fees of any kind, to make this happen, just some easy clickety-click action while reading my email with Mozilla.

This is another major win for the Mozilla team. All they need to do now is document this feature so we don't have to grope around, trying to learn how to use it correctly. And I'm sure they will handle this little task before long.


  • Open Source
Click Here!