Kmail, Gmail, 2FA, OAUTH

How on earth do I get Kmail to work with Gmail and 2fa? Surely there is a step by step guide somewhere but I after searching for an hour I haven’t found one. Can anyone assist?

Unfortunately it seems as though KMail lacks OAUTH2 support for Gmail. I’d recommend Thunderbird until the devs add support.

Until then, perhaps you can use app-specific passwords?

The last time I used Thunderbird it downloaded fifteen years worth of messages to my internal disk and it seemed like there was no simple way to change this. Is it possible to use TB like I would use FairEmail/k9 or any other mobile client (in other words, without downloading the messages locally)?

Google discontinued app-specific passwords about a year ago.

“less secure apps” are discontinued, but app specific passwords are still available. You’ll need to set one for kmail to get it working. For sending emails you need to set smtp.googlemail.com (instead of default gmail) as the email server and set authentication type to PLAIN. You’ll probably have to do the same for receiving messages replacing gmail with googlemail in the imap or pop server text box. For authentication type I’m using “plain text” on receiving. That’s how I managed to get kmail with gmail working on my devices.