You are using the Clarity Mail Service. You have it pointed to an Azure app / Office 365. You can generate the OAUTH token and Refresh Token, but once the Mail Service Polls, it fails to authenticate with Azure.
Steps to Reproduce:
2024/03/27 13:05:09.940 | DEBUG IMAPS: trying to connect to host "imap-mail.outlook.com", port 993, isSSL true
2024/03/27 13:05:10.040 | * OK The Microsoft Exchange IMAP4 service is ready. [####################################################################]
2024/03/27 13:05:10.040 | ADZ0 CAPABILITY
2024/03/27 13:05:10.040 | * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
2024/03/27 13:05:10.040 | ADZ0 OK CAPABILITY completed.
2024/03/27 13:05:10.041 | DEBUG IMAPS: AUTH: PLAIN
2024/03/27 13:05:10.041 | DEBUG IMAPS: AUTH: XOAUTH2
2024/03/27 13:05:10.041 | DEBUG IMAPS: protocolConnect login, host=imap-mail.outlook.com, user=############@##############.com, password=<non-null>
2024/03/27 13:05:10.041 | DEBUG IMAPS: AUTHENTICATE PLAIN command trace suppressed
2024/03/27 13:05:10.941 | DEBUG IMAPS: AUTHENTICATE PLAIN command result: ADZ1 NO AUTHENTICATE failed.
Expected Results: Mail Service Polls mailbox successfully
Actual Results: Mailbox poll fails with an authentication error
Clarity 16.1.3, 16.2, 16.2.1
DE79209
Workaround: Use IMAP with Basic Authentication (in contrast to OAUTH). De-select "Prefer TLS" and set the "Encryption Type" to 'None'. De-select "Prefer TLS" and set the "Encryption Type" to 'None'
DE79209 is fixed in 16.3.0 (Targeted to release November 2024) and also backported to 16.2.3 patch 1