The raw MIME file contains headers, to, from, body, attachments, etc. I use a MIME file parser to grab all that information. The body is processed a little more to get rid of potentially dangerous content before it is stored
There are email parsing libraries which reads the raw headers and extracts relevant information(to, from, subject, body, attachments etc).