TL;DR: If you upgraded GpgME to version 2, Thunderbird’s “External GnuPG” integration will break. The workaround is to set Thunderbird’s config mail.openpgp.load_untested_gpgme_version to 45 in about:config. This affects Windows users with Gpg4Win v5+, Arch Linux users, Debian sid, Fedora Rawhide (at the time of writing). If you are a Windows user and have followed Mozilla’s wiki to modify your PATH, it needs to be updated as well.
I recently updated Gpg4Win to version 5, and it breaks Thunderbird’s “External GnuPG” integration.
For some background, Thunderbird has a native implementation of OpenPGP based on RNP; however, this implementation does not support all features of GnuPG, for example, smartcards. As I use a YubiKey to store my main PGP keys, RNP is sadly not an option. To work around it, Thunderbird allows you to use an external GnuPG installation, which is what I have been doing for years. Under the hood, Thunderbird uses the library GpgME to talk to GnuPG. This is documented quite sparsely but Mozilla provides some documentation in its wiki.
Historical note: Thunderbird users historically used the Enigmail extension, which is unsupported since Thunderbird has OpenPGP support built-in.
However, this integration broke with the recent released GpgME 2. This bug is tracked on Bugzilla and fixed in Thunderbird 140.8.1esr. The code in question is here: Thunderbird loads the hard-coded libgpgme-11.dll or libgpgme.so.11 by default. The .so number 11 is used by all of GpgME 1.x, but GpgME 2.x uses .so.45 (or libgpgme-45.dll on Windows).
Therefore, we need to use the config mail.openpgp.load_untested_gpgme_version to tell Thunderbird to load the newer GpgME 2.x. To do this, open Settings - “Config Editor” in Thunderbird, search for load_untested_gpgme_version, and set it to 45. After that, Thunderbird should be able to use gpg again without issues. This new config term is in the release notes, but not documented anywhere else, so I thought it would be useful to write a blog post about it.
However, since it’s called “untested”, it means that some features are not fully compatible; for example, the new gpg/gpgme supports LibrePGP format keys/signatures (v5 packet) which Thunderbird does not support (and is unlikely to support in the future since RNP is based on RFC 9580). This is due to some drama in the PGP standardization community; you can refer to [1] [2] if you are interested.
Additional note about PATH for Windows users
Also: for Gpg4Win users on win64, the aforementioned wiki instructs you to put C:\Program Files (x86)\Gpg4Win\bin_64 in your PATH. Gpg4Win 5.x has another change that it builds natively for 64-bit Windows, so it now installs to C:\Program Files\, and the path should be C:\Program Files\Gpg4Win\bin now. You need to update your PATH variable accordingly.