I'm hoping that somebody here has done what I'm attempting to do.

My users use a web-mail front end for reading email. There is an option to
Mark-As-Spam which moves the message into a SPAM folder and removes it from their current folder. Very easy to train even the most inexperienced users to
do this!

The tricky part comes when training Spam Assassin. I'd like a nightly script to run for every user without the need for a cron job for every single user. This ideal single script would train Spam Assassin as if it were each user in turn
and sync their personal database.

Something like this pseudo-script:
for each user in /home
 sa-learn --ham the-ham-folder
 sa-learn --spam the-spam-folder
 sa-learn --sync
next user

It seems so simple but I'm having all kinds of trouble getting sa-learn to
understand that I'm changing users and databases.

It sounds like you need to use the -u flag to sa-learn. I also specify this on the sa-learn command line:

--prefs-file=/dev/null

so that it doesn't try to create a .spamassassin directory for the user.

You might also consider using find or some other utility to isolate users who have spam or ham to be scanned, rather than trying it for every single user; that might save some processor cycles.

Reply via email to