0 votes
by (120 points)

2020-02-04 17:48:07.961 Opening log file.
2020-02-04 17:48:07.961 Using FileLogWriter version 2.0.5171.0.
2020-02-04 17:48:07.961 DEBUG Imap(36)[1] Info: State changed from 'Disconnected' to 'Connecting'.
2020-02-04 17:48:07.961 INFO Imap(36)[1] Info: Connecting to outlook.office365.com:993 using Imap 2.0.5171.0.
2020-02-04 17:48:08.008 DEBUG Imap(36)[1] Info: Connection succeeded.
2020-02-04 17:48:08.008 DEBUG Imap(36)[1] Info: Upgrading connection to TLS/SSL.
2020-02-04 17:48:08.024 INFO Imap(36)[1] TLS: State StateChange:Negotiating
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:ClientHello was sent.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:ServerHello was received.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:Certificate was received.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:ServerHelloDone was received.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: Verifying server certificate ('CN=outlook.com, O=Microsoft Corporation, L=Redmond, S=Washington, C=US').
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: Certificate verification result: Accept
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:ClientKeyExchange was sent.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: CipherSpec:ChangeCipherSpec was sent.
2020-02-04 17:48:08.024 DEBUG Imap(36)[1] TLS: HandshakeMessage:Finished was sent.
2020-02-04 17:48:08.039 DEBUG Imap(36)[1] TLS: CipherSpec:ChangeCipherSpec was received.
2020-02-04 17:48:08.039 DEBUG Imap(36)[1] TLS: HandshakeMessage:Finished was received.
2020-02-04 17:48:08.039 INFO Imap(36)[1] TLS: State StateChange:Secured
2020-02-04 17:48:08.039 INFO Imap(36)[1] TLS: Connection secured using cipher: TLS 1.1, RSA, 256bit AES in CBC mode, SHA1
2020-02-04 17:48:08.039 DEBUG Imap(36)[1] TLS: Session ID:
0000 |84-18-00-00-C6-43-AE-06 6A-79-41-52-91-42-DF-0E| .....C..jyAR.B..
0010 |29-C6-3D-56-2E-D4-A3-6D 89-C5-EC-05-18-AB-AD-E9| ).=V...m........
2020-02-04 17:48:08.039 DEBUG Imap(36)[1] Info: Connection upgraded to TLS/SSL.
2020-02-04 17:48:08.070 DEBUG Imap(36)[1] Info: State changed from 'Connecting' to 'Reading'.
2020-02-04 17:48:08.070 INFO Imap(36)[1] Response: * OK The Microsoft Exchange IMAP4 service is ready. [TABPADIAUAAyADYANQBDAEEAMAAwADAAOAAuAEcAQgBSAFAAMgA2ADUALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
2020-02-04 17:48:08.086 DEBUG Imap(36)[1] Info: State changed from 'Reading' to 'Ready'.
2020-02-04 17:48:08.102 DEBUG Imap(36)[1] Info: State changed from 'Ready' to 'Sending'.
2020-02-04 17:48:08.102 INFO Imap(36)[1] Command: R00001 CAPABILITY
2020-02-04 17:48:08.102 DEBUG Imap(36)[1] Info: State changed from 'Sending' to 'Reading'.
2020-02-04 17:48:08.102 INFO Imap(36)[1] Response: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
2020-02-04 17:48:08.102 INFO Imap(36)[1] Response: R00001 OK CAPABILITY completed.
2020-02-04 17:48:08.102 DEBUG Imap(36)[1] Info: State changed from 'Reading' to 'Ready'.
2020-02-04 17:48:08.117 DEBUG Imap(36)[1] Info: State changed from 'Ready' to 'Sending'.
2020-02-04 17:48:08.117 INFO Imap(36)[1] Command: R00002 AUTHENTICATE PLAIN
2020-02-04 17:48:08.117 DEBUG Imap(36)[1] Info: State changed from 'Sending' to 'Reading'.
2020-02-04 17:48:08.117 INFO Imap(36)[1] Response: +
2020-02-04 17:48:08.117 DEBUG Imap(36)[1] Info: State changed from 'Reading' to 'Sending'.
2020-02-04 17:48:08.117 INFO Imap(36)[1] Command: ****************************************************************
2020-02-04 17:48:08.117 DEBUG Imap(36)[1] Info: State changed from 'Sending' to 'Reading'.
2020-02-04 17:48:08.523 INFO Imap(36)[1] Response: R00002 NO AUTHENTICATE failed.
2020-02-04 17:48:08.523 DEBUG Imap(36)[1] Info: State changed from 'Reading' to 'Ready'.
2020-02-04 17:48:08.523 ERROR Imap(36)[1] Info: Rebex.Net.ImapException: AUTHENTICATE failed (NO).
at Rebex.Net.Imap.YT(String A, ImapResponse B, Boolean C)
at Rebex.Net.Imap.VU(String A, String B)
at Rebex.Net.Imap.RU(String A, String B, ImapAuthentication C, GssApiProvider D)
at Rebex.Net.Imap.YO(String A, String B, ImapAuthentication C)
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] Info: State changed from 'Ready' to 'Sending'.
2020-02-04 17:48:08.539 INFO Imap(36)[1] Command: R00003 LOGOUT
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] Info: State changed from 'Sending' to 'Reading'.
2020-02-04 17:48:08.539 INFO Imap(36)[1] Response: * BYE Microsoft Exchange Server IMAP4 server signing off.
2020-02-04 17:48:08.539 INFO Imap(36)[1] Response: R00003 OK LOGOUT completed.
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] Info: State changed from 'Reading' to 'Ready'.
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] TLS: Closing TLS socket.
2020-02-04 17:48:08.539 INFO Imap(36)[1] TLS: Alert Alert:Alert was sent.
2020-02-04 17:48:08.539 INFO Imap(36)[1] TLS: State StateChange:Closed
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] Info: State changed from 'Ready' to 'Disconnected'.
2020-02-04 17:48:08.539 DEBUG Imap(36)[1] Info: State changed from 'Disconnected' to 'Disposed'.
2020-02-04 17:48:23.374 Opening log file.
2020-02-04 17:48:23.374 Using FileLogWriter version 2.0.5171.0.
2020-02-04 17:48:23.374 DEBUG Imap(37)[1] Info: State changed from 'Disconnected' to 'Connecting'.
2020-02-04 17:48:23.374 INFO Imap(37)[1] Info: Connecting to outlook.office365.com:993 using Imap 2.0.5171.0.
2020-02-04 17:48:44.451 DEBUG Imap(37)[1] Info: State changed from 'Connecting' to 'Disconnected'.
2020-02-04 17:48:44.451 ERROR Imap(37)[1] Info: Rebex.Net.ImapException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> Rebex.Net.ProxySocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 52.97.133.162:993
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at Rebex.Net.VV.WC(String A, IPAddress B, Int32 C)
--- End of inner exception stack trace ---
at Rebex.Net.VV.WC(String A, IPAddress B, Int32 C)
--- End of inner exception stack trace ---
at Rebex.Net.VV.VC(IAsyncResult A, String B)
at Rebex.Net.VV.QB(IAsyncResult A)
at Rebex.Net.ProxySocket.EndConnect(IAsyncResult asyncResult)
at Rebex.Net.VM..ctor(Imap A, ISocketFactory B, String C, Int32 D)
at Rebex.Net.Imap.RM(String A, Int32 B, TlsParameters C, ImapSecurity D)
--- End of inner exception stack trace ---
at Rebex.Net.Imap.RM(String A, Int32 B, TlsParameters C, ImapSecurity D)
2020-02-04 17:48:44.451 DEBUG Imap(37)[1] Info: State changed from 'Disconnected' to 'Disposed'.

1 Answer

0 votes
by (73.6k points)
edited by

The server response: R00002 NO AUTHENTICATE failed. typically means: User name or password is invalid.

Please, ensure you specified correct credentials.

Try to log in using Web browser first (https://outlook.office365.com/). Then use exactly same credentials.

Please note that outlook.office365.com requires full email address for user_name to be specified.

UPDATE:

Microsoft retired Basic Authentication in Exchange Online on October 1, 2022. It means the PLAIN authentication will not work anymore. See:

https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

https://www.microsoft.com/en-us/microsoft-365/blog/2022/09/01/microsoft-retires-basic-authentication-in-exchange-online/

The suggested solution is to use OAuth authentication. You can follow our guide to enable OAuth for your application. Choose one which matches your needs:

https://blog.rebex.net/oauth2-office365-rebex-mail
https://blog.rebex.net/office365-imap-pop3-oauth-unattended

by (140 points)
Lukas,

We have the same issue, started 4 days ago, on all email accounts.
We are able to log into Outlook Web UI and also with Outlook desktop app.
But our code that is using Rebex Imap API now throws the "R00002 NO AUTHENTICATE failed." response at client.Login().

Here is the full log:

2022-11-02 12:05:14.599 Opening log file.
2022-11-02 12:05:14.602 INFO FileLogWriter(1)[12] Info: Assembly: Rebex.Common 2019 R3 for .NET 4.6-4.8
2022-11-02 12:05:14.635 INFO FileLogWriter(1)[12] Info: Platform: Windows 6.2.9200 32-bit; CLR: 4.0.30319.42000
2022-11-02 12:05:14.736 INFO Imap(1)[12] Info: Connecting to outlook.office365.com:993 using Imap.
2022-11-02 12:05:14.736 INFO Imap(1)[12] Info: Assembly: Rebex.Imap 2019 R3 for .NET 4.6-4.8
2022-11-02 12:05:14.736 INFO Imap(1)[12] Info: Platform: Windows 6.2.9200 32-bit; CLR: 4.0.30319.42000
2022-11-02 12:05:14.797 INFO Imap(1)[12] Info: Connecting to 52.96.29.82.
2022-11-02 12:05:14.950 INFO Imap(1)[12] TLS: State StateChange:Negotiating
2022-11-02 12:05:15.039 INFO Imap(1)[12] TLS: Negotiating TLS 1.2, RSA with ephemeral Elliptic Curve Diffie-Hellman, AES with 256-bit key in GCM mode, AEAD.
2022-11-02 12:05:15.349 INFO Imap(1)[12] TLS: State StateChange:Secured
2022-11-02 12:05:15.349 INFO Imap(1)[12] TLS: Connection secured using cipher: TLS 1.2, RSA with ephemeral Elliptic Curve Diffie-Hellman, AES with 256-bit key in GCM mode, AEAD.
2022-11-02 12:05:15.388 INFO Imap(1)[12] Response: * OK The Microsoft Exchange IMAP4 service is ready. [QgBOADgAUABSADEANQBDAEEAMAAwADUAMwAuAG4AYQBtAHAAcgBkADEANQAuAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]
2022-11-02 12:05:15.426 INFO Imap(1)[12] Command: R00001 CAPABILITY
2022-11-02 12:05:15.463 INFO Imap(1)[12] Response: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
2022-11-02 12:05:15.463 INFO Imap(1)[12] Response: R00001 OK CAPABILITY completed.
2022-11-02 12:05:19.994 INFO Imap(1)[12] Command: R00002 AUTHENTICATE PLAIN
2022-11-02 12:05:20.032 INFO Imap(1)[12] Response: +
2022-11-02 12:05:20.033 INFO Imap(1)[12] Command: **********
2022-11-02 12:05:21.342 INFO Imap(1)[12] Response: R00002 NO AUTHENTICATE failed.
2022-11-02 12:05:21.348 ERROR Imap(1)[12] Info: Rebex.Net.ImapException: AUTHENTICATE failed (NO).
   at Rebex.Net.Imap.dxdt(String aq, ImapResponse ar, Boolean as)
   at Rebex.Net.Imap.dxff(String er, String es)
   at Rebex.Net.Imap.dxfb(String ej, String ek, ImapAuthentication el, GssApiProvider em)
   at Rebex.Net.Imap.dxfn(String fh, String fi, ImapAuthentication fj)
2022-11-02 12:06:06.350 INFO Imap(1)[12] TLS: Alert Alert:Alert was sent.
2022-11-02 12:06:06.350 INFO Imap(1)[12] TLS: State StateChange:Closed
by (73.6k points)
Please note that Microsoft retired Basic Authentication in Exchange Online already. It means the PLAIN authentication will not work anymore. See:

 https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online

  https://www.microsoft.com/en-us/microsoft-365/blog/2022/09/01/microsoft-retires-basic-authentication-in-exchange-online/

The suggested solution is to use OAuth authentication. You can follow our guide to enable OAuth for your application. Choose one which matches your needs:

  https://blog.rebex.net/oauth2-office365-rebex-mail
  https://blog.rebex.net/office365-imap-pop3-oauth-unattended

Alternatively, you can re-enable Basic Authentication in Exchange Online. But it will be disabled at the end of year anyway. The guide for this is here:

  https://techcommunity.microsoft.com/t5/exchange-team-blog/basic-authentication-deprecation-in-exchange-online-september/ba-p/3609437
by (140 points)
Thank you this is helpful!
...