Kmail and bogifilter catching legit email

Roger Chrisman roger at
Thu Oct 19 23:05:53 UTC 2006

Richard Howes wrote:
> Hi All,
> I decided to give bogofilter in kmail a go again because of the
> increase in SPAM I am getting. Working better than last time I used
> it but I am still getting a lot of false positives.
> We use spamassassin on our mail server so I am only trying to catch
> stuff that gets through. Most of the false positives are getting 100%
> spam score on bogofilter and -5% on spamassassin.
> Anyone using bogofilter successfully?

I use Bogofilter successfully on Kubuntu Dapper (and did on earlier 
Kubuntu's, too).

I did have trouble once when a *false positive* got sent to my 
*Spam_examples* folder and threw off Bogofilter next time I rebuild the 
bogofilter database, snowballing the false positives.

So now I keep *Spam_examples* folder separate from the *Spam* folder. I 
have Bogofilter throw spam into the *Spam* folder and only I, when spam 
slips through, move spam into the *Spam_examples* folder. This works 
better. Of course, I also have a *Ham_examples* folder where I put lots 
of mail that I want Bogofilter to know is stuff I want, especially I 
put all false positives there. Bogofilter stops about 80% of my spam 
and I rarely get a false positive.

Here is my mkBogoBD script that I use to update Bogofilter's database by 
running it about once a week (once a day would be better but I'm lazy 
and haven't setup cronjob for it):
# See:
# (heading 3/4 down the page, Building database)
# remove old Bogofilter database if there is an old one:
test -f ~/.bogofilter/wordlist.db && rm ~/.bogofilter/wordlist.db
# make new Bogofilter database:
find ~/Mail/Spam_examples -type f | /usr/bin/bogofilter  -vvv -s -b \
&& find ~/Mail/Ham_examples -type f | /usr/bin/bogofilte r -vvv -n -b


And in Kmail's Settings > Create filters, and *in this order* may last 
two filters trigger Bogofiltering:

Next to last filter
(*) match any of the following
<any-header>  matches regular expr:  .*        <---dot + asterisk
Remove header:  X-Bogosity
Remove header:  X-Attachments
Pipe through:  /usr/bin/bogofilter -epv

Last filter
(*) match all of the following
X-Bogosity     matches regular expr:  ^Spam, 
Remove header:  X-Bogosity
Remove header:  X-Attachments
Move into folder:  Local Folders/Spam

NB: Never let Bogofilter populate your Spam_examples dir. If you do, 
false positives will quickly compound when you remake the bogofilter 

For more help, try:

Good luck!


More information about the kubuntu-users mailing list