Okay, then let me have a look...

On Mon, Apr 07, 2008 at 08:50:00PM +0200, Krzysztof Matusik wrote:
> SETUP:
> 
> kolab-cyrus + amavis-new + spamassassin and sa-learn-cyrus
> I changed sa-learn-cyrus.conf  SA user:group amavis:amavis instead of
> mail:mail. I've created necessary folders (uczJakoSpam for spam and
> uczJakoNieSpam for ham) for cyrus user,  debug = on, and verbose = 3, , those
> are basically all notable things.

Perfect.

> RESULTS:
> 1)
> /usr/sbin/sa-learn-cyrus complains about missing 'bayes_path' in /etc/
> spamassassin/local.cf
> This value _was not_ in my configuration (so I suppose debian spamassassin nor
> amavis regular installation does not set it up)
> I've put 'bayes_path /var/lib/amavis/.spamassassin' into local.cf. Putting it
> into sa-learn-cyrus.conf doesn't work.

Well, yes. It's not a standard setting in /etc/spamassassin/local.cf but
it's needed to make any sense here. The man page of sa-learn-cyrus tells
you:
,----
| It is intended to be used on smal mail systems (e.g. home office) with a
| single server-wide SA configuration.
`----
To have such an environment you need to specify the place of server-wide
tokens etc. I've done that in /etc/spamassassin/local.cf with
bayes_path /var/lib/amavis/.spamassassin/bayes
And you need to specify it in spamassassin configs (instead of
sa-learn-cyrus.conf) because the original sa-learn uses this setting,
too (see below).

I think it should be documented better and I forward it to upstream.
Thanks for pointing me to that!

> 2)
> Script complains:
> No tokens '/var/lib/amavis/.spamassassin/_toks' found.
> I've looked into code, put 'tokens = bayes_toks' into sa-learn-cyrus.conf [SA]
> section. Works. Printout:
> sa-learn-cyrus[16638]: Tokens in '/var/lib/amavis/.spamassassin/bayes_toks'

That works for sa-learn-cyrus but not for sa-learn (see below).

> 3)
> 2008-04-07 19:56:22 sa-learn-cyrus[16638]:   sa-learn> [16672] dbg: bayes:
> tie-ing to DB file R/W /root/.spamassassin/bayes_toks
> 2008-04-07 19:56:22 sa-learn-cyrus[16638]:   sa-learn> [16672] dbg: bayes:
> tie-ing to DB file R/W /root/.spamassassin/bayes_seen
> 2008-04-07 19:56:22 sa-learn-cyrus[16638]:   sa-learn> [16672] dbg: bayes:
> found bayes db version 3
> This doesn't make sense to me. I want sa-learn to be run for user amavis not
> root.

This happens because sa-learn is started with parameter "--prefspath"
pointing to /etc/spamassassin/local.cf. And there the bayes_path is
found.

> Obviously sa-learn-cyrus is not well designed.

I'll ignore that silently... :-P

> 4)
> sa-learn-cyrus[16638]:   Purging learned spam mails from folder
> 'user.kyf.uczJakoSpam'
> sa-learn-cyrus[16638]: New tmp_file '/tmp/sa-learn-cyrus-PCdf8.16638'
> sa-learn-cyrus[16638]:   Executing 'su cyrus -c '/usr/sbin/ipurge -f -b 0
> [EMAIL PROTECTED]' 1>/tmp/sa-learn-cyrus-PCdf8.16638 2>&1'
> but
> ls /var/spool/cyrus/mail/domain/a/arterm.pl/k/user/kyf/uczJakoSpam -l
> razem 20
> -rw------- 1 cyrus mail 4681 kwi  7 19:03 1.
> -rw------- 1 cyrus mail 1128 kwi  7 19:03 cyrus.cache
> -rw------- 1 cyrus mail  177 kwi  7 18:48 cyrus.header
> -rw------- 1 cyrus mail  136 kwi  7 19:03 cyrus.index
> As you can see dirs are not purged. This seems to be ipurge problem, because
> when I run it ouside sa-learn-cyrus (su cyrus -c '/usr/sbin/ipurge -f -b 0
> [EMAIL PROTECTED]') it doesn't work neither.

The files cache, header and index exist until the mailbox itself is
deleted AFAIK.

> CONCLUSIONS:

It is standard (AFAIK) to set the bayes_path like I did (see above):
bayes_path /var/lib/amavis/.spamassassin/bayes
"_toks" and "_seen" are appended correctly by sa-learn-cyrus then. The
original sa-learn also works correctly for me with this setting.

As said above I'll forward it to upstream so that it's better documented
in future or maybe I put it into README.Debian as a hint for amavis
users.
If you'd like to help me solving that please include the bayes_path in
your local.cf as I did. But since we're leaving the actual topic please
report a new bug if it doesn't work out again.

Regarding this bug report I'll include kolab-cyrus-imapd in dependencies
as alternative to cyrus-imapd-2.2 because it seems to work out in
general.

Cheers,
Hauke

Attachment: signature.asc
Description: Digital signature

Reply via email to