-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
issue fetching email #177
Comments
Unfortunately we don't know your code, so it would be helpful if you could show us how your query / pagination looks like. |
Hi Frank, Thank you so much in advance for taking care of this so sun. $mail = new Imap([
'host' => config('env.HOST'),
'port' => config('env.PORT'),
'user' => $mailbox->local_part,
'password' => md5($pass->password),
'ssl' => config('env.ENCRY'),
'novalidatecert' => config('env.VERIFY'),
]);
$cantidad = $mail->countMessages();
$ini = ($page * 10) + 1;
$end = (((($page * 10) + 10) <= $cantidad ) ? ($page * 10) + 10 : $cantidad);
for($j = $ini - 1; $j < $end; $j++) {
$mail[$j]->getContent();
} Sincerely Maykel |
From your logic, I can see that laminas-mail/src/Storage/AbstractStorage.php Lines 211 to 221 in b9c896e
That will in turn go to laminas-mail/src/Storage/Imap.php Lines 104 to 122 in b9c896e
Could it be that counting messages is the slow part? laminas-mail/src/Storage/Imap.php Lines 59 to 87 in b9c896e
I'd suggest writing a test to verify the issue and sending a patch, @mjac1521. |
Hi Marcos, Sincerely Maykel |
Right, what I'm asking for is if you can design an integration test for the We can't design this for you, given availability of contributors. |
Summary
I have an email account with more than 15 000 emails in the Sent folder. I create a web interface similar to gmail using Laminas IMAP to fetch the emails from postfix wish use Dovecot to serve the IMAP service.
Current behavior
When I try to access the folder Sent in my interface it take more than 1 minute to show me the emails. I am using pagination so to show me the email in page 1 it take more than a minute, the same for page 2 and so on. I believe every time I hit a page it is reading the whole 15 000 emails to only show me 20 in a page.
How to reproduce
Adding 15 0000 emails o more to a folder. In my case the folder is Sent.
Expected behavior
Laminas-IMAP should fetch emails in a matter of seconds
Sincerely Maykel
The text was updated successfully, but these errors were encountered: