What exactly do you need this for? If it's for authenticating with their IMAP/SMTP, app passwords have worked for me with Gmail, even on 2FA-secured G Suite accounts. No idea about Microsoft though.
https://support.microsoft.com/en-us/account-billing/using-ap...
Currently you have to allow "less secure apps" on your Google account to use K-9.