Due to the requirements from Microsoft for CSPs to enable Multi Factor Authentication together with Security Defaults, it is no longer possible to use IMAP/SMTP for email communication. You would have to use a paid AD plan to get the ability to use app passwords again.
I would like to see that we can connect to Office 365 using modern authentication. Basically, you would have to create an app in the Azure AD that then allows authentication via Graph to either read or send emails.