No announcement yet.

IMAP/SMTP plain auth is deprecated Office 365 / Gmail now requires OAuth 2.0

  • Filter
  • Time
  • Show
Clear All
new posts

  • IMAP/SMTP plain auth is deprecated Office 365 / Gmail now requires OAuth 2.0

    Hi guys!
    Correct me if I am wrong, but Google and Microsoft will not support classic IMAP/SMTP username/password authentication, now they will require the OAuth 2.0 authentication.
    There are many articles about this topic,

    Google is deprecating Less Secure Apps. Find out how to fix your Gmail connection in WP Mail SMTP.

    'If your in-house application needs to access IMAP, POP, and SMTP AUTH protocols in Exchange Online, follow these step-by-step instructions to implement OAuth 2.0 authentication: Authenticate an IMAP, POP, or SMTP connection using OAuth.'

    We cannot set up Office 365 email access, there is no option available.

    So my question is, maybe I missed something, is there an app to perform OAuth 2.0 for Gmail and Microsoft?

    Thank you!

  • #2
    Hi - keen to know if there will be a version to address this.


    • #3
      Would this workaround help (Microsoft)?

      It is explained for Googlemail here:
      Last edited by shalmaxb; 06-30-2022, 02:21 PM.


      • #4
        Thanks for your kind replies,

        >Would this workaround help (Microsoft)?

        I tried, nope, the will drop non oAuth 2.0 support for IMAP connections

        >It is explained for Googlemail here:

        Hope this will work, thanks


        • #5
          Google Integration and Outlook Integration both support OAuth login for emails (for a couple of years already). Not sure about implementing unified solution into Espo open source in the future. It doesn't depend only on me.


          • #6
            Anybody tried App Passwords for Gmail? Do they work with Espo?


            • #7
              Hi Russ,

              I can say with confidence that IMAP and SMTP for Outlook 365 works the same as before.
              For the first time I set up Outlook 365 six months ago (approximately) with the current email for EspoCRM, and now in the latest version of EspoCRM I entered the same login and password that were used earlier, then I used for IMAP, and smtp.office365com for SMTP. All test connections were successful and test emails were sent.

              As for IMAP and SMTP for Google, you just need to enable 2-Step-Verification ( and create an App Password ( This App Password will need to be used in EspoCRM for Outbound Emails, IMAP and SMTP in place of your normal, initially set password.


              • #8
                I figured out how it works:

                If "old" E-Mail account exists, it should be deleted first, then create a new one. I am not sure if "empty" password is possible to be set.

                Looks like that works for E-Mail sending / recieving, I have to proove if sended E-Mail looks "very well" instead of "not well" on different recieving clients.
                But for "normal" IMAP Feature of Espo in future (for O365 usage) will not work from October 2022 on anymore without purchasing Outlook Plugin, that should be sure (for Business O365 Accounts).

                Russ , lazovic
                Hi, I think that you are wrong (lazovic). Microsoft will drop Basic Auth at October 2022 for SMTP / IMAP and further, like they call it "unsafe" protocols.
                Your Workarount will not work for Business Accounts, maybe for private accounts, I don't know.
                You can only delay if Microsoft turns off SMTP / IMAP before October 2022. (Happened to us, and some IMAP Accounts where able to login, some where not)

                After October 2022 this features get useless at EspoCRM if you don't want to use the O365 Plugin.

                yuri , shalmaxb
                Sorry, but O365 Plugin has several disadvantages and missing features (We bought but we do not use, Update: only for E-Mail).
                We have programmed our own Scripts (Phython, exchangelib I think, triggered by PHP and via Webhook Queues) nearly completely outside of Espo and use API User for that.

                The script compares all objects (for meetings eg. max. 180 days in the past and all future meetings) with each other and creates, deletes or updates the changed data accordingly.

                The synchronization of contacts (Group Folder and Sub-Folder of every user's account - Sub-Folder of Outlook-Contact-Folder because of Apple iOS Bug) and appointments is one-way. This means that changed data in Outlook will be overwritten. For the tasks, the status will also be changed to Espo if it has changed to Exchange. All other task fields are overwritten. Objects created manually in Outlook (e.g. appointments) are ignored and not changed or deleted.

                We create objects for single Users and a Group Calendar for round about 25 employees. It was impossible to reach the goals with Espo O365 Plugin.
                Furthermore a cuple of other systems fetch this Data and store in their own Databases. (e.g. VOIP)

                For Espo we use much E-Mail automated Imports via IMAP4 for Cases, Meetings, Accounts, Contacts, Offers and on an on.

                All those things won't be functional from October on. Sinking efficiency by Espo round about 40 percent i guess.
                I think much Espo Users / Companies use IMAP instead of O365 Plugin because of Bugs and missing features. (e.g. even not possible to send a html E-Mail looking "normal" - on the opposide but with IMAP looking very well)


                • yuri
                  yuri commented
                  Editing a comment
                  What bugs Outlook Integration has?

                  > even not possible to send a html E-Mail looking

                  What does this mean? Outlook Integration has nothing to do with how email is looking. It just sends additional authentication data when connecting to SMTP/IMAP.
                  Last edited by yuri; 07-07-2022, 09:53 AM.

                • macistda
                  macistda commented
                  Editing a comment
                  I will activate and see if this problem will come back again from users.

                • bandtank
                  bandtank commented
                  Editing a comment
                  I have not had any issues with the Outlook extension. My emails are always sent as HTML.

              • #9
                October 2022 is there and we starting getting errors like 5.7.3 Authentication unsuccessful for O365. Does anyone have ideas what to do as SMTP is not working even with Outlook plugin.


                • lazovic
                  lazovic commented
                  Editing a comment
                  Hi partomas,

                  In order to be able to reproduce this issue, please tell me what type of Outlook email account do you use? It is a business account or personal account? Do you use domain or some custom one? What SMTP settings are you using (host, port, security)?

                  Also, please tell me what version of EspoCRM and Outlook Integration extension are you using?

                  I will be glad to help you with this problem as soon as possible.
                  Last edited by lazovic; 10-07-2022, 08:31 AM.

                • partomas
                  partomas commented
                  Editing a comment
                  The same problem was detected in versions Espo v.7.1.3 (our current CRM) and v.7.2.4 (freshly installed CRM for tests). Outlook Integration v.1.2.8.

                  1. When Outlook extension is "connected" SMTP use $username = $inboundEmail->get('emailAddress'); instead of "SMTP username" In this case there are no matter what SMTP username parameters are set, the system are looking at the main "Email Address" which is not always are the same as login credentials as you can see in captured video of the case.

                  2. issue come when in personal/group email account we "connect" to outlook 365 by Outlook extension, then we are not able to send emails by using other setted SMTP settings like "localhost:25 no authentication", because outlook extension add additional authentication parameters on top of current settings because of: $client = $this->getExternalAccountClientManager()->create('Outlook', $id);
                  example: {"name":"","host":"loca lhost","port":25,"connectionConfig":{"authString": "dXNlcj1vbGQtc3VwcG9...UpHN5bUR6NU1nAQE="},"connec tionClass":"\Espo\Modules\Outlook\Core\Outlook\Smt p\Auth\Xoauth"} - instead of simple mail sending SMTP to localhost:25 without any authentication.

                  The same behaviour is with Google extension as well.

              • #10
                hi, is there any update or solution for this, my office 365 imap stopped working... please help. thanks


                • partomas
                  partomas commented
                  Editing a comment
                  There are only one way - Please Use Outlook extension.

                • macistda
                  macistda commented
                  Editing a comment
                  Espo: OAuth is working only with Outlook extension.
                  Espo: Send E-Mail from Group Mailbox via office365 smtp is working only with a O365 "full mailbox", not a O365 sharedMailbox. IMAP works with both O365 sharedMailbox and "full mailbox".

              • #11
                I figured out another unpleasant situation related to SMTP. I'm not able to send any mails form CRM on behalf of my account when I have enabled google extension for calendar, but don't have any personal e-mail account and using default System Outbound Emails settings.

                Looks like google extension also add something to SMTP credentials there as well.
                Attached Files