Many thanks to everyone for the helpful suggestions so far! I've managed to patch together a Bash script that is close to what I'd like. Currently it's
just dumping out the magic data, for testing purposes.

As a note, simplying using the -u <username> doesn't work as sa-learn attempts to use the bayes database for 'root' and not for <username>. So I tried the additional command line switches. (see the 'sudo' command in the code below)

Are you sure? I do something similar to what you're doing - using a script running as root to traverse user spam directories and learn from messages - and there's no entry in my bayes_vars table for root. I use this to invoke it:

sa-learn -u $username --prefs-file=/dev/null --spam --no-sync $file

I'm using SA 3.1.1 with a MySQL 5.0 database, if it makes a difference.

Reply via email to