A short time ago, I noticed that I was spending a lot more time deleting spam than reading actual mail, so I did a little research into procmail and spam filtering using Perl. Mark-Jason Dominus wrote an excellent series of articles for Perl.com that helped me through writting the code for this program:
As a result, I developed a Perl procmail filter that's very effective at blocking spam. I now receive a random spam email every now and then, but the majority of it is blocked and never reaches my inbox.
Note: spamfilter.pl is open-source, free software distributed under the GNU Public License.