You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Chris <cp...@earthlink.net> on 2004/02/14 04:50:48 UTC

Newbie setting up Bayes

I'm really new to SA and just upgraded last night to 2.63.  I'm trying to 
get Bayes filtering setup.  I have the following in my local.cf which is 
located in /etc/mail/spamassassin:

# Enable Bayes auto-learning
auto_learn              1
bayes_path /etc/mail/spamassassin/bayes

I took this from the spamassassin wiki for site wide Bayes filtering.  The 
problem is, and maybe its not a problem, that my bayes_seen and bayes_toks 
files are in /home/chris/.spamassassin.  Will they be read correctly from 
this directory since all my rule files are in /etc/mail/spamassassin?  If 
not, what do I need in my local.cf file to put them in there and have them 
read?

Thanks
Chris

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
  9:44pm  up 10 days,  4:33,  6 users,  load average: 1.18, 1.02, 1.01


Re: Newbie setting up Bayes

Posted by jdow <jd...@earthlink.net>.
Chris, it SEEMS like manual training works best. I turned off auto-training
and manually trained. It took about two days to acquire about 400 spams and
700 or 800 hams on my account. I used a simple minded rule to create a
~/mail/rawmbox in my home directory. Then I ripped through it with the old
"mail" program. The REAL filtered mail comes through a POP3 server on that
machine and I read it on this Winders box. (Hey, Linux is where a heart may
lie but Winders is where my income lies. So....{^_-})

It took some nose holding for about 2 hours total on those two days to get
.63 trained here and remarkably well behaved. Now I will take the rare
missive that sneaks through and manually find it, again with "mail", toss
it into the spam database, and retrain. That's about all of 2 minutes of
my time. I could probably get away with auto-train now. But then it would
be like inbreeding when its the messages that escape I want to use for
training. Of course, I may be all wet. I'm simply relating what has given
me most gratifying results.

{^_^}
----- Original Message ----- 
From: "Chris" <cp...@earthlink.net>


> I'm really new to SA and just upgraded last night to 2.63.  I'm trying to
> get Bayes filtering setup.  I have the following in my local.cf which is
> located in /etc/mail/spamassassin:
>
> # Enable Bayes auto-learning
> auto_learn              1
> bayes_path /etc/mail/spamassassin/bayes
>
> I took this from the spamassassin wiki for site wide Bayes filtering.  The
> problem is, and maybe its not a problem, that my bayes_seen and bayes_toks
> files are in /home/chris/.spamassassin.  Will they be read correctly from
> this directory since all my rule files are in /etc/mail/spamassassin?  If
> not, what do I need in my local.cf file to put them in there and have them
> read?


Re: Newbie setting up Bayes

Posted by Raquel Rice <ra...@thericehouse.net>.
On Fri, 13 Feb 2004 21:50:48 -0600
Chris <cp...@earthlink.net> wrote:

> I'm really new to SA and just upgraded last night to 2.63.  I'm
> trying to get Bayes filtering setup.  I have the following in my
> local.cf which is located in /etc/mail/spamassassin:
> 
> # Enable Bayes auto-learning
> auto_learn              1
> bayes_path /etc/mail/spamassassin/bayes
> 
> I took this from the spamassassin wiki for site wide Bayes
> filtering.  The problem is, and maybe its not a problem, that my
> bayes_seen and bayes_toks files are in /home/chris/.spamassassin. 
> Will they be read correctly from this directory since all my rule
> files are in /etc/mail/spamassassin?  If not, what do I need in my
> local.cf file to put them in there and have them read?
> 
> Thanks
> Chris
> 

Chris,

I'll show you what I have setup for my site-wide filtering ... which
seems to be working.

use_bayes 1
bayes_auto_learn 1
bayes_auto_learn_threshold_spam 10
auto_learn 1

bayes_path /usr/spamassassin/bayes
auto_whitelist_path /usr/spamassassin/auto-whitelist

bayes_file_mode 0777
auto_whitelist_file_mode 0777

Some of those first 4 may be redundant, specifying what is the
default.  I don't remember.

Be sure that all users can read/write to your bayes and
auto-whitelist.  

After you make changes, also be sure to restart spamassassin.

-- 
Raquel
============================================================
Never fear shadows.  They simply mean there's a light shining
somewhere nearby.
  --Ruth E. Renkel


Re: Newbie setting up Bayes

Posted by John Fleming <jo...@wa9als.com>.
----- Original Message ----- 
From: "Chris" <cp...@earthlink.net>
To: <sp...@incubator.apache.org>
Sent: Friday, February 13, 2004 10:50 PM
Subject: Newbie setting up Bayes


I'm really new to SA and just upgraded last night to 2.63.  I'm trying to
get Bayes filtering setup.  I have the following in my local.cf which is
located in /etc/mail/spamassassin:

# Enable Bayes auto-learning
auto_learn              1
bayes_path /etc/mail/spamassassin/bayes

I took this from the spamassassin wiki for site wide Bayes filtering.  The
problem is, and maybe its not a problem, that my bayes_seen and bayes_toks
files are in /home/chris/.spamassassin.  Will they be read correctly from
this directory since all my rule files are in /etc/mail/spamassassin?  If
not, what do I need in my local.cf file to put them in there and have them
read?

Thanks
Chris
----------------------------------------

Chris, I just went through this as a newbie too!  It is not straightforward,
as you've learned.  It seems to matter what directory you're in when you run
sa-learn.  As someone told me, "bayes_path" does not seem to be
well-respected.

Mine works now - THANKS GUYS!  I agree with what Raquel said.  What I did
was set up a directory where I wanted to put the toks and seen files.  I set
permissions there to 0777.  I also used the bayes_file_mode 0700 statement
in local.cf.  Furthermore, I made sure I (as root) was -IN- the desired
directory where I wanted the data files to go when I ran sa-learn!
(/var/.spamassassin in my case)  That worked.  It was the combination of
actually getting the files where the bayes_path statement expected and
getting the permissions that made it finally work for me - and it works
GREAT BTW!

Here's my local.cf snippet:

use_bayes 1
bayes_path /var/.spamassassin/bayes
bayes_file_mode 0777
bayes_auto_learn_threshold_nonspam 0.1
bayes_auto_learn_threshold_spam 10.0
bayes_auto_learn 1

The other thing that wasn't clear to me as a newbie is that if your bayes
path is as above, the toks and seen files are put in /var/.spamassassin as
bayes_toks and bayes_seen.  The "bayes" in that path statement just tells it
to APPEND the toks and seen names to bayes_ -IN- the .spamassassin file.  (I
originally expected them to be in the /var/.spamassassin/bayes directory!)

Does that help you?  I was dying trying to get this going as a newbie, but
it was well worth the effort.  If you want to compare notes more off-list,
do not hesitate to email me.

Finally, if you haven't already, print and read the man pages!  I found
those more helpful than some of the other information available on the Net.

Good luck - John