Using POPFile with KMail 1.71

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.

  • Be sure to edit the file as root
  • Check the general section at the beginning, there will be a line identifying the number of configured tools. Adjust that number up by 1 to reflect your addition for POPFile.
  • Append the POPFile Spamtool section as shown below, match the number (4 in the example) to the number you ended up with in the previous step.
  • Save the modified file, exit and restart KMail so it is recognized.

kmail.antispamrc

General Section

[General]
tools=4

New POPFile Section to Append

[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).

Using the Wizard

1. Select Tools → Anti-spam Wizard.

2. Select Next.

3. Check the POPFile Box.

4. Select your Spam Folder.

  • Check off all boxes except Classify Messages using anti-spam tools
  • Then click on Finish

5. Review the Results.

  • Review the new filters created under Settings > Configure Filters

6. Check Filters.

  • Make sure that other filters you have defined that are above the three new filters you just added (Spam Handling, Classify Spam, and Classify Not-Spam) will not interfere, in particular, be certain that those filters do not have If this filter matches, stop processing here checked unless it is really appropriate for that mail not to hit the spam filters you added.

  • Your New Reclassify Buttons

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

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).

Warning

  • The material presented here applies to the current CVS version of POPFile and will not work with versions lower than v 0.23.0 of POPFile.
  • Tested on a SuSE 9.2 and 9.3 systems using KDE 3.3.0 and 3.4.0 and KMail 1.71 and 1.80.
 
howtos/kmailspamwizard.txt · Last modified: 2008/02/08 19:49 (external edit)

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.

Recent changes RSS feed Donate Driven by DokuWiki
The content of this wiki is protected by the GNU Fee Documentation License