imap icon indicating copy to clipboard operation
imap copied to clipboard

Too big mail exception

Open marcoberetta96 opened this issue 3 years ago • 1 comments

Q A
ddeboer/imap version 1.10.0
PHP version 7.2.*

Hi,

I noticed an issue happening when fetching a big mail (more than 100 MB). The mail can't be fetched and any method called on this mail causes the IMAP connection to be closed. Even the getId method breaks the IMAP connection.

I tried to catch a generic Exception in order to allow the other messages to be fetched, but this does not solve the issue. For all the other messages, the methods getRawHeaders() and getRawMessage() always return NULL.

I also tried to manually skip the first mail (the big one) by adding $messageNumbers = array_slice($messageNumbers, 1); in the constructor of MessageIterator and this solves the issue. Big mail is skipped and the other mails are fetched correctly.

It would be nice if an exception like MailTooBigException is triggered when the problem arises, and the other mails could be fetched normally.

Thanks!

marcoberetta96 avatar Jun 30 '21 07:06 marcoberetta96

You are right: if you find a way to do it, please ping me :thinking:

Slamdunk avatar Jul 06 '21 04:07 Slamdunk