|
A collection of useful facts by Joel Williams. Adelaide denizen. Computer tinkerer. Former terrestrial ecology student of Flinders University. PhD candidate at ANU. Editor for freshmeat.net. Adelaide University Mountain Club member and outdoor enthusiast. Occasional networking go-to guy. Contact me by email at joel at this domain. |
Maildir Spam CheckingI wrote this script when confronted with giant Maildir directories full of email, most likely spam, usually as a result of unwatched catch-all accounts. #!/bin/sh
for i in *; do
if cat $i | spamc | grep "X-Spam-Level: \*\*\*\*" ;
then
rm $i
fi
done
You can configure the threshold at which messages are deleted by adding more \* sequences to taste. I tend to sort things into folders. The following cron job categorises things saved into my 'saved' folder as ham. I assume that things that I put into more specific folders are either filtered there by procmail, or are from specific people that are on the auto whitelist and never get misclassified. find /home/joel/Maildir/.saved/cur/ -type f -mtime -1 -print | xargs sa-learn --ham More notes on my spam strategy are available at MuttMaildirCaching. |