How to prevent the popup password prompt when using GnuPG with mutt?

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?


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.