Changed to using email.parser-based parsing for headers.