More info:
osTicket Version: v1.17
Apache 2.4.41(ubuntu)
MySQL: 8.0.31
PHP: 8.0.24
outgoing working but remote Mailbox has problem .
OAuth2 passes successfully.
cannot connect to host ; error = fsockopen(): Unable to connect to ssl://outlook.office365.com:993 (Unknown error) (errno = 0 )