To answer your unnumbered opening question, email headers start with the five characters "
" header) and end when a blank line is encountered. The various "
"-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.