Hello everyone,
if I go to https://testconnectivity.microsoft.com/ select Exchange Server ,then select IMAP Email and test the connection, I get this error:

(I replaced the real Email address with login @keyman .com)

The IMAP service is being tested.
There was an error testing the IMAP service
Additional Details
Protocol Log: C: 1 CAPABILITY
S: * OK The Microsoft Exchange IMAP4 service is ready. [RABNADYAUABSADAANgBDAEEDEAOLIJghPOUGGöhAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]
S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
S: 1 OK CAPABILITY completed.
C: 2 LOGIN login @keyman .com ********
S: 2 NO LOGIN failed.
Exception details:
Message: The IMAP server responded with an error status "2 NO LOGIN failed.".
Type: Microsoft.M365.RCA.Services.Protocols.Imap.ImapServerErrorException
Stack trace:
at Microsoft.M365.RCA.Services.Protocols.Imap.ImapCommand 1.CheckForOk(IList 1 response)
at Microsoft.M365.RCA.Services.Protocols.Imap.LoginCommand.ProcessResponse(IList 1 response) at Microsoft.M365.RCA.Services.Protocols.ProtocolClient.<SendCommandAsync>d__17 1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.M365.RCA.ConnectivityTests.ImapPop.BaseProtocolTest.<PerformTestInternalAsync>d__12.MoveNext()

Now, if I go to https://testconnectivity.microsoft.com/ select Office 365 ,then select IMAP Email and test the connection, it works without any problem.

This happens for all accounts.
The account I used for testing, does not have 2FA enable and in the Exchange admin center, IMAP is enabled:

Also, In my Microsoft 365 admin center , under Settings -> Org settings -> Modern authentication , I have the following settings:

When I check the auth policy with Powershell, this is what I have:

Does anyone have any idea what is going on?
Why do the checks return this "2 NO LOGIN failed." error?

Best regards

Same problem here. We have an application that uses IMAP to collect email automatically for processing. It worked fine up until 6:30am yesterday and now gives authentication errors. We can login to Outlook online using account credentials Ok.
The Remote Connectivity Analyzer reports the same results as you posted. Something has changed at MS end for sure. Originally 2FA was disabled for this account - we tried turning 2FA on and using an app password - but no luck.

Found the issue to my problem: It seems to alert us to the fact that this will be turned off permanently come October - they are giving it a trial run to alert you to this is going to be an issue with any access not using modern authentication.

Blockquote

June 29, 2022 3:36 AM
As part of the program to deprecate basic authentication in Exchange Online, we have temporarily disabled it for Internet Mail Access Protocol version 4 (IMAP4). Starting Saturday, October 1, 2022, basic
authentication for Exchange Online will be permanently disabled in your tenant.  Please leverage the additional diagnostics provided to determine the next steps.

Blockquote

https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online#re-enabling-and-opting-out-of-proactive-protection

@Alberto Valdes

Based on your description, I think you are using Exchange online mailbox.

Did you try to configure your mailbox in Outlook? Because there sometimes exists issue with the "Microsoft Remote Connectivity Analyzer" tool.

I want to confirm with you that how many user have this issue? You could have a check in Service health from your Microsoft 365 admin center first. Check whether there exist issue with your tenant.

Then try to enable OWA for this mailbox, login OWA and check whether those information below exist. You need configure IMAP account with information below:

If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

thanks for your reply.

This is happening for all of our accounts.
This is what I have in the settings of the account I am using for the tests:

So, I changed the test to use TLS instead of SSL and this is what I get now

A different error about the SSL, which doesnt happen when I try using SSL

I didnt try to configure it in Outlook, because this is a service account, we use it only to send and get the emails through another application.

If so, I would suggest you try to login Outlook first. It could help us narrow down whether this issue related to configuration on your application.

I also want to confirm with you whether there exist issue in Service health in your Microsoft 365 admin center.

@KyleXu-MSFT Hi,
I can login in Outlook(Web), no problem there. Do you mean I should use an Outlook client?
Also, in the service health I only have these:

Yes, try to login Outlook client could help us narrow down whether this issue related your tenant.

If could configure IMAP in Outlook client, it means that configuring mailboxes on your device requires additional action.

If you cannot configure mailbox in Outlook client, it means there exist issue with you tenant. You may need to open a service request to let Microsoft check on your tenant.

hello we have been facing this error for several days to access the account from python

raise self.error(dat[-1]) imaplib.IMAP4.error: b'LOGIN failed.'