Similar to https://todo.sr.ht/~sircmpwn/aerc2/42 :/
For the poor souls having to use Microsoft Office 365 at work (and who are not allowed to create an app password)
From what I understand and tested I can't use OAUTHBEARER with Office365, but XOAUTH2 is working.
Following the instructions from https://www.vanormondt.net/~peter/blog/2021-03-16-mutt-office365-mfa.html I've had some success using this contrib script from mutt:
(I haven't used and configured mutt for it, but the script was reporting everything as working)