Postfix/bogofilter addendum

jim jim at weathercom.com
Thu Nov 14 17:02:03 CST 2002


I just now had time to add a cron job that would periodically take the mail my 
users identified as spam or non-spam and feed them to bogofilter.  I had them 
forward any mail they received that was spam that bogofilter didn't catch to 
a special email address.  Likewise, any mail bogofilter id'd as spam but that 
wasn't is sent to another address.  This script, executed by cron, feeds 
those mails to bogofilter.

Jim Duey
Intensive Systems Consulting, LLC
Embedded Linux consulting

#!/bin/bash

if ls /home/notspam/Maildir/new/* > /dev/null 2>&1;
then
	chmod a+r /home/notspam/Maildir/new/*;
	cat /home/notspam/Maildir/new/* | sudo -u filter bogofilter -n -d 		
/home/filter/.bogofilter;
	rm /home/notspam/Maildir/new/*;
fi &&
if ls /home/spam/Maildir/new/* > /dev/null 2>&1;
then
	chmod a+r /home/spam/Maildir/new/*;
	cat /home/spam/Maildir/new/* | sudo -u filter bogofilter -s -d  		
/home/filter/.bogofilter;
	rm /home/spam/Maildir/new/*;
fi




More information about the Kclug mailing list