barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

Fatal error while constructing ConnectionException #671

Closed hrst closed 1 year ago

hrst commented 2 years ago

https://github.com/barbushin/php-imap/blob/13bdfa9a6f541798253e24e2d8f44332c8be098c/src/PhpImap/Imap.php#L712

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to PhpImap\Exceptions\ConnectionException::__construct() must be of the type array, bool given, called in .../phpimap/Imap.php on line 712 and defined in .../phpimap/Exceptions/ConnectionException.php:16
Stack trace:
#0 .../phpimap/Imap.php(712): PhpImap\Exceptions\ConnectionException->__construct()
#1 .../phpimap/Mailbox.php(1715): PhpImap\Imap::open()
#2 .../phpimap/Mailbox.php(1676): PhpImap\Mailbox->initImapStream()
#3 .../phpimap/Mailbox.php(469): PhpImap\Mailbox->initImapStreamWithRetry()
...

\imap_errors() can also retrieve boolean false, which is probably what is happening.

Sebbo94BY commented 1 year ago

Fixed in version 5.0.1.