Even if 99% of why you are looking into this is for the
challenge of writting code that can identify spam,
don't start from scratch. Become a
SpamAssassin
Contributor and write new spam tests that fit into the
architecture -- that way lots of people can take advantage
of your efforts WHILE using SpamAssassin.