Bogofilter DB Sizing

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

On Fri, 2004-07-02 at 13:44, Matthias Andree wrote:
> David Relson <relson at> 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:

[ $# -ne 1 ] && echo "usage: $0 /path/to/wordlist.db" && exit 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 > $
/usr/local/bin/db4_load $ < $
/bin/mv $ $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 Grice                  Broadband Solutions for
|Network Support Analyst           Home & Business @
|PlusNet Technologies Ltd.    
+------ PlusNet - The smarter way to Internet! -----

More information about the Bogofilter mailing list