A month ago I got no response when I asked for a solution to this
problem, so let me describe what I came up with. It's not pretty,
but it works. First of all, spamd needs these settings:
bayes_auto_expire 0 # expiration requires write access
bayes_auto_learn 0 # learning requires write access
bayes_journal_max_size 0 # never try to sync the journal
You don't want these options when users run spamassassin directly,
so put them in a local.cf file in /some/special/directory and start
spamd with --siteconfigpath=/some/special/directory to use it. If
you have other .cf files that should be used both by spamd and
spamassassin, use symbolic links in /some/special/directory to
/usr/share/spamassassin (or whatever).
Finally, apply the patch at the bottom of this message to the
Bayes.pm file to prevent writing to the Bayes journal file when
bayes_auto_learn is 0 and restart spamd.
Don't forget to set the permissions on the bayes_* files so spamd can
read them. You will probably need to adjust bayes_file_mode (I do
this in /usr/share/spamassassin/local.cf) to keep the files readable
after an expire.
Doing all of this allows spamd to *use* the Bayes database without
attempting to write to it. Writing to the database is done using
sa-learn, which I do automatically using procmail. Occasional false
positives and false negatives are learned correctly by hand. I have
even gone so far as to put "bayes_auto_learn 0" in my user_prefs file
so nothing is learned when I run messages through spamassassin for
testing purposes.
I want to better understand the implications of the patch below before
I submit it for use in a future version.
:: Jeff Makey
[EMAIL PROTECTED]
-----------------------------------------------------------------
*** Bayes.pm.~1~ Sat Jan 17 15:56:08 2004
--- Bayes.pm Sun Feb 15 13:49:02 2004
***************
*** 1047,1053 ****
push (@sorted, $pw);
# update the atime on this token, it proved useful
! $self->{store}->tok_touch ($_, $msgatime);
dbg ("bayes token '$_' => $pw");
}
--- 1047,1053 ----
push (@sorted, $pw);
# update the atime on this token, it proved useful
! $self->{store}->tok_touch ($_, $msgatime) if
($self->{conf}->{bayes_auto_learn});
dbg ("bayes token '$_' => $pw");
}