in reply to Parsing email for headers

To answer your unnumbered opening question, email headers start with the five characters "From" (note the trailing space and no colon, which distinguish it from the "From:" header) and end when a blank line is encountered. The various "---Part"-type separators, if present, occur within the body of the email message after a blank line has indicated end-of-headers, so you don't need to rely on (or try to parse) them.