I use mu4e
, mu4e-send-delay
to send emails with a delay, GPG to store my SMTP authentication, and pinentry
to access GPG files. When I am prompted for the GPG encryption password in the mini-buffer but am typing in another buffer and don't notice it, Emacs remembers that entry and keeps trying to open the GPG file with that wrong password. I then get the *Error*
buffer next to my other buffer:
Error while decrypting with "/usr/local/bin/gpg":
gpg: AES encrypted data
gpg: gcry_kdf_derive failed: Invalid data
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key
and a user dialog Emacs-x86_64-10_14
, Buffer *temp* modified; kill anyway?
, and buttons with Yes
and No
.
Emacs has the same behavior if I restart it, probably because pinentry
remembers the password for the session.
How can I force Emacs or pinentry
to prompt for a new password? And could I force that prompt to happen in a user dialog, which is more noticeable than the mini-buffer?
gpgconf --kill gpg-agent
– Muihlinn Sep 26 '19 at 8:38ps -ef | grep gpg
to find the process ID ofgpg-agent
(if it's running, it will return 2 process IDs, one forgpg-agent
and one for the search process itself), and then kill it withkill <process ID>
. This solution is much more elegant. – miguelmorin Sep 26 '19 at 8:48gpg-agent
to forget passwords that fail at decryption? – miguelmorin Sep 26 '19 at 8:59gpg --quiet --for-your-eyes-only --no-tty --decrypt pwd-file.gpg
. The app will fail to login if you make typos, but you won't have to mess up with the agent recalling wrong passwords, it'll only recall it if it succeed. – Muihlinn Sep 26 '19 at 9:10