signing mails with MUA mutt fails

Werner Koch wk at gnupg.org
Wed Dec 23 20:40:24 CET 2015


On Wed, 23 Dec 2015 18:54, guru at unixarea.de said:

> To sign mails one configure in the MUA the command in the following
> form:

You should put

  set crypt_use_gpgme

into your ~/.muttrc to use the modern (ie. from ~2003) version of Mutt's
crypto layer. it works much better that the bunch of configured commands.

> gpg2 --batch --output - --passphrase-fd 0 --armor --sign --detach-sign --textmode -u %a %f

--passphrase-fd 0

does not work with gpg2 (since 2.1) because the gpg-agent is responsible
for the private keys and the passphrase to protect them.  If you are
using an xterm the GUI Pinentry pops up from the background (controlled
by the existence of the DISPLAY envvar).  If you are using a plain tty,
either the curses pinentry or the dump tty only pinentry can be used.
The curses pinentry is used part of the GUI pinentry and used if DISPLAY
is not set.  Take care to set the GPG_TTY envvar (man gpg-agent).

If you really need it with 2.1 you may also use the loopback mode which
allows to gpg2 for ask for a passphrase in a similar but not indentical
way gpg1 and pgp did.  Put

  allow-loopback-pinentry

into ~/.gnupg/gpg-agent.conf and restart the agent.  Add

  --pinentry-mode=loopback

to the gpg command line.


> running with --debug gives some kind of error in the communication with
> the agent: 
>
> $ killall gpg-agent

> gpg: DBG: chan_7 -> AGENT_ID
> gpg: DBG: chan_7 <- ERR 67109139 Unknown IPC command <GPG Agent>

That error is expected: it is a test for the former GNOME gpg-agent
replacement.

> gpg: DBG: chan_7 <- ERR 83886340 Invalid IPC response <Pinentry>
> gpg: signing failed: Invalid IPC response

Something is wrong with your pinentry.  To debug this you add

--8<---------------cut here---------------start------------->8---
log-file /foo/bar/gpg-agent.log
verbose
debug-pinentry
debug ipc
--8<---------------cut here---------------end--------------->8---

into gpg-agent.conf  ("debug ipc" Is the same as "debug 1024")


Salam-Shalom,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-users mailing list