Our University uses Microsoft services for outgoing mail from servers. Authentication between our moodle site and the campus SMTP service requires OAuth2 authentication.
I have successfully configured the key/secret handshake and the service endpoints. When I 'connect to system account' using our service account, which is what I am supposed to use as the outgoing user, the OAuth2 services happily connect and authenticate with MS Azure AD services. So all seems good there. Green tick marks etc.
But when I go to configure Outgoing Mail Services, there is no option to choose XOAUTH2 as the smtpauthtype. The four options that I have are LOGIN | PLAIN | NTLM | CRAM-MD5
The rest of the outgoing mail config looks correct and the same as several help pages I have consulted. Port 587 etc.
I tried enabling the OAuth2 plugin (which seems mostly to relate to OAuth2 authentication into our Moodle site (which we don't really need) but this has not helped.
I also manually changed the strings in authtypeoptions in the settings.php file for our Moodle site. That does allow me to pick XOAUTH2 as an option, it seems that we need more than just that string to be correct.
I have looked quite extensively for a fix. All the relevant help pages seem to assume that I can pick the XOAUTH2 option as my smtpauthtype.
So what am I missing?