libmmail and mmail are minimal software for parsing, manipulating, verifying, and serializing email messages. You may enjoy them if you want to programmatically parse and process email messages for delivery.