Spam nowadays is a real pain. While linux users are fairly safe against most common viiri and spyware, spam mail affects everyone.
While there are many spamfilters out there, I've found that only one is pretty effective, on the long run as well. This guide provides a solution to implementing this filter into KMail for local scanning, filtering and retraining.
Note: this guide has been tested on a full KDE 3.4.1 build on Gentoo 2005.1, so if you have another version, things might differ a bit (in which case you should let us know so we can add it here).