in reply to Parsing an email

I'd used Mail::Box working with a maildir folder or three (pulled down with offlineimap) moving things around based on headers. Might do what you need.

The cake is a lie.
The cake is a lie.
The cake is a lie.