Google recommends to use “more secure apps” that are not using basic authentication with username and password. They still allow “less secure app access” for now for Google Workspace accounts.
Microsoft on the other hand already disabled basic auth on the 1st of October 2022. So accessing a Exchange Online mailbox using IMAP and authenticate with username and password is not supported anymore.
I posted that issue here Email authentication Oauth M365 / Exchange Online - ERPNext / User Forum - ERPNext Forum but didn’t yet get a response.
@TurkerTunali do you have an idea, how to solve this?