Improve header parser to not split quoted strings

Fixes a bug where an attachment filename has a semicolon in it