Bogofilter DB Sizing

Mike Grice mgrice at plus.net
Fri Jul 2 09:30:32 EDT 2004


On Fri, 2004-07-02 at 13:44, Matthias Andree wrote:
> David Relson <relson at osagesoftware.com> writes:
> 
> > Size control is easy if you're using postfix.  It has a
> > mailbox_size_limit parameter which limits the size of files used in
> > processes it runs, for example bogofilter's wordlist.db!!!
> 
> The problem is that bogofilter quits working if it notices in time that
> the DB is close to the limit, or, if it doesn't notice in time or
> becomes the victim of a race, it may bump hard into the limit,
> corrupting the data base.
> 
> The TXN version will survive such events without permanent loss of data,
> but I would not yet recommend it for production, for the
> recovery-and-DB_ENV-resize issue is still open.

I formulated a workaround by writing a script that I can call from
cron.  Basically along the lines of:

#!/bin/sh
[ $# -ne 1 ] && echo "usage: $0 /path/to/wordlist.db" && exit 1

DATABASE=$1

# Delete user tokens that are older than 7 days
/usr/local/bin/bogoutil -a 7 -m $DATABASE

# Rebuild the database to save disk space
/usr/local/bin/db4_dump $DATABASE > $DATABASE.data
/usr/local/bin/db4_load $DATABASE.new < $DATABASE.data
/bin/mv $DATABASE.new $DATABASE

I can feed it a list of databases (find -name is your friend) and it
conveniently snips as required.

It would be nice for there to be a bogofilter option that auto-expires
after X days, however.

Mike

-- 
|Mike Grice                  Broadband Solutions for
|Network Support Analyst           Home & Business @
|PlusNet Technologies Ltd.              www.plus.net
+------ PlusNet - The smarter way to Internet! -----



More information about the Bogofilter mailing list