Help Needed: ERPNext Incoming Email Setup with Microsoft 365

Dears

I’m currently facing an issue setting up incoming email in ERPNext using a Microsoft 365 account. I followed the official documentation provided here:
https://docs.frappe.io/framework/user/en/microsoft-email-oauth

However, the connection always times out without providing a clear error message for troubleshooting.

I’ve also tried using an app password, but that didn’t work either.

Is anyone successfully using Office 365 with ERPNext for incoming emails? If so, could you please share the correct and working setup steps?

Thank you in advance for your support.

Digitalocean closed the ports needed for the smtp