Rene Caspari wrote:
> Hello,
>
> I want to learn SPAM (and HAM) Mails for certain users, so I execute
> sa-learn:
>
>   [EMAIL PROTECTED] sa-learn --spam -u rene \
>   /var/spool/cyrus/mail/r/user/rene/SPAM/learnspam/9.
>
> But --debug-leve 1 says:
>
>   [...]
>   [2975] dbg: bayes: tie-ing to DB file R/O
>     /root/.spamassassin/bayes_toks
>   [...]
>
> Why sa-learn doesn't update /home/rene/.spamassassin/bayes*?
> The folder exists and spamc (also called with -u rene) updates it
> with autolearning stuff.
>
>
> bye, rene
>   
Because sa-learn -u ONLY works for virtual users. ie: SQL configurations
or folks using spamd --virtual-config-dir

sa-learn -u will not change the effective userid (ie: it doesn't su),
thus the home directory will not change, which is why it does not work
for normal users their bayes stored in their home directory.

from man sa-learn:

**-u* /username/, *--username*=/username/*

    If specified this username will override the username taken from the
    runtime environment. You can use this option to specify users in a
    virtual user configuration.

    NOTE: This option will not change to the given /username/, it will
    only attempt to act on behalf of that user. Because of this you will
    need to have proper permissions to be able to change files owned by
    /username/. In the case of SQL this generally is not a problem.


Reply via email to