[Solved] Institutional Office365 Error Setting up account : IMAP/SMTP

Description

I have tried setting up a new account as Office 365 on which I get “Authentication Error - Check your username and password. (SMTP)”

Setting up a new Office365 account with SMTP AUTH (IMAP/SMTP) results in Authentication Error - Check your username and password. (SMTP). I understand modern auth is still a WIP with Mailspring , but looks like the classic SMTP AUTH is also broken.

To Reproduce…

Setup a new O365 account in Mailspring.

LOGS

----------IMAP----------
connect <mailcore::IMAPSession:0x7ffeefbff698>
* OK The Microsoft Exchange IMAP4 service is ready. [UwBHAFgAUAAsdABDAEEAMAAwADAAMQAuAFMARwBQAFAAMgA3ADQALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
ssl connect outlook.office365.com 993 2
1 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
connect ok
login
2 LOGIN "xx@csg.com" *********
2 OK LOGIN completed.
3 CAPABILITY
* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE CHILDREN IDLE NAMESPACE LITERAL+
3 OK CAPABILITY completed.
4 NAMESPACE
* NAMESPACE (("" "/")) NIL NIL
4 OK NAMESPACE completed.
login ok
5 LIST "" "*"
* LIST (\HasNoChildren) "/" Archive
* LIST (\HasChildren) "/" Calendar
* LIST (\HasChildren) "/" Contacts
* LIST (\HasChildren) "/" "Conversation History"
* LIST (\HasNoChildren \Trash) "/" "Deleted Items"
* LIST (\HasNoChildren \Drafts) "/" Drafts
* LIST (\HasNoChildren) "/" Important
* LIST (\Marked \HasNoChildren) "/" INBOX
* LIST (\HasNoChildren) "/" Trash
5 OK LIST completed.

----------SMTP----------
connect smtp.office365.com 587
220 SGXP274CA0018.outlook.office365.com Microsoft ESMTP MAIL Service ready at Mon, 22 Feb 2021 10:36:41 +0000
init
EHLO iMac.local
250-SGXP274CA0018.outlook.office365.com Hello [xx.xx.xx.xx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
start TLS
STARTTLS
220 2.0.0 SMTP server ready
done
init after starttls
EHLO iMac.local
250-SGXP274CA0018.outlook.office365.com Hello [xx.37.xx.xx]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN XOAUTH2
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8
AUTH LOGIN
334 VXNlcmxxxU6
YW5rdXNoQGNsxxxxxxxxxxxx5pbg==
334 UGFzc3dvcmQ6
bHpxam1uxxxxxxxxxxxJ2aA==
535 5.7.139 **Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visit aka.ms/smtp_auth_disabled for more info.** [SGXP274CA0018.SGPP274.PROD.OUTLOOK.COM]


SASL_PATH: 

SMTP Last Response Code: 535
SMTP Last Response: 5.7.139 Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. **Visit aka.ms/smtp_auth_disabled for more info**. [SGXP274CA0018.SGPP274.PROD.OUTLOOK.COM]


mailsmtp Last Error Code: 17
mailsmtp Last Error Explanation: MAILSMTP_ERROR_AUTH_LOGIN
mailsmtp Last Error Location: 10
mailsmtp Last Auth Type: 16

I am also the administrator of my domain and have the following

  • 2-FA is enabled and App passwords are being used for Mailspring.
  • Set-TransportConfig -SmtpClientAuthenticationDisabled $true - this is set to globally disable SMTP AUTH for all mailboxes
  • Set-CASMailbox -Identity -SmtpClientAuthenticationDisabled <$true - this is also set to be disabled on the user level mailbox - just as a second layer
  • Additionally security defaults are disabled
  • No Conditional Access policy is set

I am on a MAC running MacOS BigSur x86 11.2.1 Mailspring v 1.8.0

We have a few open issues regarding Office365 we hope to resolve in the short term. Are any of these topics related?

https://community.getmailspring.com/tag/microsoft

Im stupid ! The error clearly stated that “SmtpClientAuthentication is disabled for the Mailbox”. I needed to enable it. The Microsoft naming got me ( double negatives is a positive !)

Please discard this - Setting the below to false got the client to register sucesfully

  • Set-TransportConfig -SmtpClientAuthenticationDisabled $false
  • Set-CASMailbox -Identity -SmtpClientAuthenticationDisabled <$False

Thank you for looking through

1 Like

Nah, you’re not stupid. It’s easy to miss this stuff.

Glances meaningfully at his server in the corner.

This topic was automatically closed 8 hours after the last reply. New replies are no longer allowed.