Documentation Problems → (k)ubuntu 8.04 configuration

(k)ubuntu 8.04 configuration

kubuntu users should do:
- open a terminal
- sudo cp kmail.antispamrc kmail.antispamrc.old
- sudo gedit kmail.antispamrc
- change [General]

tools= to the number of tools you have, included the popfile tool

in my situation it will be 12:
[General]
tools=12

add at the end of the file:

[Spamtool #12] <---- 12 if the spamtool ends at 11, like what i have
Ident=popfile
Version=1
VisibleName?=&POPFile
Executable=/bin/true
URL=http://popfile.sourceforge.net
PipeFilterName?=POPFile Check
PipeCmdDetect?=/bin/true
ExecCmdSpam?=/usr/share/popfile/reclassify.pl spam
ExecCmdHam?=/usr/share/popfile/reclassify.pl normal
DetectionHeader?=X-Text-Classification
DetectionPattern?=spam
UseRegExp?=0
SupportsBayes?=1

- save it
- sudo gedit /usr/share/popfile/reclassify.pl
- add the following lines:
#!/usr/bin/perl
use strict;
use XMLRPC::Lite;


# This XMLRPC client reclassifies a message
# REQUIRES X-POPFile-Link be enabled for all messages processed
# Usage:
# ./xmlrpc-reclassify.pl bucket < message


my $bucket;
die ( "You must specify a bucket!" ) unless ( $bucket = $ARGV[0] );


my $message;


# act like a pipe, reading from STDIN
while (<STDIN>) {
if ($_ =~ /X-POPFile-Link: .*?\?view=([0-9]+)/) {
$message = $1;
last;
}
}


die ( "No X-POPFile-Link header found") unless ( defined( $message ) );


print STDERR "Reclassifying message $message to $bucket\n";


# our XMLRPC proxy
my $xmlrpc = XMLRPC::Lite ->proxy('http://localhost:8081/RPC2');


# say hello and get a session key
my $sk = $xmlrpc-> call('POPFile/API.get_session_key','admin',)
-> result;


die ( "Unable to obtain a session with POPFile. \
Please verify that POPFile is running and\

your username and password are correct. $sk" ) if ($sk eq !defined($sk) );


# this does the work
my $result = $xmlrpc-> call('POPFile/API.reclassify',$sk , $message, $bucket )
-> result;


# release, release
$xmlrpc-> call('POPFile/API.release_session_key',$sk);


die( "An error occured while reclassifying: $result" ) unless ( $result eq '0' );


# exit
exit(0);

- save
- start kmail, end configure it like the way you find it here on this site