Mailing List Archive

bayes databases, sa-learn, users
When using a script to help automate submission to sa-learn, learned (so to speak) thru the kindness of others, that there
are different results when querying sa-learn for tokens, as different users.

The script runs as "script-user" while I normally query as "root". I puzzled over why the script appeared to be working
fine, yet the tokens did not increase. Different users. I presume this means diffferent Bayes db's?

Assuming that is correct, my question is . . . should I care? Will spamassassin (spamd in this case) use Bayes with db's
"conjoined" when processing mail? OR apply only that for the owning user?

Or, yet still, am I chasing moonbeams?

joe a.
Re: bayes databases, sa-learn, users [ In reply to ]
On 4/24/2012 2:38 PM, joea wrote:
> When using a script to help automate submission to sa-learn, learned (so to speak) thru the kindness of others, that there
> are different results when querying sa-learn for tokens, as different users.
>
> The script runs as "script-user" while I normally query as "root". I puzzled over why the script appeared to be working
> fine, yet the tokens did not increase. Different users. I presume this means diffferent Bayes db's?

Exactly.

> Assuming that is correct, my question is . . . should I care? Will spamassassin (spamd in this case) use Bayes with db's
> "conjoined" when processing mail? OR apply only that for the owning user?

No, Bayes will only use the db for the current user. You will need to
either change your script to sa-learn as the proper user, or switch to a
global db.

--
Bowie
Re: bayes databases, sa-learn, users [ In reply to ]
>>> On 4/24/2012 at 2:49 PM, Bowie Bailey <Bowie_Bailey@BUC.com> wrote:
> On 4/24/2012 2:38 PM, joea wrote:
>> When using a script to help automate submission to sa-learn, learned (so to
> speak) thru the kindness of others, that there
>> are different results when querying sa-learn for tokens, as different users.
>
>>
>> The script runs as "script-user" while I normally query as "root". I
> puzzled over why the script appeared to be working
>> fine, yet the tokens did not increase. Different users. I presume this
> means diffferent Bayes db's?
>
> Exactly.
>
>> Assuming that is correct, my question is . . . should I care? Will
> spamassassin (spamd in this case) use Bayes with db's
>> "conjoined" when processing mail? OR apply only that for the owning user?
>
> No, Bayes will only use the db for the current user. You will need to
> either change your script to sa-learn as the proper user, or switch to a
> global db.
>
> --
> Bowie

I'm not finding a way to set global. Not using mySQL. Maybe it's a bit late to be doing this.

joe a.
Re: bayes databases, sa-learn, users [ In reply to ]
On 4/24/2012 10:11 PM, joea wrote:
>>>> On 4/24/2012 at 2:49 PM, Bowie Bailey <Bowie_Bailey@BUC.com> wrote:
>>
>> No, Bayes will only use the db for the current user. You will need to
>> either change your script to sa-learn as the proper user, or switch to a
>> global db.
> I'm not finding a way to set global. Not using mySQL. Maybe it's a bit late to be doing this.

If you are currently using mySQL, you should be able to simply modify
your query to get the right database. I don't use mySQL myself, so I
can't give you specifics.

If you are not using mySQL, there is no reason to switch at this point.
If you are doing everything else as root, then you just need to find
root's bayes db and set the permissions on the files so that
"script-user" can access them. Then you run sa-learn with the proper
parameters to point it to root's db (check the man page for sa-learn).

--
Bowie