
danilcha - 2017-07-20 19:50:55
Dear Manuel,
Thank you again for your parser! I'm using them for already almost 10 years.
Recently we started to receive emails that fail to be properly parsed. This is probably because we switched to Office 365, which appends hundreds of header lines.
This is one of such messages: https://www.dropbox.com/s/1imr5556b02g8m4/mail1530913.eml?dl=0
If you parse it, it is parsed, and detects 2 parts. The second part is OK, but the first pars is left unparsed. It sees the whole part, including the headers, as the content. I use the following code to check it:
$parser = new mime_parser_class();
$decoded = null;
$parser->Decode(['File' => 'mail1530913.eml'], $decoded);
print_r($decoded[0]['Parts'][0]['Headers']);
It outputs no headers. However, if I add or delete a single character from any header of the main part, it outputs the correct headers:
[content-type:] => text/plain
[some-other-header:] => present