Group email auto import not working

SuiteCRM 8.4.2
PHP 8.2
Connected to gmail imap via unsecure password. Manual import works ok. Cron is running, emails are not imported. This is suitecrm.log:

Tue Nov 28 09:30:02 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Nov 28 09:30:02 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Nov 28 09:30:04 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] An Imap error detected: “IMAP search error”
Tue Nov 28 09:30:05 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] An Imap error detected: “IMAP reopen error”
Tue Nov 28 09:30:05 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] An Imap error detected: “IMAP search error”
Tue Nov 28 09:30:05 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] An Imap error detected: “IMAP expunge error”
Tue Nov 28 09:30:05 2023 [650607][2717a13d-d3ef-6b62-8d30-5afaa2d7ed98][FATAL] An Imap error detected: “IMAP close error”

That error has been there forever but doesn’t prevent import. Don’t know about “gmail auto import” since we don’t use … gmail … but regarding IMAP, sure we’ve got them:

Wed Nov 29 10:40:01 2023 [1390166][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:40:02 2023 [1390166][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:41:01 2023 [1390260][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:41:01 2023 [1390260][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:41:02 2023 [1390260][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:42:01 2023 [1390355][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:42:01 2023 [1390355][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:42:02 2023 [1390355][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:43:01 2023 [1390453][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:43:01 2023 [1390453][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:43:02 2023 [1390453][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:44:01 2023 [1390548][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:44:01 2023 [1390548][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:44:02 2023 [1390548][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:45:02 2023 [1390643][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:45:02 2023 [1390643][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:45:02 2023 [1390643][1][FATAL] An Imap error detected: "IMAP search error"
Wed Nov 29 10:46:02 2023 [1390741][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:46:02 2023 [1390741][1][FATAL] ImapHandler trying to use a non valid resource stream.
Wed Nov 29 10:46:02 2023 [1390741][1][FATAL] An Imap error detected: "IMAP search error"

We are still able to import emails etc.

But that is the only error in debug mode. What else can i do?

Also getting this error trying to retrieve folders when configuring group inbound email. On version 8.4.2, php 8.1. I’ve seen fixes for something similar around version 7.13. Does anyone know if that fix is on the version 8 branch or is this a different problem?