Recently the support for OAuth 2.0 for IMAP and SMTP in the Exchange Online has been announced. Following the guide I\'ve set up the application permissions and IMAP and SMT
javax.mail example sending email using XOAUTH and O365 SMTP
I only ask those scopes needed for sending email... (not using Graph). Probably I have configured some permissions not needed.