I started on a project to parse email headers in order to report spam. It was more difficult than i thought, but I still haven't finished it.
I guess parsing headers like From: To:, etc would be easier..
check out preg_ functions and brush up on those regular expressions. Trust me, learning regex is vital, and PCRE are 10x easier once you understand them...
p.