Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mailbox has more messages (.......) exist than maximum (....) #2593

Closed
ivanghisleni opened this issue Jul 21, 2023 · 1 comment
Closed

Mailbox has more messages (.......) exist than maximum (....) #2593

ivanghisleni opened this issue Jul 21, 2023 · 1 comment

Comments

@ivanghisleni
Copy link

From manual page: https://php.net/function.imap-fetch-overview

I'm facing this error and I don't know how to solve it..

PHP Notice: Unknown: Mailbox has more messages (1057204) exist than maximum (1000000) (errflg=2) in Unknown on line 0

PHP version: 7.4.32

Code:

<?php

$mbox = imap_open("{******:993/imap/ssl/novalidate-cert}INBOX", "*****", "*****")
     or die("can't connect: " . imap_last_error());

var_dump("Listing");

$MC = imap_check($mbox);

$range = 20;

var_dump($MC->Nmsgs);


// Fetch an overview for all messages in INBOX
$result = imap_fetch_overview($mbox,"1:{$range}",1);
/*foreach ($result as $overview) {
    echo "#{$overview->msgno} ({$overview->date}) - From: {$overview->from}
    {$overview->subject}\n";
}*/
imap_close($mbox);

@damianwadley
Copy link
Member

Some quick Googling says that the library PHP uses for imap support isn't able to handle more than 1M messages in a single folder, and that you're probably running into performance issues because of how many there are.

1M messages is too many for a human being to deal with. You probably should set up some inbox filtering and processing rules to distribute your messages into folder categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants