Hi, On Die, Mai 27, 2003 at 09:28:15 -0500, Michael Weber wrote: > I am running SA 2.55 on a RH 7.3 box with perl 5.6.1 loaded for about > 120 users. I am thinking about writing two scripts to help with > managing SA. > > First, I want a script that looks at the /var/spool/mail/spam and > /var/spool/mail/ham files and feeds them into sa-learn after I check > them for any mis-filed messages. > > Second, I want a script that parses the /var/spool/mail/whitelist or > /var/spool/mail/blacklist files and adds the appropriate lines to the > local.cf file, again after a quick check. This is running on a gateway > so the prefs are all site-wide. I don't want to get into userprefs at > this point. > > Before I write the scripts, are there any available that already do > this? > > Also, are there any gotchas waiting for me that I haven't thought > about?
We've got a postfix/cyrus/spamd config running and two shell script, which feed ham and spam to spamassassin every night via a cron job. We read new spam and ham directly from the mail storage dirs (maildir format) of cyrus. The script looks like this: ---- snip ---- SALEARN="/usr/bin/sa-learn" for i in ${SPAMLEARNDIRS} do find ${BASEDIR}${i} -iname "*" -type f -maxdepth 1 | xargs ${SALEARN} --spam --file --no-rebuild 2>&1 > /dev/null done; for i in ${HAMLEARNDIRS} do find ${BASEDIR}${i} -iname "*" -type f -maxdepth 1 | xargs ${SALEARN} --ham --file --no-rebuild 2>&1 > /dev/null done; # Datenbank-Sync ${SALEARN} --rebuild ---- snap ---- It is run as user "filter" who does the site-wide filtering for postfix. User "filter" is in group "mail". Side-wide imap-mails belong to "cyrus/mail". We need to set permissions for the files in the maildir of the server to be readable for "filter": ---- snip ---- find /var/spool/imap/user/krase -type f | xargs chmod 640 find /var/spool/imap/user/krase -type d | xargs chmod 750 find /var/spool/imap/user/manuelm -type f | xargs chmod 640 find /var/spool/imap/user/manuelm -type d | xargs chmod 750 ---- snap ---- It has to be run as root. This is what we do. It only works, if you have users who sort FP/FN out of their spam/ham-folders every day. We do ;) HTH Manuel -- Manuel Möller | Markusstrasse 31 09130 Chemnitz | Fon: +49 151 127 174 28 www.manuelm.org | [EMAIL PROTECTED] ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk