问题
After switching the Linux Distributions, gpg changed and I could not encrypt any emails. Even my own. Enigmail gave me "No matching secret key found to decrypt message" error message.
Before:
$gpg --version
gpg (GnuPG) 2.1.18
libgcrypt 1.7.6-beta
Now:
$gpg2 --version
gpg (GnuPG) 2.2.13
libgcrypt 1.8.4
Both have Enigmail 2.0.9.
回答1:
In the end, this helped: https://sourceforge.net/p/enigmail/forum/support/thread/03ebee57/
gpg2 --edit-key 0xYourKeyId setpref save
(0xYourKeyId
taken from gpg2 --list-secret-keys
)
EDIT: ok, this does not work. I can decrypt messages for like 5 minutes since I had to unlock the keychain in the dialog.
回答2:
It's been long time since you wrote. Nevertheless I'd try to give it a chance, as I think similar problem still might happen (again).
First of all try this command:
gpg-agent --daemon
Expectation is, it would show you if something is wrong with config file(s). Example output:
gpg-agent[22861]: /home/<REPLACE_WITH_YOUR_USERNAME>/.gnupg/gpg-agent.conf:13: invalid option
This, for example, is telling you: "Line 13 in that file contains invalid setting option". In this case, edit that file, remediate the error or comment out the line creating the error for example like this:
Edit the file. Example, in your console/terminal, try one of this:
nano /home/REPLACE_WITH_YOUR_USERNAME/.gnupg/gpg-agent.conf
gedit /home/REPLACE_WITH_YOUR_USERNAME/.gnupg/gpg-agent.conf
editor /home/REPLACE_WITH_YOUR_USERNAME/.gnupg/gpg-agent.conf
now go to that line (here in the example it is line 13), and replace its content, example
ignore-caching-for-signing
with the line
# ignore-caching-for-signing
Plsease note the '#' in front of the line, which is the comment sign to deactivate the invalid option.
Go to line 1. above and repeat the gpg-agent command, and the steps up to this line, until the gpg-agent starts without complaining about invalid options
gpg-agent --daemon
Now start thunderbird with enigmail, and click on the encrypted mail. From my experience, you should now be able to see its content.
来源:https://stackoverflow.com/questions/54870973/enigmail-error-no-matching-secret-key-found-to-decrypt-message