Open michalbundyra opened 4 years ago
I believe a clarification is in order: I simply cannot fetch these messages. It doesn't matter if I catch this Exception or not, which is the reason for this issue.
Originally posted by @galvao at https://github.com/zendframework/zend-mail/issues/193#issuecomment-362932832
Update: Using the second method (count + for loop) it's possible to catch the Exception, but still, every single message causes this Exception, making the task of reading these messages absolutely impossible. Since Custom Headers seem to be a common thing, I'd remove this exception entirely or at least modify Zend\Mail so the presence of such a header doesn't block the entire operation of fetching a message.
Originally posted by @galvao at https://github.com/zendframework/zend-mail/issues/193#issuecomment-369824682
What about using
const EOL = PHP_EOL;
const FOLDING = PHP_EOL . " ";
in https://github.com/laminas/laminas-mail/blob/2.13.x/src/Headers.php#L30
PHP 7.2.2, Zend Mail at it's latest version as of today.
I'm opening an old mailbox file generated by Mozilla Thunderbird (please note that I get the same issue with other Thunderbird mailbox files). It has 2,521 messages and every single one of them causes this Zend\Mail\Exception\RuntimeException.
This issue happens:
And it's located at zendframework/zend-mail/src/Headers.php on line 109.
The exact headers causing the issue are X-Mozilla-Status and X-Account-Key. See the sample below (I've removed [potentially] sensitive data such as e-mail addresses, etc... for obvious reasons).
Originally posted by @galvao at https://github.com/zendframework/zend-mail/issues/193