I cover this in my mutt page, but I thought it might be nice to have a quick explanation for those who use mutt or neomutt and perhaps msmtp to send mail, while using gmail. Whether Google really cares or is simply trying to make it harder to use non-Google approved methods is a debate for another place, but at any rate, as of May 30, 2022, if one has used a standard getmail setup with mutt, it will no longer work with with a gmail account. My thanks to daemonforums user fcc for his posts on this which explained it quite clearly.
This may be more complex for others with more elaborate setups, but for me it's fairly simple. My main use of gmail is on my main home computer, running FreeBSD. I use getmail to receive mail, neomutt to read it and msmtp to send it. Now to use it with gmail, one must use app passwords. It's actually fairly simple.
First go your gmail account and add 2FA. If you're always using the same machine, you will only have to do this once. Actually, if you use gmail's web interface, they may, each time you sign in on the web interface, do it, unless you check remember this device. Click your icon and there will be an option to manage your google account. Go there and click Security. Turn on two step verification. I've only had to enter a file sent by text twice, once when I first did this, and once when signing into gmail by web to remind myself of the steps for this article. In the case of the web sign in, I then put remember this device and was not asked if I signed in again.
Now that 2FA, (2 Factor Authorization, what Google calls 2-Step Verification), has been turned on, you can click the App password link towards the bottom. You'll be asked for your gmail password. Where it says Select app choose custom. I gave it the name getmail. It then generates a 16 character app password. In your $HOME/.getmailrc, use that password for your gmailrc setup.
As mentioned, I also use msmtp to send mail. In my $HOME/.msmtprc file, I put the same password for my gmail stanza.
Now you will be able to use getmail and msmtp with gmail without any issues. As mentioned, if I do sign into the web, I may once again have to input a password sent to my phone, but on this computer, I haven't had to do 2FA since I set it up. Note that if you do log into the web interface, you use your regular gmail password, not the app one.