--On 10-10-03 6:47 pm +0100 Alan J Fitton wrote:
All the ways to use sa-learn I've seen only appear to be relevant when
mail is scanned as the user who is receiving it, ie. with procmail.

I'm using a milter (mail filter) in sendmail for site wide scanning, which
works very well. I would like for each users "Not_Recognised" mbox to be
run through sa-learn --spam to remember what it has learned for each user,
as a cron job. If this isn't possible, having it using what it learns from
each users "Not_Recognised" mbox going site wide would be ok (but not
preffered), since theres only a small number of all trusted users. I
really can't work out how to do either of these things.

At my site I have a shared folder that all users dump their untagged spam into, but using per-user folders should also work. Try something like the following (not tested):


#! /bin/sh

for homedir in `awk -F: '{ print $6 }' /etc/passwd | sort -u`; do
   mailbox="$homedir/mail/Not_Recognised"
   if [ -f $mailbox ]; then
       # learn spam from this mailbox
       sa-learn --no-rebuild --spam --mbox $mailbox
       # empty the mailbox
       cat /dev/null > $mailbox
   fi
done
sa-learn --rebuild

Run from cron daily. You may need to set an appropriate $HOME at the beginning of the script. The script would be more robust if written in perl, of course.

-Kevin




------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. SourceForge.net hosts over 70,000 Open Source Projects. See the people who have HELPED US provide better services: Click here: http://sourceforge.net/supporters.php _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to