Kieran - 2021-01-21 18:19:07
The parser fails to decode single part, base64 encoded, text content which is longer than 8000 characters (the default buffer length).
$mimeParser = new mime_parser_class;
$mimeParser->ignore_syntax_errors = 1;
$mimeParser->Decode(['File' => '...', 'SaveBody' => '...'], $decoded);
The parser reads in chunks of 8000 and ends up partially parsing the base64 encoded content. It detects the partial body and attempts to decode it. It then decodes the rest of the body separately which results in broken base64 decoded data.
It should really only decode once it's got all the data.
@Manuel I've emailed you a copy of the email which causes the issue.