Closed slewocom closed 2 years ago
Hi there,
\PhpImap\Imap::open returns a resource with php 8.0. But with 8.1 it returns an IMAP\Connection Object.
Source: The IMAP functions now accept and return IMAP\Connection objects instead of imap resources. https://www.php.net/manual/en/migration81.incompatible.php
This causes \PhpImap\Mailbox::initImapStreamWithRetry to retry the connection multiple times.
A fix could probably be to change \PhpImap\Imap::ping to something like this:
I think this needs further investigation.
Thanks for the bug report @slewocom !
Also thanks for the hints and solution @christianasche !
I've implemented the suggested change and tested it using different PHP versions. It seems to fix the here reported issue, which I could reproduce before and it does not break on an older PHP version as far as I could see using my tests and the PHP Unit tests.
I've released a new version 4.5.1 with this fix.
Hi there,
we have updated from PHP 7.4 to PHP 8.1 and after the update the PHP Imap email import is very slow.
We have now done a time measurement and particularly concerns the getMail function. This function took about 3 seconds for the same email with PHP 7.4 and with PHP 8.1 the function takes over 63 seconds. The system is the same and the PHP settings are the same.
Is this problem known and is there a solution?