Monday, November 16, 2009

Feeding sa-learn an email folder

This is a new blog.

I'm blogging about SpamAssassin
and the things I find that make
SpamAssassin useful.

One thing I like to do to make SpamAssassin
a better performer is to periodically re-feed
it old emails that I have stored in either my
ham email folder or my spam email folder.

I have one spam folder and one ham folder.

I reprocess these old emails periodically in
the hopes of improving SpamAssassin's accuracy.

First, I'll give some general steps for
feeding SpamAssassin ham:

  1. Find your ham email folder. The
    place to look? Wherever your email
    reader places these files. In my
    case, I use kmail. Therefore, my
    email folder is a kmail email folder.
  2. Feed the folder to sa-learn

OK. Those are the steps, generally
speaking.

Here's the generic command for feeding
ham to sa-learn:

sa-learn --ham your-ham-folder


OK. Now I'll give you the specific steps
I take. Note that the steps I take and the
steps you take are likely to be quite different.

Why? Because I use kmail as my email client
and you likely use something else.

Also, I've used kmail to set up a ham folder
that I can send ham emails to with a single
click. In all likelihood, you have not yet
set up such a folder.

So, read the following steps and translate them
to your own situation.

These are my steps for feeding sa-learn ham on
a Debian Linux system using kmail as my email
client:

  1. cd /home/eds_home_dir/.kde/share/apps/kmail/mail/ham
  2. sa-learn --ham cur

Simple, isn't it?

Of course, prior to running sa-learn, you want to be
sure, in your own mind, that all the messages in your
ham folder really are ham messages. Otherwise, you
might confuse sa-learn.

What about spam messages?

Well, it is pretty much the same thing.

With spam messages, the generic command
is as follows:

sa-learn --spam your-spam-folder


So, basically, you do the same thing
you did for ham:

  1. Find your spam folder
  2. Feed the spam folder to sa-learn

Hope this helps!

Ed Abbott

No comments:

Post a Comment