SuiteCRM8 inbound email account OAuth fails

Hi everybody,
Using SuiteCRM 8.4 (last release).
As I’m using a mailbox on office365, I have to set up the OAuth to access to the mailbox.
Right now, I have followed exactly the doc and correctly add the provider and the connexion.

Arrrived at the point where I want to add the inbound email account, I follow again the doc and get a :
“Can not authenticate to IMAP server : Empty password”.
I already checked the setting maybe 10 or 15 times, read again the doc, but I cant figure out how to get the email box working…
I also check Google to try to find a solution : read many post with similar issue, but no working solution…

Is there somebody to help me on this ?
Thanks a lot,
Xavier

To get a more in-detail overview of the above error message, can you also share the Logs?

Hi farhan4648gul,
In SuiteCRM8, I have in public/legacy/ the suitecrm.log
Here is the last line of the file (as I did not find how to put a file here) :


Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: yes"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: 0"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl}INBOX"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: yes"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: 0"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap}INBOX"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: yes"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: 32768"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap}INBOX"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: yes"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: 32768"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap}INBOX"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: yes"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "ImapHandler:open: 32768"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: Empty password"
Fri Sep 22 18:12:50 2023 [11975][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}inbox"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: 512"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}inbox"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "ImapHandler:open: 512"
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.
Fri Sep 22 18:26:57 2023 [3168][1][FATAL] ImapHandler trying to use a non valid resource stream.

The above lines are the same as I have tried so many times…
Thanks for your expert eyes on this :slight_smile:
Xavier

There was a bug recently where it wasn’t saving the password. Check in the DB directly and see if there ia a password saved there (it will be encrypted).

Hi Pstevens,
Ok, but how to put the password correctly ?
In the database, there is no password (checked : “null”) as OAuth save a connexion and dont ask after the password for the inbound email account.
How then to encrypt the password ? Is this the password for the email or any other secret key to put here ?

Thanks :slight_smile:
Xavier

Ok, to try on my side, I have done this :
To try to get the password “encrypted”, I have create a “false” inbound email and type the password in this, then save.
In the database, I can see the false inbound email box with then a password stored.
Then, I have copy paste the “encrypted pasword” from the false inbound email to the Oauth email box and save in the database.
The result is not exactly the same : I have “login or password incorret.” but i’m very sure of the email and the password, except if the encoding is not the same between the “classic” inbound email box and the “OAuth” inbound email box…

I’m still stuck here and i’m sure people have already found this issue and found a solution : if anybody could give me then the “how to”… The CRM is not usable at all if I cannot link an email by OAuth…

Thanks…
Xavier

Hi,
I saw a post of Pstevens where he says the password is not the account password but the app password.

I tried then to put directly in the database for the inbound message the password but this is not working…

The log give me now :

Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: 512"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: parchemin@orsac-cpa01.fr"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "ImapHandler:open: 512"
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error | debug data end "
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] ImapHandler trying to use a non valid resource stream.
Tue Sep 26 10:02:43 2023 [7575][1][FATAL] An Imap error detected: "Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."

So the password is readen in the database but it is obviously not the right one…
What is the password to use then ?
To help me to encrypt the password (PStevens told me for), I have create a fake inbound email just to save the password “encrypted”.
Is this the right way ?
What is then the password to use ?

Thanks for your help…
Best,
Xavier

Anybody ? People had to make this working around the world and could share how to ?

While OAuth is not working “out of the box”, Is Suitecrm8 unusable ?

Really need help on this…
Xavier

Do you have two factor turned on? I remember this being an issue when I last set this up. The server cannot authenticate with 2 factor enabled on your O365 account. You can create like an app password that bypasses two factor. I can’t remember though if this was specific to SMTP or both SMTP and IMAP, but for sure I remember having to create.

You need to add a sign in method and then create an app password specifically for SuiteCRM.

Thanks Stevens,
I try and come back for the results :slight_smile:

Xavier

Hi Stevens,
Ok, some walkthrough :slight_smile:

I have succeed to almost all… almost :wink:

Ok, Here is what I did :

Connector provider : ok, but I think the issue could be from this part.
I have set here these :

Client id : secret id
Authorizeurl : Sign in to your account
Access token : Sign in to your account
Redirect url : https://mycrm.com/public/index.php?entryPoint=setExternalOAuthToken

All the other prefilled fields are the same.
The scopes : I think this could be my issue…

I have in the scopes in this exact order :
offline_access
https://outlook.office365.com/IMAP.AccessAsUser.All
User.Read
User.Read.All

(I tried to add the IMAP.AccessAsApp but this breaks the connexion, so I remove it).

With all this, I can set up a successful connexion, and then an inbound email account with a “success” on test.
But there is a big issue remaining : the folders (inbox, etc…) are not here : no folders, only a message “The following folder(s) INBOX either does not exist or has been deleted from server”.

For the record, I’m sure this is working as I have connect to the email box from Outlook to verify if it was working.

So my question is now : what am I missing to have the folders visibles in the inbound mailbox here… ?

I am at “one finger”…

Thanks in advance for your lights and support :slight_smile:
Xavier

Have you selected the correct folders here, or is this where the problem arises? (this one happens be be a gmail connection, but just for example)

Hi again :slight_smile:

This is when I try to select the folder by clicking on the “Select” button… The error is raised then.

What do I miss then ?
Thanks Stevens :slight_smile:
Xavier

EDIT : this is not a gmail OAuth here, but an Outlook365, if this matters…

Hi everybody,
Is anybody have an idea of why all is working except the folder listing when configuring the inbound account ?
For the record, I have also checked the php (8.1) module : imap and zip are correctly loaded.

Right now, I have “connection successfull” for the Oauth on the inbound account, but when I try to click on select for the folders, nothing is shown…

If somebody could give me a way to find what is wrong, this could save me…

Thanks in advance,
Xavier

I don’t know if this will help or not.

Try to quick repair and build from admin account.

image

Click admin → Repair (Under system section) ->Quick Repair and Rebuild.

Also, clear cache from browser and login again.

Also, you have “Repair Inbound Email Accounts” option under repair.

Hi Shub,
You dont know how many time I have “repaired”, cleared cache, etc…
Not working after days of trying at 2 persons and didnt find much help except from PStevens, the forum in every possible language found, the doc. That was not enough to allow to find “why” and “how”.

In my opinion, SuiteCRM is a really great tool but without big enough community. Except some “pros” who dont really have time to “help all the little people”, I did not found a support for SuiteCRM (but I’m maybe wrong and I did not look correctly or ask to the good people !).

Is there existing pro support ? Does people propose this ?

Best,
Xavier

  1. How to get SMTP E-mail working for Outlook/Office 365/Exchange - SuiteCRM Forum - English Language / Installation & Upgrade Help - SuiteCRM

  2. How to configure Inbound Email with OAuth :: SuiteCRM Documentation

  3. Emails :: SuiteCRM Documentation

Sure :slight_smile:
Read, read, read again, and again, start over maybe 10 times, start over on Microsoft azure too, no success at the very last step : the inbound account imap folder read. All is working except that the folders are not raised at all (as many other encountered on many other threads).

All solutions suggested tried, but nothing works at the end.
All this is only true with Oauth on Microsoft since they activated Oauth and no legacy mode.

Best,
Xavier

@pstevens is your man for inbound email issues. Pay him for a couple of hours of consulting and put him in a remote session looking at your server.

1 Like

I do have detailed setup instructions, but they are written specific to one of my clients that I helped setup, so I can’t really share them publicly. The client did most of the work on the Azure side and I did the setup on SuiteCRM side. It wasn’t easy, and there was a lot of back and forth, but we did end up with a repeatable process. I only have really detailed instructions the SuiteCRM side though, but I’ve done it a few times.

The SuiteCRM documentation didn’t exactly work for us. Particularly in setting up personal accounts. What we had to do was setup like an admin account on the Azure side that was able to connect and get a Oauth grant for a group account, then everyone just used that grant to verify their personal accounts. It worked, one draw back is that anyone could essentially add anyone else’s account in the company (It’s so complicated to setup good luck to the users though trying to access someone else’s account LOL!).

OH and one main point I can share DON’T TEST THE CONNECTION!!! that kills it. If you can select folders, you are connected. If you don’t see folders and cannot select them, you are not connected. Dont’ press the “test connection settings” button.

1 Like