Enigmail (pinentry) issue

Symptoms

When opening (decrypting) a pgp encrypted e-mail the gpg banner presents the message:

  • Error - no matching private/secret key found to decrypt message; click on 'Details' button for more information

Sending a signed e-mails a pop-up appears presenting the message:

  • Error encryption command failed

Cause

Assumed: Enigmail uses an external 'pinentry' program to request the user for the gpg password. As Gnome3 was originally used, and LXDE was installed later (to be used via vnc) enigmail could not find the correspondin (lxde) compatible pinentry program.

Fix

  1. Install the pinentry program for qt: apt-install pinentry-qt.
  2. Configure the gnupg-agent to use this pinentry program by adding a line to its configuration file: cp ~/.gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf.bak && echo "pinentry-program /usr/bin/pinentry-qt" >> ~/.gnupg/gpg-agent.conf.
  3. Stop the gpg-agent: pkill gpg-agent.

For more detailed info see the: Reddit and: Askubuntu fora!