Error in Email: An Imap error detected: "IMAP close error" & ImapHandler trying to use a non valid resource stream

I’,m trying help to a small business and I am trying to use CRM Suite 8.4.2, and I have 2 problems that I think are associated with the same thing.

  1. Admin → Inbound Mail (settings):
    when I set my “INBOUND EMAIL ACCOUNTS” → edit: select a “MONITORED FOLDERS:*” (I can attach my folders without problems) and then when I put donde, in the general log (suitecrm.log) apears:

[8505][1][FATAL] An Imap error detected: “[8505][1][FATAL] An Imap error detected: “IMAP close error””, may be the issue is in the code 1 or 2 attached in the .txt.
(test options for imap works good (I think))

  1. when I access my email, although it is true I can see what is in the inbox, but when I select sent or another folder, the log at that moment (seen by the console through a tail) gives me the error : “[1][FATAL] ImapHandler trying to use a non valid resource stream.”

I have uploaded 2 example photos,
I think the error is in:
/var/www/SuiteCRM/public/legacy/modules/InboundEmail/InboundEmail.php

but I don’t know what should be corrected

ERROR IN LOGS
Sun Jul 14 18:04:45 2024 [8492][1][FATAL] ImapHandler trying to use a non valid resource stream.

PATH: /var/www/SuiteCRM/public/legacy/modules/InboundEmail/InboundEmail.php

I found in InboundEmail.php the 3 code fragments “protected function getImapConnection”, “foundGoodConnection”,
and “public function connectMailserver” what section did I code and what part should I modify specifically?

Note I have tested version

SuiteCRM_7.14.4
SuiteCRM_8.4.2
and the error is the same with Gmail

1 Like

Thank you very much for the video!!, I have reviewed it to the letter and the error continues (note, I can write emails without problems and I see the mailbox), when I enter the email module, I see my inbox but when I select trash or sent emails instantly returns me to sent emails and the log continues to show:
[FATAL] ImapHandler trying to use a non valid resource stream.

That’s how mine works too. You only have visibility on the inbox and the “[FATAL] ImapHandler trying to use a non valid resource stream.” has been showing up in the error log for quite some time for many past versions. You might want to open up a bug report on Github.

Hi @rsp and @pstevens , thanks for your recommendation, which is the Github link to forward this topic? thanks!

You can check among these existing issues or create a new one.

issue is opened in Github
→ Error in Email: An Imap error detected: “IMAP close error” & ImapHandler trying to use a non valid resource stream · Issue #10472 · salesagility/SuiteCRM · GitHub

thanks!