http://www.cs.cmu.edu/~benhdj/Mac/junkMatcher.html
It’s basically a bunch of Python scripts glued to Mail.app via AppleScript rule action. It allows you to do IP-based junk filtering (spamcop.net), regular expressions matching, filename matching, etc. It also tries to defeat some of the tricks spammers throw at us nowadays by translating their encoded messages back to normal so matching can work.
Let me know if you have any suggestion/bug finding. In particular, I seem to have a random problem where if I have LOTS of spams (say 200+ - I have a sort of spam-trapping email account somewhere), some of the mails which got ID’ed correctly, would be moved to the Junk mailbox, but still leaving behind a copy in the inbox (so there’re 2 copies left overall). Let me know if you run into this problem too, or better, suggestions to how to fix it.
Thanks.