#3067 ✓closed
Nicola Carboni

Exchange Oauth2 error 1004

Reported by Nicola Carboni | May 2nd, 2022 @ 11:42 AM

Hello,
My organisation move to Exchange with Oauth2 and I am desperateluy trying to keep using Mailmate.
I manage to create a new account using outlook.office365.com as IMAP server and I logged in with an sms using my organisation's page. I thought everything was OK but instead it still does not retrieve my mail. I checked the activity viewer and the log mention:

20:18:55 S: A3 BAD User is authenticated but not connected.
20:18:55 Warning: Detected Exchange IMAP server response state bug. Trying to work around it by interpreting it as a temporary connection issue.
20:18:55 Error code: 1004
20:18:55 Failed action (1000). Reset observed read/write timeouts: 8/8

Any idea if there is a fix or how can I continue to use Mailmate?

Full logs here:

20:18:39 Running action
20:18:39 Handling request
20:18:39 Ready to run action (type: 1000, retry count: 0)
20:18:39 Clearing connection to outlook.office365.com
20:18:39 Trying to connect to outlook.office365.com on port 993 (CFNetwork) without STARTTLS (required)
20:18:39 Resolved hostname (outlook.office365.com).
20:18:39 Prepare secure connection...
20:18:40 Successful connection.
20:18:40 Initiating secure connection...
20:18:40  Returned (4)...
20:18:40 Protocol version: kTLSProtocol12
20:18:40 S: * OK The Microsoft Exchange IMAP4 service is ready. [UABBAFoAUAAyADYANABDAEEAMAAxADkAMQAuAEYAUgBBAFAAMgA2ADQALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
20:18:40 C: A0 CAPABILITY
20:18:40 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
20:18:40 S: A0 OK CAPABILITY completed.
20:18:40 Retrieving password (keychain or user request)
20:18:40 C: A1 AUTHENTICATE XOAUTH2 ••••••••••
20:18:42 S: A1 OK AUTHENTICATE completed.
20:18:42 C: A2 CAPABILITY
20:18:42 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE CHILDREN IDLE NAMESPACE LITERAL+
20:18:42 S: A2 OK CAPABILITY completed.
20:18:42 C: A3 ID ("name" "MailMate" "version" "r5890" "vendor" "Freron Software" "contact" "mm-imap-id@freron.com")
20:18:42 S: A3 BAD User is authenticated but not connected.
20:18:42 Warning: Detected Exchange IMAP server response state bug. Trying to work around it by interpreting it as a temporary connection issue.
20:18:42 Error code: 1004
20:18:42 Failed action (1000). Reset observed read/write timeouts: 8/8

20:18:42 Handling reply
20:18:42 Running action
20:18:42 Handling request
20:18:42 Trying to disconnect nicely (8)...
20:18:42 C: A4 LOGOUT
20:18:42 S: * BYE Microsoft Exchange Server IMAP4 server signing off.
20:18:42 S: A4 OK LOGOUT completed.
20:18:42 Clearing connection to outlook.office365.com
20:18:43 Ready to run action (type: 1000, retry count: 1)
20:18:43 Clearing connection to outlook.office365.com
20:18:43 Trying to connect to outlook.office365.com on port 993 (CFNetwork) without STARTTLS (required)
20:18:43 Resolved hostname (outlook.office365.com).
20:18:43 Prepare secure connection...
20:18:43 Successful connection.
20:18:43 Initiating secure connection...
20:18:43  Returned (4)...
20:18:43 Protocol version: kTLSProtocol12
20:18:43 S: * OK The Microsoft Exchange IMAP4 service is ready. [UABBAFoAUAAyADYANABDAEEAMAAxADcAMQAuAEYAUgBBAFAAMgA2ADQALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
20:18:43 C: A0 CAPABILITY
20:18:43 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
20:18:43 S: A0 OK CAPABILITY completed.
20:18:43 Retrieving password (keychain or user request)
20:18:43 C: A1 AUTHENTICATE XOAUTH2 ••••••••••
20:18:45 S: A1 OK AUTHENTICATE completed.
20:18:45 C: A2 CAPABILITY
20:18:46 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE CHILDREN IDLE NAMESPACE LITERAL+
20:18:46 S: A2 OK CAPABILITY completed.
20:18:46 C: A3 ID ("name" "MailMate" "version" "r5890" "vendor" "Freron Software" "contact" "mm-imap-id@freron.com")
20:18:46 S: A3 BAD User is authenticated but not connected.
20:18:46 Warning: Detected Exchange IMAP server response state bug. Trying to work around it by interpreting it as a temporary connection issue.
20:18:46 Error code: 1004
20:18:46 Failed action (1000). Reset observed read/write timeouts: 8/8

20:18:46 Handling reply
20:18:46 Running action
20:18:46 Handling request
20:18:46 Trying to disconnect nicely (8)...
20:18:46 C: A4 LOGOUT
20:18:46 S: * BYE Microsoft Exchange Server IMAP4 server signing off.
20:18:46 S: A4 OK LOGOUT completed.
20:18:46 Clearing connection to outlook.office365.com
20:18:48 Ready to run action (type: 1000, retry count: 2)
20:18:48 Clearing connection to outlook.office365.com
20:18:48 Trying to connect to outlook.office365.com on port 993 (CFNetwork) without STARTTLS (required)
20:18:48 Resolved hostname (outlook.office365.com).
20:18:48 Prepare secure connection...
20:18:48 Successful connection.
20:18:48 Initiating secure connection...
20:18:48  Returned (4)...
20:18:48 Protocol version: kTLSProtocol12
20:18:48 S: * OK The Microsoft Exchange IMAP4 service is ready. [UABBAFoAUAAyADYANABDAEEAMAAxADcANQAuAEYAUgBBAFAAMgA2ADQALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
20:18:48 C: A0 CAPABILITY
20:18:48 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
20:18:48 S: A0 OK CAPABILITY completed.
20:18:48 Retrieving password (keychain or user request)
20:18:48 C: A1 AUTHENTICATE XOAUTH2 ••••••••••
20:18:50 S: A1 OK AUTHENTICATE completed.
20:18:50 C: A2 CAPABILITY
20:18:50 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE CHILDREN IDLE NAMESPACE LITERAL+
20:18:50 S: A2 OK CAPABILITY completed.
20:18:50 C: A3 ID ("name" "MailMate" "version" "r5890" "vendor" "Freron Software" "contact" "mm-imap-id@freron.com")
20:18:50 S: A3 BAD User is authenticated but not connected.
20:18:50 Warning: Detected Exchange IMAP server response state bug. Trying to work around it by interpreting it as a temporary connection issue.
20:18:50 Error code: 1004
20:18:50 Failed action (1000). Reset observed read/write timeouts: 8/8

20:18:50 Handling reply
20:18:50 Running action
20:18:50 Handling request
20:18:50 Trying to disconnect nicely (8)...
20:18:50 C: A4 LOGOUT
20:18:50 S: * BYE Microsoft Exchange Server IMAP4 server signing off.
20:18:50 S: A4 OK LOGOUT completed.
20:18:50 Clearing connection to outlook.office365.com
20:18:53 Ready to run action (type: 1000, retry count: 3)
20:18:53 Clearing connection to outlook.office365.com
20:18:53 Trying to connect to outlook.office365.com on port 993 (CFNetwork) without STARTTLS (required)
20:18:53 Resolved hostname (outlook.office365.com).
20:18:53 Prepare secure connection...
20:18:53 Successful connection.
20:18:53 Initiating secure connection...
20:18:53  Returned (4)...
20:18:53 Protocol version: kTLSProtocol12
20:18:53 S: * OK The Microsoft Exchange IMAP4 service is ready. [UABBAFoAUAAyADYANABDAEEAMAAwADIAMAAuAEYAUgBBAFAAMgA2ADQALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
20:18:53 C: A0 CAPABILITY
20:18:53 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
20:18:53 S: A0 OK CAPABILITY completed.
20:18:53 Retrieving password (keychain or user request)
20:18:53 C: A1 AUTHENTICATE XOAUTH2 ••••••••••
20:18:55 S: A1 OK AUTHENTICATE completed.
20:18:55 C: A2 CAPABILITY
20:18:55 S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE CHILDREN IDLE NAMESPACE LITERAL+
20:18:55 S: A2 OK CAPABILITY completed.
20:18:55 C: A3 ID ("name" "MailMate" "version" "r5890" "vendor" "Freron Software" "contact" "mm-imap-id@freron.com")
20:18:55 S: A3 BAD User is authenticated but not connected.
20:18:55 Warning: Detected Exchange IMAP server response state bug. Trying to work around it by interpreting it as a temporary connection issue.
20:18:55 Error code: 1004
20:18:55 Failed action (1000). Reset observed read/write timeouts: 8/8

20:18:55 Handling reply
20:18:55 Error: Failed multiple retries (4). Final error code was 1004.
20:18:55 Terminating non-running connection...

Comments and changes to this ticket

  • benny

    benny May 6th, 2022 @ 06:46 PM

    It does look like a server issue. The authentication seems to work fine, but then the server fails with the message User is authenticated but not connected.. This is not a standard response (and it shouldn't use BAD for this type of problem). Seems to be some kind of problem with the connection between IMAP interface and the Exchange server, but this is not related to MailMate. My guess is that you would see the same behavior with Thunderbird (but not with Apple Mail which would connect directly to Exchange using a different protocol). Try contacting your IT department.

  • Nicola Carboni

    Nicola Carboni May 27th, 2022 @ 05:37 PM

    Thank you, I got in contact with them and it appears that the mails were not migrated to Office 365 yet, so adding outlook.office365.com as imap server does not work, and adding their imap server does not allow me to set up OAUTH2 (any idea on how to do so?). On the other hand, they will probably migrate to Office 365 soon, so I hope the problem it will be resolved then

  • Nicola Carboni

    Nicola Carboni June 2nd, 2022 @ 09:37 AM

    in the meanwhile the mailbox has been migrated to office 365, and everything works great. Thank you for the support! The ticket can be closed

  • benny

    benny June 23rd, 2022 @ 06:16 PM

    • State changed from “new” to “closed”

    I'm glad it worked out for you. Just for the record, OAuth2 is only possible for outlook.office365.com. (Each domain requiring OAuth2 has to be explicitly supported by MailMate and for that to work, the provider has to provide some way for MailMate to be registered.)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages