Outbound/Inbound Mail: Office365 SMTP Error: Could not authenticate. v7.13 #4924

Open
opened 2026-02-20 16:26:20 -05:00 by deekerman · 17 comments
Owner

Originally created by @bunglex on GitHub (Jan 13, 2023).

Issue

Can't set 'Outbound Email' or create 'Personal Outbound Email Account because authentication fails.

Expected Behavior

After setting up 'External OAuth Provider' and 'External OAuth Connector' and successfully retrieving an Access and Refresh Token, you should able to configure 'Outbound Email Settings' and setup a 'Personal Outbound Email Account', and also create inbound email account.

In the detail page for Personal Outbound Email Account , the 'send test email' should send test email when the correct settings are used.

Actual Behavior

In the detail page for Personal Outbound Email Account , the 'send test email' fails and returns an SMTP log that states

Authentication unsuccessful, the user credentials were incorrect.
SMTP Error: Could not authenticate.

SuiteCRm logs :

[FATAL] Using imap handler class: Imap2Handler
[FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] An Imap error detected: "IMAP open error | debug data"
[FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX"
[FATAL] An Imap error detected: "ImapHandler:open: Info"
[FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
[FATAL] An Imap error detected: "ImapHandler:open: 512"
[FATAL] An Imap error detected: "IMAP open error | debug data end "
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] An Imap error detected: "IMAP open error | debug data"
[FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX"
[FATAL] An Imap error detected: "ImapHandler:open: Info"
[FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
[FATAL] An Imap error detected: "ImapHandler:open: 512"
[FATAL] An Imap error detected: "IMAP open error | debug data end "
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] An Imap error detected: "IMAP open error | debug data"
[FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX"
[FATAL] An Imap error detected: "ImapHandler:open: Info"
[FATAL] An Imap error detected: "ImapHandler:open: password is empty: no"
[FATAL] An Imap error detected: "ImapHandler:open: 512"
[FATAL] An Imap error detected: "IMAP open error | debug data end "
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] ImapHandler trying to use a non valid resource stream.
[FATAL] An Imap error detected: "Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed."

However, if you re-enter the password 'after' opening the page, the test succeeds and the email is sent correctly.
forum post here

Possible Fix

unknown

Steps to Reproduce

  1. Log into SuiteCRM as admin
  2. Go to Admin > Outbound Email
  3. Create or select/edit a Personal Outbound Email Account
  4. Exchange Server: outlook.office365.com
  5. Mail SMTP/SLL: TLS
  6. Exchange Server Port: 587
  7. User SMTP Authentication: X
  8. Password: your O365 password
  9. Send Test email

Authentication fails and displays SMTP Log

  1. Enter Password again
  2. Send Test Email

Test passes and email is sent

Context

Can't setup an office365 outbound or inbound email account

Your Environment

  • SuiteCRM Version used: 7.13
  • Browser name and version : Chrome Version 109.0.5414.74 (64-bit)):
  • Environment name and version : Mysql8 PHP 7.4
  • Operating System and version: Ubuntu 20.04
Originally created by @bunglex on GitHub (Jan 13, 2023). #### Issue <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> <!--- Ensure that all code ``` is surrounded ``` by triple back quotes. This can also be done over multiple lines --> Can't set 'Outbound Email' or create 'Personal Outbound Email Account because authentication fails. #### Expected Behavior <!--- Tell us what should happen --> After setting up 'External OAuth Provider' and 'External OAuth Connector' and successfully retrieving an Access and Refresh Token, you should able to configure 'Outbound Email Settings' and setup a 'Personal Outbound Email Account', and also create inbound email account. In the detail page for Personal Outbound Email Account , the 'send test email' should send test email when the correct settings are used. #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> In the detail page for Personal Outbound Email Account , the 'send test email' fails and returns an SMTP log that states **`Authentication unsuccessful, the user credentials were incorrect.`** **`SMTP Error: Could not authenticate.`** SuiteCRm logs : ``` [FATAL] Using imap handler class: Imap2Handler [FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] An Imap error detected: "IMAP open error | debug data" [FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX" [FATAL] An Imap error detected: "ImapHandler:open: Info" [FATAL] An Imap error detected: "ImapHandler:open: password is empty: no" [FATAL] An Imap error detected: "ImapHandler:open: 512" [FATAL] An Imap error detected: "IMAP open error | debug data end " [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] An Imap error detected: "IMAP open error | debug data" [FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX" [FATAL] An Imap error detected: "ImapHandler:open: Info" [FATAL] An Imap error detected: "ImapHandler:open: password is empty: no" [FATAL] An Imap error detected: "ImapHandler:open: 512" [FATAL] An Imap error detected: "IMAP open error | debug data end " [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] An Imap error detected: "IMAP open error | debug data" [FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap\/ssl\/tls\/validate-cert\/secure}INBOX" [FATAL] An Imap error detected: "ImapHandler:open: Info" [FATAL] An Imap error detected: "ImapHandler:open: password is empty: no" [FATAL] An Imap error detected: "ImapHandler:open: 512" [FATAL] An Imap error detected: "IMAP open error | debug data end " [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "IMAP open error:Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] ImapHandler trying to use a non valid resource stream. [FATAL] An Imap error detected: "Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed." ``` However, if you re-enter the password 'after' opening the page, the test succeeds and the email is sent correctly. [forum post here](https://community.suitecrm.com/t/imaphandler-errors-how-to-setup-inbound-email-for-office365-v7-12-5/87565/6) #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> unknown #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Log into SuiteCRM as admin 2. Go to Admin > Outbound Email 3. Create or select/edit a Personal Outbound Email Account 4. Exchange Server: outlook.office365.com 5. Mail SMTP/SLL: TLS 6. Exchange Server Port: 587 7. User SMTP Authentication: X 8. Password: your O365 password 9. Send Test email Authentication fails and displays SMTP Log 10. Enter Password again 11. Send Test Email Test passes and email is sent #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> Can't setup an office365 outbound or inbound email account #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.13 * Browser name and version : Chrome Version 109.0.5414.74 (64-bit)): * Environment name and version : Mysql8 PHP 7.4 * Operating System and version: Ubuntu 20.04
Author
Owner

@SuiteBot commented on GitHub (Jan 14, 2023):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/oauth-connection-for-inbound-emails/87421/5

@SuiteBot commented on GitHub (Jan 14, 2023): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/oauth-connection-for-inbound-emails/87421/5
Author
Owner

@SuiteBot commented on GitHub (Jan 14, 2023):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/imaphandler-errors-how-to-setup-inbound-email-for-office365-v7-12-5/87565/8

@SuiteBot commented on GitHub (Jan 14, 2023): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/imaphandler-errors-how-to-setup-inbound-email-for-office365-v7-12-5/87565/8
Author
Owner

@timo-ecm2 commented on GitHub (Jan 16, 2023):

Yes I have a similar issue, only I was specific busy with inbound email account.

@timo-ecm2 commented on GitHub (Jan 16, 2023): Yes I have a similar issue, only I was specific busy with inbound email account.
Author
Owner

@greentreegroup commented on GitHub (Jan 20, 2023):

we are also having issues connecting m365 to suitecrm when sending emails.

@greentreegroup commented on GitHub (Jan 20, 2023): we are also having issues connecting m365 to suitecrm when sending emails.
Author
Owner

@timo-ecm2 commented on GitHub (Jan 23, 2023):

What about connecting to a gmail account, happens the same?

@timo-ecm2 commented on GitHub (Jan 23, 2023): What about connecting to a gmail account, happens the same?
Author
Owner

@bunglex commented on GitHub (Jan 27, 2023):

the password is saved and the email sent correctly when using a gmail account
?

@bunglex commented on GitHub (Jan 27, 2023): the password is saved and the email sent correctly when using a gmail account ?
Author
Owner

@timo-ecm2 commented on GitHub (Jan 30, 2023):

ok thnx @bunglex for the information. Do you know where I can find a good manual / information for a gmail account

@timo-ecm2 commented on GitHub (Jan 30, 2023): ok thnx @bunglex for the information. Do you know where I can find a good manual / information for a gmail account
Author
Owner

@Lehnerr commented on GitHub (Apr 14, 2023):

I have the same issue, pls help

@Lehnerr commented on GitHub (Apr 14, 2023): I have the same issue, pls help
Author
Owner

@pgorod commented on GitHub (Apr 14, 2023):

Does this still occur on the latest 7.13?

@pgorod commented on GitHub (Apr 14, 2023): Does this still occur on the latest 7.13?
Author
Owner

@Lehnerr commented on GitHub (Apr 14, 2023):

yes 7.13.2

@Lehnerr commented on GitHub (Apr 14, 2023): yes 7.13.2
Author
Owner

@SuiteBot commented on GitHub (May 10, 2023):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/email-setup-help-and-explanation/88999/2

@SuiteBot commented on GitHub (May 10, 2023): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/email-setup-help-and-explanation/88999/2
Author
Owner

@pstevens71 commented on GitHub (May 24, 2023):

I suspect it might be this issue: there is a fix proposed and it works (I tested it).
https://github.com/salesagility/SuiteCRM/issues/9457

@pstevens71 commented on GitHub (May 24, 2023): I suspect it might be this issue: there is a fix proposed and it works (I tested it). [https://github.com/salesagility/SuiteCRM/issues/9457](url)
Author
Owner

@chris001 commented on GitHub (May 24, 2023):

@pstevens71 That link leads to a non existent page.... this is the one: https://github.com/salesagility/SuiteCRM/issues/9457

@chris001 commented on GitHub (May 24, 2023): @pstevens71 That link leads to a non existent page.... this is the one: https://github.com/salesagility/SuiteCRM/issues/9457
Author
Owner

@pstevens71 commented on GitHub (Jun 27, 2023):

The previous #9457 doesn't seem to work for me on 7.13.3. I just cannot seem to authenticate outbound email.
I've tried ins sugarmailer.php to use the debugging to force the correct password and it works no problem. However, I cannot get test to work or after it's saved to work. I checked the DB and there are values in the password. Anyone know the password encryption? Is it MD5?

Also further info.... when using a gmail account with an app password, I can send a test and verify. However, the user cannot send with this account. (yes I have the option selected).

@pstevens71 commented on GitHub (Jun 27, 2023): The previous #9457 doesn't seem to work for me on 7.13.3. I just cannot seem to authenticate outbound email. I've tried ins sugarmailer.php to use the debugging to force the correct password and it works no problem. However, I cannot get test to work or after it's saved to work. I checked the DB and there are values in the password. Anyone know the password encryption? Is it MD5? Also further info.... when using a gmail account with an app password, I can send a test and verify. However, the user cannot send with this account. (yes I have the option selected).
Author
Owner

@rmunoz10 commented on GitHub (Aug 3, 2024):

v7.14.4 Inbound fails too.

Sat Aug 3 10:37:00 2024 [21013][1][FATAL] ImapHandler trying to use a non valid resource stream.
Sat Aug 3 10:37:00 2024 [21013][1][FATAL] ImapHandler trying to use a non valid resource stream.
Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty startup greeting (outlook.office365.com:993)"
Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "IMAP open error | debug data"
Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993/service=imap}INBOX"

@rmunoz10 commented on GitHub (Aug 3, 2024): v7.14.4 Inbound fails too. Sat Aug 3 10:37:00 2024 [21013][1][FATAL] ImapHandler trying to use a non valid resource stream. Sat Aug 3 10:37:00 2024 [21013][1][FATAL] ImapHandler trying to use a non valid resource stream. Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "IMAP open error: Can not authenticate to IMAP server: Empty startup greeting (outlook.office365.com:993)" Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "IMAP open error | debug data" Sat Aug 3 10:38:00 2024 [21013][1][FATAL] An Imap error detected: "ImapHandler:open: {outlook.office365.com:993\/service=imap}INBOX"
Author
Owner

@pstevens71 commented on GitHub (Aug 5, 2024):

Hey @rmunoz you can't use IMAP for O365, it's no longer supported. You have to setup Oauth.

@pstevens71 commented on GitHub (Aug 5, 2024): Hey @rmunoz you can't use IMAP for O365, it's no longer supported. You have to setup Oauth.
Author
Owner

@rmunoz commented on GitHub (Aug 5, 2024):

@pstevens71 I guess you mean @rmunoz10 :D

@rmunoz commented on GitHub (Aug 5, 2024): @pstevens71 I guess you mean @rmunoz10 :D
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4924
No description provided.