imap icon indicating copy to clipboard operation
imap copied to clipboard

Crash getting message sequence with error: Mailbox has more messages

Open ivanghisleni opened this issue 2 years ago • 3 comments

Q A
ddeboer/imap version 1.12.4
PHP version 7.4.32
IMAP provider pec.it

Summary

I'm facing a mailbox with 1523650948 messages and when I try to get the message sequence [1:2000] it crash, I tried to reproduce with openssl access and I'm able to get this message sequence.. Is there a way to fix or avoid this behaviour?

Current behavior

when I call $messages = $outerMailbox->getMessageSequence($uidRange);

I got this error:

Ddeboer\Imap\Exception\InvalidSearchCriteriaException:Invalid sequence [1:2000] imap_alerts (0): imap_errors (1):

  • Mailbox has more messages (1056880) exist than maximum (1000000) at .../vendor/ddeboer/imap/src/Mailbox.php:157

ivanghisleni avatar Jul 21 '23 14:07 ivanghisleni

I'M trying to debugging and the issue seems related to:

$result = imap_fetch_overview($mbox,"1:{$range}",0);

ivanghisleni avatar Jul 21 '23 15:07 ivanghisleni

Since I don't have a mailbox with one and a half billion messages, I cannot reproduce the bug.

If you find a solution, please post it here so we can discuss on it

Slamdunk avatar Jul 24 '23 09:07 Slamdunk

Bad news for us: https://github.com/php/doc-en/issues/2593

ivanghisleni avatar Jul 24 '23 14:07 ivanghisleni