in reply to Archive mail into a database

How about using some existing modules to parse the emails instead of using regexes. With a quick search on cpan I found Email::Simple and Email::Abstract, I don't know if they are of any value.