Trouble adding Gmail as inbound email (IMAP) in SuiteCRM 8.2.4 on Debian (Bitnami)

Hi everyone,

I am running a new SuiteCRM 8.2.4-4 instance on Debian, packaged by Bitnami, and I am facing issues when trying to set up an inbound email account for a Google Workspace address. Here are the details of my installation:

  • SuiteCRM 8.2.4-4 on Debian 11.6, running on an AWS EC2 instance
  • PHP v8.1.17
  • Apache/2.4.56 (Unix) server
  • SSL certificates installed

Google Workspace & Gmail settings:

  • I am using an app password
  • IMAP & SMTP enabled in my Gmail settings
  • Outbound email working
  • Inbound Email working on a fresh SuiteCRM 7.13 using the same account and AWS security group.

Issue adding email from Admin → Inbound Email:
After clicking the “Monitored Folder” button in the “Inbound Emails” section, a blank modal pops up.

If I manually type “INBOX” into the Monitored Folder field, I can successfully pass the Test Connection and observe a successful 200 server response in the browser network tab. I’m also able to save the Inbound Email record with the manually typed Monitored Folder.

However, when I try to view the Email module, I get the following error in the log:

[FATAL] Couldn't connect to mail server id: xxxxx-xxxx-xxxx-xxxx-xxxxx

I also get a 500 server response in the browser network tab.

Other things I’ve tried:

  • Removed whitespace before <?php tag in the /opt/bitnami/suitecrm/public/legacy/modules/InboundEmail/metadata/editviewdefs.php
  • quick repair and rebuild
  • Adjusted log to debug:
[3778][1][DEBUG] Using imap handler type: native
[3778][1][DEBUG] Using imap handler class: ImapHandler
[3778][1][DEBUG] ImapHandlerFactory will using a ImapHandler
[3778][1][WARN] incorrect service given: 
[3778][1][DEBUG] ---------------STARTING FINDOPTIMUMS LOOP----------------
[3778][1][DEBUG] 1: I-E testing string: {imap.gmail.com:993/service=imap/ssl/tls/validate-cert/secure}INBOX
[3778][1][WARN] ImapHandler trying to set a non valid resource az stream.
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][DEBUG] 1: I-E found good connect using [{imap.gmail.com:993/service=imap/ssl/tls/validate-cert/secure}INBOX]
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][DEBUG] 1: I-E clearing error and alert stacks.
[3778][1][DEBUG] ---------------end FINDOPTIMUMS LOOP----------------
[3778][1][WARN] Requested folder is not defined
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][WARN] ImapHandler trying to use a non valid resource stream.
[3778][1][WARN] Connection is not a valid resource.
[3778][1][DEBUG] Hook called: InboundEmail::after_ui_frame
[3778][1][DEBUG] Creating new instance of hook class hooks without parameters
[3778][1][DEBUG] Creating new instance of hook class AssignGroups without parameters
[3778][1][DEBUG] Hook called: ::after_ui_footer
[3778][1][DEBUG] Creating new instance of hook class AssignGroups without parameters
[3778][1][DEBUG] Hook called: ::server_round_trip
[3778][1][DEBUG] Calling MySQLi::disconnect()

Any help would be appreciated!

2 Likes

Same problem here.
PHP 8.1 on Blue Host shared CentOS. Same log errors. Also tried various PHP versions.

Same problem. I’ve tried downgrading PHP to 8.0, cherripicking different patches which supposedly could be related. No progress so far. I’m on SuiteCRM 8.3.0

I had the same problem and solved it by installing the php-imap package.

Try looking at the apache logs, you should be able to find the answer there.