Mailing List Archive

Bayes not utilized?
I want the Bayes intelligence to apply site-wide. I don't see any
indication in my headers that SA is using Bayes.

In local.cf, I have:

use_bayes 1
bayes_path /root/.spamassassin/bayes

I have run sa-learn on both ham and spam (>200 each) and have bayes_toks and
bayes_seen files in:
/root/.spamassassin
(There's no journal yet - Does that appear when Bayes gets used the first
time??)

I originally ran sa-learn as root. Do I need to change permissions on those
to be used site-wide??

I also note that I have bayes_toks and bayes_seen files in my individual
users' directories. These weren't there after originally running sa-learn -
that run went to /root/.spamassassin, so I assume the files in the users'
directories have appeared due to auto-learning?

What am I missing? It's so close to working!
Re: Bayes not utilized? [ In reply to ]
On Mon, 9 Feb 2004, John Fleming wrote:

> I want the Bayes intelligence to apply site-wide. I don't see any
> indication in my headers that SA is using Bayes.
>
> In local.cf, I have:
>
> use_bayes 1
> bayes_path /root/.spamassassin/bayes
>
> I have run sa-learn on both ham and spam (>200 each) and have bayes_toks and
> bayes_seen files in:
> /root/.spamassassin
> (There's no journal yet - Does that appear when Bayes gets used the first
> time??)

not used until you define: bayes_learn_to_journal 1

> I originally ran sa-learn as root. Do I need to change permissions on those
> to be used site-wide??

depends on which user is running spamd. spamd user must have access (rw)
to these bayes files.

> I also note that I have bayes_toks and bayes_seen files in my individual
> users' directories. These weren't there after originally running sa-learn -
> that run went to /root/.spamassassin, so I assume the files in the users'
> directories have appeared due to auto-learning?

if you allow user config, then your users gets their own bayes DB.

> What am I missing? It's so close to working!

hope this helps a bit.

regards,
Matthias
Re: Bayes not utilized? [ In reply to ]
John Fleming wrote:
> I want the Bayes intelligence to apply site-wide. I don't see any
> indication in my headers that SA is using Bayes.
>
> In local.cf, I have:
>
> use_bayes 1
> bayes_path /root/.spamassassin/bayes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is BAD for a global Bayes setup. You do NOT want to give global
read access to /root, do you?

Pick a directory under /var or /usr (or wherever you have space
available; YMMV). I've used /var/SpamAssassin (and recently
/usr/SpamAssassin when other factors made /var a Bad Place for AWL and
Bayes files):

bayes_path /var/SpamAssassin/bayes

However, I've had to symlink the various bayes_* files in
~root/.spamassassin as sa-learn does not seem to respect the bayes_path
option in local.cf. :/

> I originally ran sa-learn as root. Do I need to change permissions
> on those to be used site-wide??

You'll need to chmod 666 bayes_* wherever the files are; and you'll
probably need to add

bayes_file_mode 0777

to local.cf to make sure that non-root users can *continue* to read (and
write if you've enabled autolearn) the bayes_* files, wherever you put
them.

-kgd
--
"Sendmail administration is not black magic. There are legitimate
technical reasons why it requires the sacrificing of a live chicken."
- Unknown
Re: Bayes not utilized? [ In reply to ]
> However, I've had to symlink the various bayes_* files in
> ~root/.spamassassin as sa-learn does not seem to respect the bayes_path
> option in local.cf. :/

I know what you mean. However, this worked: I made the directory
spamassassin in /var. Then I ran sa-learn from /var/spamassassin. The
local.cf has bayes_path /var/spamassassin.
sa-learn put the files in /var/spamassassin like expected!

> > I originally ran sa-learn as root. Do I need to change permissions
> > on those to be used site-wide??
>
> You'll need to chmod 666 bayes_* wherever the files are; and you'll
> probably need to add
>
> bayes_file_mode 0777
>
> to local.cf to make sure that non-root users can *continue* to read (and
> write if you've enabled autolearn) the bayes_* files, wherever you put
> them.

OK, it's starting to make sense, but I don't understand file modes - Can you
explain?
I'll try the above tomorrow when I have time to run sa-learn again. - John
Re: Bayes not utilized? [ In reply to ]
John Fleming wrote:
> OK, it's starting to make sense, but I don't understand file modes -
> Can you explain?

Basically, if you're running sitewide Bayes, you need to make sure that
*anyone* can both read AND write to the bayes_* files. Setting the
option in the SA configuration means that it will maintain the access
permissions properly; chmod'ing the existing files will make sure they
work correctly.

I think I had trouble with this myself; I've had a global Bayes setup
on the filter server here for almost a year now so I don't recall the
details very well any more. <g>

-kgd
--
"Sendmail administration is not black magic. There are legitimate
technical reasons why it requires the sacrificing of a live chicken."
- Unknown