Paul Matthews wrote:
> Hi there,
>
> at the moment I have the rules_du_jour script running every week and I
> have the script below running every night telling SpamAssassin to learn
> what I can from the uses junk mail folders, but I still seam to get a lot
> of junk mail that gets past the scanners, can anyone make any suggestions
> on something to do to block more spam?
>
> Also the way i have setup the script below, does that add what is being
> learnt from the sa-learn program into a database for all users, or just
> for the single user is runs as?
>   
Generally speaking, sa-learn only adds to the database for the current user.

HOWEVER, you're using -u $i to over-ride the username (note: you can
ditch the @localhost part SA will just strip it).

*BUT*, sa-learn -u will only work if you're using a virtual-user
configuration.

Based on the rest of the script, you're not doing virutual users. (ie:
sql, --virtual-config-dir, etc).

If you aren't using virutal user configs, your script will only learn
into the bayes DB for the current user invoking the script. It will not
learn to any other user's bayes DB. To do that, you'll have to have a
script invoke sa-learn through su.


> #!/bin/bash
>
> log="/var/log/procmail/SpamAssassin/sa-learn.log"
> echo"" >>$log 2>/dev/null
> date >>$log 2>/dev/null
> echo "" >>$log 2>/dev/null
>
> for i in $( ls /home/DOMAIN); do
>      echo $i >>$log 2>/dev/null
>      echo Reading /home/DOMAIN/$i/mail/Junk >>$log 2>/dev/null
>      sa-learn -p /home/DOMAIN/$i/.spamassassin/user_prefs -u [EMAIL PROTECTED]
> --siteconfigpath=/etc/mail/spamassassin --mbox --spam /home/CATHE$
> done
> echo "SpamAssassin Learn Program Has Run"
> /etc/init.d/spamassassin restart
>
>
>
>
>   

Reply via email to