bogofilter -u broken: locking issue

Gyepi SAM gyepi at praxis-sw.com
Thu Oct 10 17:46:14 CEST 2002


On Thu, Oct 10, 2002 at 04:25:16PM +0200, Matthias Andree wrote:
> Hi,
> 
> since some hours, bogofilter -u is broken, but I don't have time to
> track this down now.

I just checked in a small change to main.c which 'fixes' the problem.

The problem is that we open the databases in read-only mode when simply evaluating
an email, except that update mode causes us to write to the database, but
the database is open in read-only mode...

The idea to open the databases in read-only mode is a good one, but the opening of the
databases should happen as late as possible, since we have more information then.

The disadvantages of doing so are:

1. Any errors opening the database do not occur till much later.
 
   I don't think this is a big problem.

2. Feeding an mbox file to bogofilter would make it open and close the databases
   for each email.

   If this were done frequently, it could be a problem. However, this usually occurs when
   initially seeding bogofilter.
 

   If it were a problem, we could modify lexertest so it only outputs words, then place the following line
   in a shell script and call it bogoseed. ;)
   
 (lexertest < mbox.file |sort|uniq -c|awk '{print $2,$1}';echo "MSG_COUNT `grep -c '^From ' mbox.file`")|bogouti -l file.db

  I would probably make lexertest output MSG_COUNT too, making this even shorter.

 
Anyway, I'll implement the delaying of database opening unless there are objections.

-Gyepi



More information about the bogofilter-dev mailing list