Postfix SMTP relay to Office 365 for email notifications

Checkmk uses the main mailer on the OS to send mail. I set up sendmail on Ubuntu in the past with smtp relay for Office365 and Checkmk is still using that. But since OAuth got mandatory for Office356, I changed config and went for our alternative domain not managed by Office365 as a ‘temporary’ workaround, till I find time to figure out to do sendmail with OAuth.

So if you figure it out with sendmail, I’m interested in the solution.