Unable to send mails against an outlook365 server (oauth autentication issue)

Describe the problem you would like to solve

I’m trying to configure my OJS 3.3.0-11 (dockerized version) to auth2 against our fraking institutional outlook365 server.

In same server I have some OJS 3.2 (dockerized versions) that can send mails without any trouble, so I copy the mail section from my 3.2 to 3.3. Settings are like follows (removed comments):

[email]
smtp = On                                   
smtp_server = "smtp.office365.com"                                     
smtp_port = 587
smtp_auth = starttls                    ; Also fails with "tls" and "ssl"
smtp_username = "myID@uab.cat"
smtp_password = "myPwd"                                                                │
smtp_authtype = XOAUTH2
smtp_suppress_cert_check = On 
allow_envelope_sender = On
default_envelope_sender = NonPersonalMail@uab.cat
force_default_envelope_sender = On
force_dmarc_compliant_from = On
dmarc_compliant_from_displayname = '%n via OJS Training'
time_between_emails = 3600
max_recipients = 10
require_validation = On
validation_timeout = 14

When I telnet against smtp server, M$ answers… but when I ask OJS 3.3 to send a mail, the frontend reports that is not possible and backend logs says that is not able to connect:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Describe the solution you’d like
Well… I like to send mails. :slight_smile:

Additional information
My guess is something changed in phpMailer settings between OJS 3.2 and 3.3 but I’m not able to discover what. Other option is my docker version for OJS 3.3 is missing a library or something to send mails (my 3.2 is based on apline, while 3.3 is a new image based on debian).

Any suggestion is welcome.

With OAuth2 it looks like you need to configure these parameters, did you do so?

; smtp_oauth_clientid =
; smtp_oauth_clientsecret =
; smtp_oauth_refreshtoken =

Thanks @mpbraendle

I will give a try (if I find where M$ hides this in outlook365)… but OAuth2 is working great in OJS 3.2 without them. :thinking:

Cheers,
m.

I didn’t found a solution for this.

My workaround was via SPF records… asking to my institution to temporary add SPF records of the external domain to their DNS, but it’s a dirty fix.

I’m starting to think we are facing a real issue and something is broken in 3.3 oauth2 (or is not playing nicely with the random rules os M$ outlook).

Nobody found similar problems?