Use of Bogofilter under KMail

Matthias Andree matthias.andree at gmx.de
Thu Oct 13 22:52:14 CEST 2016


Am 12.10.2016 um 19:26 schrieb Maurice:
> Here on Linux Mageia-5 - after being suddenly being swamped with junk emails -
> I've installed bogofilter* and used KMail's Anti-Spam Wizard to hook up 
> with it to set up junk filtering.
>
> The Anti-Spam Wizard found bogofilter and added Spem and Ham icons in the 
> toolbar, which I've been using them to select the emails for bogofilter's 
> training.
>
> I assume it wll take some days/weeks before its learning process will allow 
> it to start zapping junk emails for me.
>
> The question I have is: How do I clone bogofilter's learning results across 
> to another computer that also has bogofilter similarly hooked up to a cloned 
> kmail?
>
>   Is it sufficient to clone just ~/.bogofilter/wordlist.db?
>  

Maurice,

If the computer has the same major/minor version of Berkeley DB, the
same version of bogofilter and to be extra safe the same kind of
processor (32 vs. 64 bit and endianness matter, if it's all amd64
mainstream 64-bit stuff then you're set), then that might suffice; if
there are log.* files next to the wordlist.db in the same directory, you
need to copy the active ones, too. bogoutil has --db-list-logfiles to
obtain a list of those that would _not_ be needed, inverse logic here;
and --db-prune ~/.bogofilter would remove the _unneeded_ ones so that
you could only copy the remaining ones.

Best to keep the system quiet (i. e. no training, not even implicity by
bogofilter -u) while copying stuff out.

Depending on your (or by proxy, KMail's wizard's) use of bogofilter and
its database, it would use transactions (that then create __db.* and
log.* files) or not. The details of the local bogofilter installation
are printed with bogofilter -V:

> bogofilter version 1.2.4
>     Database: Berkeley DB 5.3.28: (September  9, 2013) AUTO-XA
> [...]
Bogofilter comes with additional scripts, namely bf_tar and bf_copy, and
a few options to bogoutil that may be useful to assist with copying,
please see the respective manual pages.

If unsure or if there are differences, it's easiest to dump (using
bogoutil) the database to a text file, copy that text file to another
computer (in binary mode, do not copy and paste, but use real copy such
as sftp, scp, rsync or similar), and then "load" (using bogoutil -l) the
text file back into a new ~/.bogofilter/wordlist.db on the second
computer. This is also an opportunity to enable transactions, by adding
--db-transaction=yes to the bogoutil command line (see doc/README.db in
the source, not sure where Mageia installs this document in its packages).

HTH
Matthias




More information about the bogofilter mailing list