On Thu, Jan 17, 2008 at 07:42:30PM -0800, [EMAIL PROTECTED] wrote:
> Did I read something that said that the digit after "bayes db  
> version" indicated the version of Berkeley DB that's installed on the  
> system?  Like 0 means 1.x...   Google shows various messages like  
> "bayes db version 2 is not able to be used, aborting!" which would  
> seem to indicate that 0 is not indicative of the problem I saw.

The bayes version has nothing to do with the version of Berkeley DB.  It's the
version of the Bayes data.  It's been 3 for a while now.  from "man sa-learn":

 The database ’version number’ is 0 for databases from 2.5x, 1 for
 databases from certain 2.6x development releases, and 2 for all more
 recent databases.

Hrm.  Interestingly, it doesn't mention version 3, which was introduced
in 3.0 and has been used in all later versions.  I'll update the man
page in a minute. :)

> Perhaps the reason that the bug report lists 0 is that Berkeley DB  
> version 1.x does not include an integrated locking mechanism, but  
> higher versions are reputed to have such a mechanism.

The DB_File module, used to access the database files, uses the 1.x API, so no
locking from libdb.  SA does locking on its own.  If you're not using NFS, I'd
recommend using "lock_method flock", btw.

> Please, where is this DB that I should back up?

It depends what your configuration is.  Typically it's
~/.spamassassin/bayes_toks.  Otherwise, look at the bayes_path setting.

> I wrote a GP Berkeley DB rebuilding program that reads all of the key/ 
> value pairs in a DB, and writes all of those for which the key and  
> value are defined and of non-zero length, to a new DB.  I could try  
> running that and see if the new DB is significantly smaller than the  
> old, which for my DBs indicates that it's time to use the new DB.

This generally isn't needed by SA, since it's is what SA does when
an expire happens.  You should also look at 'sa-learn --backup' and
'--restore'.  You could also just use db_dump | db_restore.

> Theo, do you know if SA uses any entries with null keys or values,  
> that are needed for proper operation?  It would be easy to keep  
> entries with null values; I wrote the program to discard them because  
> my DBs don't use such entries.

There will be values with null (ascii 0) in them as the token keys are
binary values, and the values are binary packed values.  This is why
"sa-learn --backup" is a good choice, it will convert the binary into
text.

-- 
Randomly Selected Tagline:
"... then you'll excuse me, but I'm in the middle of fifteen things, all of
 them annoying."
         - Ivonova, Babylon 5 (Midnight on the Firing Line)

Attachment: pgpqqHGuQzBT4.pgp
Description: PGP signature

Reply via email to