Help with sa-learn

Benjamin J. Weiss benjamin at birdvet.org
Mon Dec 27 19:24:37 UTC 2004


I've got my home email server running, with spamassassin's spamc being 
called via procmail.  So far, so good.  Now I'm trying to get bayesian 
filtering to work.

I've only got four email accounts on my home server.  I get a bunch of 
ham (email lists. :) ) and not much spam.  My mom gets a bunch of spam, 
and not much ham.  So, since the bayesian system needs both to learn the 
difference, I'd like to set it up so that a root cron job learns from 
all of our maildirs at night.  Then, when procmail calls spamc, I'd like 
for the spamc/spamd to use the bayesian stuff that root learned.

I hope that made sense. LOL

 From what I've been able to gather on the internet, I'll know when it's 
working because I'll start seeing BAYES_XX tests in the X-Spam-Status 
header, which I haven't seen.  And I've run a few thousand emails 
through this thing now, so I'm beginning to wonder.

Here's the cron job that I've been running at night:

#!/bin/bash
HOME=/root
export HOME
echo `date`

for i in /home/*; do
   echo "User: $i"
   echo "$i/Maildir/.spam-yes/cur/"
   sa-learn --no-rebuild --spam $i/Maildir/.spam-yes/cur/*

   echo "$i/Maildir/.spam-yes/new/"
   sa-learn --no-rebuild --spam $i/Maildir/.spam-yes/new/*

   echo "$i/Maildir/.spam-no/cur/"
   sa-learn --no-rebuild --ham $i/Maildir/.spam-no/cur/*

   echo "$i/Maildir/.spam-no/new/"
   sa-learn --no-rebuild --ham $i/Maildir/.spam-no/new/*
done
sa-learn --rebuild

Here's my /etc/sysconfig/spamassassin:

# Options to spamd
SPAMDOPTIONS="-d -c -a -m5 -H /root"


Here's my /etc/mail/spamassassin:

required_hits 5
rewrite_subject 1
subject_tag [SPAM]
report_safe 0

use_razor2 1
use_bayes 1


Any ideas?

Thanks!

Ben




More information about the redhat-list mailing list