KMail version 1.71 incorporates a new antispam wizard that uses information stored in /opt/kde3/share/config/kmail.antispamrc to help the KMail user set up appropriate filters that will take advantage of whatever spam tool the user has installed on the system.
Adjusting the kmail.antispamrc file to recognize and take advantage of POPFile is easy. Simply edit the file as root and add a new section that describes POPFile.
[General] tools=4
[Spamtool #4] Ident=popfile Version=1 VisibleName=&POPFile Executable=/bin/true URL=http://popfile.sourceforge.net PipeFilterName=POPFile Check PipeCmdDetect=/bin/true ExecCmdSpam=/usr/local/bin/popfile/reclassify.pl spam ExecCmdHam=/usr/local/bin/popfile/reclassify.pl normal DetectionHeader=X-Text-Classification DetectionPattern=spam UseRegExp=0 SupportsBayes=1
Note Adjust the bucket names in the two lines ExecCmdSpam and ExecCmdHam to match your bucket name for spam and your bucket name for ham (shown as spam and normal in the example above). You should also adjust the path to the reclassify.pl script in both of those lines so it matches your installed path (normally, POPFILE_ROOT).
1. Select Tools → Anti-spam Wizard.
2. Select Next.
3. Check the POPFile Box.
4. Select your Spam Folder.
5. Review the Results.
6. Check Filters.
You should now see two new buttons on your KMail toolbar, one to reclassify as spam and one to reclassify as not-spam.
The reclassify.pl script was written by Sam Schinke and is posted on the POPFile forums here http://sourceforge.net/forum/forum.php?thread_id=1215502&forum_id=230652 simply copy and paste it to your favorite editor and save it with the file name reclassify.pl (make sure to save it in the same location you configured in kmail.antispamrc above and make it executable).
Should you find anything in the documentation that is incomplete, unclear, outdated or just plain wrong, please let us know and leave a note in the Documentation Forum.