6

My mail user agent of choice is mutt, and I'm signing my mail using GnuPG. To make them work together, I have set crypt_use_gpgme=yes in .muttrc.

Reading mail, I am asked to enter my OpenPGP key's passphrase, which is the expected behaviour. But instead of having to input it within the mutt prompt line, there is a GUI popup. This doesn't work without X, of course.

Is there a good way of not having this popup, but to enter the password within mutt, instead?

7

When used with gpg-agent, GnuPG uses a "pinentry" utility to query for the passphrase. There are different pinentry options; it seems you're using one of the graphical ones.

As an alternative, I'd propose you try out the two command line based pinentry options, one using curses, the other one plain comman line queries:

$ apt-cache search 'pinentry-(curses|tty)'
pinentry-curses - curses-based PIN or pass-phrase entry dialog for GnuPG
pinentry-tty - minimal dumb-terminal PIN or pass-phrase entry for GnuPG

They should also be available for non-Debian based distributions und similar names. After installing them, also configure gpg-agent to use them (from man gpg-agent):

Please make sure that a proper pinentry program has been installed under the default filename (which is system dependent) or use the option pinentry-program to specify the full name of that program. It is often useful to install a symbolic link from the actual used pinentry (e.g. /usr/bin/pinentry-gtk) to the expected one (e.g. /usr/bin/pinentry).

If you prefer the configuration file option, edit ~/.gnupg/gpg-agent.conf.

  • 1
    Thanks, I needed to be pointed in that direction ;) In Archlinux, pinentry-curses is installed with the pinentry package as part of the core package group. pinentry-tty can be installed from AUR. Configuration is simple: in ~/.bashrc put "export GPG_TTY=$(tty)", and in ~/.gnupg/gpg-agent.conf put "pinentry-program /usr/bin/pinentry-curses", then restart the agent: "echo RELOADAGENT | gpg-connect-agent". It works on my system. I also tried pinentry-tty, but it did not work for me, as the password prompt appears, but then crashes. – Philipp Oct 24 '15 at 13:47
  • The crash probably occurs as mutt handles console I/O on some way not compatible to pinentry-tty. I think mutt uses (n)curses, anyway. – Jens Erat Oct 24 '15 at 13:48
  • 1
    In addition to my first comment: the 'pinentry-tty' and 'pinentry-curses' binaries are now included in the pinentry package from the core package repository in Archlinux. No other package is needed. – Philipp Oct 28 '18 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.