On Wed, 24 Jun 2015, 22:43:11 +0200, Lars Müller wrote:
On Wed, Jun 24, 2015 at 10:29:42PM +0200, Lars Müller wrote: [ 8< ]
Even if setting GPG_AGENT_INFO works for mutt it might even cause some trouble to other components as the old format offered offered three fields:
<path to Unix Domain Socket>:<gpg-agent PID>:<protocol version>
while with the setting GPG_AGENT_INFO workaround we're only able to offer the first.
test -z "${GPG_AGENT_INFO}" && \ export GPG_AGENT_INFO="$HOME/.gnupg/S.gpg-agent.$( pidof gpg-agent).1"
are you sure this works with gpg-2.1? If I understood the release notes correctly, it's just the plain "S.gpg-agent"; but, for mutt its value doesn't matter at all. The sources only check if such an environment variable is defined and if so simply skip asking for the passphrase itself, assuming gpg-agent will deal with it; you can try without GPG_AGENT_INFO being defined and enter a wrong passphrase when mutt asks for it... ;) Another option to avoid mutt asking for the passphrase might be to set crypt_use_gpgme=yes
But the question still remains: do we like something like this systemwide for the next six or 12 months?
I think we should. FWIW, it belongs into some X related startup file because there you can decide, if it's a new gpg-2.1 related configuration or if some older version is in use (which can be detected _because_ GPG_AGENT_INFO is already defined (by gnome-keyring-daemon via pam_gnome_keyring.so)). If you want to do this from within .bashrc, you should at least check if gpg-agent is already running. So, something like the following might work: ~/.bashrc: ... if [ -z "${GPG_AGENT_INFO}" ]; then # maybe gpg-2.1? if [ -n "$(pidof gpg-agent)" ]; # yep, this must be gpg-2.1 export GPG_AGENT_INFO="$HOME/.gnupg/S.gpg-agent" else # no gpg-agent is running, don't inject anything : fi else # OK, looks sane : fi BUT, what if there are several users logged in, each with their own gpg-agent process running...? Therefore the simple form belongs into the X session startup: test -z "${GPG_AGENT_INFO}" && \ export GPG_AGENT_INFO="$HOME/.gnupg/S.gpg-agent"
Cheers,
Lars
HTH, cheers. l8er manfred