TL;DR: K-9 Mail can currently only access Gmail/Google Workspace accounts if you enable 2-step verification and create an app-specific password.
The problem
Since the end of May 2022 Google no longer allows you to use your Google password when accessing your email via IMAP, POP3, or SMTP (this is what K-9 Mail uses to retrieve/send emails). That’s a good thing, because your Google password allows access to a whole range of Google services. There’s no need for an email client to potentially have access to all of these services.
The current solution
The easy way to support existing email clients is for the email provider to allow their users to create app-specific passwords. That way the user can grant email clients access to only email, but no other services. The app-specific password can also easily be revoked without having to change the main password, e.g. if your device using the app-specific password was lost/stolen.
Google supports app-specific passwords, but only if 2-step verification is enabled for your account.
Currently this is the only way to access your Gmail/Google Workspace account using K-9 Mail.
The “proper” solution
What Google wants email clients to use, is OAuth. This involves the app opening the browser to allow the user to sign in to the provider, then granting the app access to the service it requested access to (in our case email). Behind the scenes the browser will return an access code to the app that it can then use to retrieve/send email.
Conceptually you can think of this as a streamlined way for the user to generate an app-specific password and passing it to the app. Only that the user never gets to see the password and doesn’t have to manually copy it from a website into the app.
The “problem” with this approach is that developers have to register their apps with the service before they are allowed to use this method. In the case of Google, not only is a registration required, they also verify that the app is following all their guidelines before an app is allowed to use this method.
We’re currently working on adding support for this mechanism, or rather we have added support for it and now will have to keep making changes until Google is satisfied. We’ll release K-9 Mail 6.200 once that work is complete.
For updates, check out The plan for K-9 Mail 6.200.
See also: How to set up with a Gmail account