HelpDeskZ Community
Imap fetch error - Printable Version

+- HelpDeskZ Community (http://community.helpdeskz.com)
+-- Forum: HelpDeskZ 2 (http://community.helpdeskz.com/forum-3.html)
+--- Forum: Support (http://community.helpdeskz.com/forum-5.html)
+--- Thread: Imap fetch error (/thread-2135.html)



Imap fetch error - vlad - 05-18-2022

Hello, i am trying to set up the imap fetcher, however i am getting the following error in the logs:

Code:
ERROR - 2022-05-18 06:42:44 --> IMAP connection failed: InvalidArgumentException: Argument 1 passed to PhpImap\Imap::search must be a valid resource! in /var/www/html/hdz/vendor/php-imap/php-imap/src/PhpImap/Imap.php:1077
Stack trace:
#0 /var/www/html/hdz/vendor/php-imap/php-imap/src/PhpImap/Imap.php(1094): PhpImap\Imap::EnsureResource()
#1 /var/www/html/hdz/vendor/php-imap/php-imap/src/PhpImap/Imap.php(821): PhpImap\Imap::EnsureConnection()
#2 /var/www/html/hdz/vendor/php-imap/php-imap/src/PhpImap/Mailbox.php(621): PhpImap\Imap::search()
#3 /var/www/html/hdz/app/Libraries/MailFetcher.php(51): PhpImap\Mailbox->searchMailbox()
#4 /var/www/html/hdz/app/Controllers/MailFetcher.php(16): App\Libraries\MailFetcher->parse_imap()
#5 /var/www/html/hdz/framework/CodeIgniter.php(936): App\Controllers\MailFetcher->imap()
#6 /var/www/html/hdz/framework/CodeIgniter.php(432): CodeIgniter\CodeIgniter->runController()
#7 /var/www/html/hdz/framework/CodeIgniter.php(333): CodeIgniter\CodeIgniter->handleRequest()
#8 /var/www/html/index.php(44): CodeIgniter\CodeIgniter->run()
#9 {main}

When using an custom php for testing the connection with the mbox = imap_open('{'.$mail_server.':'.$mail_port.'/imap/ssl/novalidate-cert}INBOX', $mail_username, $mail_password) or die('Error opening mailbox: '.imap_last_error()); i am able to fetch the emails.


Any pointers ?

Thanks.

Vlad.