How do I configure SMTP with STARTTLS?
For performance, avoid remote SMTP entirely.

Using SMTP directly to hosted mail products will be tangibly slower while the SMTP transaction blocks the PHP request; having a "real" local MTA which then smarthosts to Office 365 allows CiviCRM to offload messages quicker (local process/filesystem versus remote network).

Stack Exchange prefers documenting the actual process to external links but in this case I'll do the latter since you have several options, and hey, I'm already not answering your actual request :)


Configure CiviCRM to use local mail delivery, AND
Configure Postfix to smarthost to office365 using SMTP auth for a single origin address, OR
Configure Postfix to smarthost to office365 using Office365 connectors for multiple origin addresses, OR
Do the same for your preferred local MTA.