Steps to configure pop3 using oAuth2 with Microsoft365

Hello,
going through the topic,

on configuring the authentication for bounce processing, did manage to install the plug-in, create the Tenant-ID, Client-ID and Secret, but am lost thereafter with making it work.
The error I get is “Cannot create POP3 connection to INBOX: Can not authenticate to IMAP server: Empty startup greeting (outlook.office365.com:993)”
Would appreciate some guidance on the step to configure the same.

@kaosar Have you seen the plugin documentation at plugin:oauth2 [phpList Resources]

Can you show a screenshot of the OAuth2 settings on the Settings page. Blank-out any of the confidential fields such as the client secret value.

I have just tried to use the plugin for the first time in a while with Azure and found that the redirect URL was not accepted. This is now explained in the documentation.

@duncanc Below is the screenshot of my settings page

I have created the Azure App settings URL as it is listed in the Redirect URL. When i create the URL as mentioned in the documentation,
https://mysite.com/OAuth2/authorise am unable to generate the access token

@kaosar Thanks. I was following the guidance at Redirect URI (reply URL) best practices and limitations - Microsoft identity platform | Microsoft Learn but I guess my account is a personal one whereas yours is probably a company account.

There are my phplist bounce settings. Using these with the OAuth2 plugin I can connect to the mailbox and retrieve any bounces using the “Process bounces using OAuth2” menu item.

$bounce_mailbox_host = 'outlook.office365.com';
$bounce_mailbox_user = 'xxxxxxxxxx@outlook.com';
$bounce_mailbox_port = '993/imap/ssl/debug';

@duncanc Modified my config.php file as per the settings you mentioned, especially the bounce_mailbox_port= ‘ssl’. It solved the issue. was using tls all this while

success

Thank you very much.