OJS 3.1.2 SMTP Office 365

I have a problem with OJS SMTP server configured with O365 server. The system sends e-mails on the settings below, but the return address is ojs@domain.edu.
smtp_server = smtp.office365.com
smtp_port = 587
smtp_auth = tls
smtp_username = ojs@domain.edu
smtp_password = pass

allow_envelope_sender = On
default_envelope_sender = ojs@domain.edu
force_default_envelope_sender = On
force_dmarc_compliant_from = On

I would like the return address for a given journal to be the Principal Contact in a given journal, ie ojs-journal@domain.edu. The ojs-journal@domain.edu mailbox set up with permissions that the ojs@domain.edu account can send messages as ojs-journal@domain.edu and from it. Unfortunately it does not work. Log error:

SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message.

Regards, Krzysztof

Hello @krzysztof .
Do you have SSH?
Install swaks and…
Test this, if you want

swaks --to test@test.com -s smtp.office365.com:587 -tls -au ojs@domain.edu -ap PASSW*RD

swaks --to test@gmail.com --from ojs-journal@domain.edu -s smtp.office365.com:587 -tls -au ojs@domain.edu -ap PASSW*RD

Any suggestions?

Regards, Krzysztof

Hello @krzysztof , can you test…

Hello @juanito,
It doesn’t work…

Hello @krzysztof
Dou you test …