Re: Rebuilding SpamProbe database

Nollaig MacKenzie <[email protected]> Thu, 16 Oct 2008 08:50:57 -0400
Newsgroups gmane.mail.spam.spamprobe.general
Message-ID <[email protected]>
On 2008.10.15 09:22:08, you,
 the extraordinary Thomas Schrger, emitted:

 
> > I use SpamProbe with BerkeleyDB, but with mbox files, not the
> > scheme used by qmail, so this may not be relevant. The script
> > I use - also based on a readme.txt from some years ago - is:
> >
> > #!/bin/sh
> > if [ -e ~/.spamprobe/sp_words ];then
> > cd .spamprobe
> > cp sp_words sp_words.old
> > /opt/local/bin/spamprobe cleanup 3 17 1024 365
> > /usr/local/BerkeleyDB.4.7/bin/db_dump sp_words|/usr/local/BerkeleyDB.4.7/bin/db_load sp_words.new
> > mv sp_words.new sp_words
> > fi
> >
> > I have never noticed any problems.
> >   
> qmail uses maildir instead of mbox, but that is not relevant here. It is 
> not that
> the actual mail delivery fails or leads to corrupt mails, it is rather 
> that SpamProbe/
> BerkeleyDB hangs due to database problems and that blocks qmail's delivery
> threads one after the other.
> 
> I'm not sure, but is it possible that SpamProbe or BerkeleyDB reopens 
> the database
> file while it is running? If this is the case then moving the database 
> file and providing another
> newly exported/imported file instead while SpamProbe is running may 
> cause problems (think
> of reading the database from one file and then writing to another file 
> due to reopening). Also,
> the SpamProbe lock file is moved so that a second instance of SpamProbe 
> might run in parallel.
> 
> I'm currently not using locks with procmail (as SpamProbe has locking 
> itself), but using
> procmail locking will only prevent a second instance from running.
> 
> Any thoughts?
 
I'm sorry, I don't have any thoughts.... I do remember that
about six months ago there was a discussion of similar
problems that some people had with BDB+spamprobe. The
conclusion of that, as I recall, was that (a) it would be much
too time-consuming to try to figure out why the problems
affected some installations rather than others, and that
(b) since there are good alternatives to BDB, one should
switch as soon as the problems appear.

Your discussion raises a question for me, however. Maybe
it is risky to replace the database while my mail system
(Postfix) is running, so I should issue a 'postfix stop'
before executing the script. I'll do that, just to be safe.

...N.

-- 
Nollaig MacKenzie
http://www.amhuinnsuidhe.net

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/