Re: [PATCH] cli: crypto: tell gmime to use gpg-agent
authorJameson Graef Rollins <jrollins@finestructure.net>
Wed, 27 Feb 2013 16:14:41 +0000 (08:14 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:46 +0000 (09:53 -0800)
09/a115b82be02c7bfeac8547d6d13e051a1e6d1b [new file with mode: 0644]

diff --git a/09/a115b82be02c7bfeac8547d6d13e051a1e6d1b b/09/a115b82be02c7bfeac8547d6d13e051a1e6d1b
new file mode 100644 (file)
index 0000000..1e5905c
--- /dev/null
@@ -0,0 +1,120 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 9EAEB431FB6\r
+       for <notmuch@notmuchmail.org>; Wed, 27 Feb 2013 08:14:50 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id wtTZZlBLy71f for <notmuch@notmuchmail.org>;\r
+       Wed, 27 Feb 2013 08:14:48 -0800 (PST)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6F3AD431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 27 Feb 2013 08:14:48 -0800 (PST)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id D0B7C66E00F8;\r
+       Wed, 27 Feb 2013 08:14:47 -0800 (PST)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (DHCP-123-224.caltech.edu [131.215.123.224])\r
+       (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id D658466E011C;\r
+       Wed, 27 Feb 2013 08:14:43 -0800 (PST)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id B154E61745; Wed, 27 Feb 2013 08:14:43 -0800 (PST)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] cli: crypto: tell gmime to use gpg-agent\r
+In-Reply-To: <1361950838-22919-1-git-send-email-jani@nikula.org>\r
+References: <1361950838-22919-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.15+8~gd4a7374 (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Wed, 27 Feb 2013 08:14:41 -0800\r
+Message-ID: <87hakxpwcu.fsf@servo.finestructure.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha256; protocol="application/pgp-signature"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 27 Feb 2013 16:14:50 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+On Tue, Feb 26 2013, Jani Nikula <jani@nikula.org> wrote:\r
+> For decryption, we expect there to be a functioning gpg-agent, and we\r
+> want gpg to talk to it for any needed credentials. There's a gmime\r
+> function to declare that: g_mime_gpg_context_set_use_agent() [1], [2].\r
+> Start using it.\r
+>\r
+> I had gpg-agent running, but gpg "use-agent" configuration option\r
+> disabled. This resulted in an error message from 'notmuch show':\r
+>\r
+>   Failed to decrypt part: Canceled.\r
+>\r
+> and json had this:\r
+>\r
+>   "encstatus" : [ { "status" : "bad" } ]\r
+>\r
+> One could argue the "use-agent" option should be enabled, but I'd like\r
+> to use the agent only as a last resort. I think that's irrelevant\r
+> though. There's a gmime function to declare what we expect, so we\r
+> should use it. Conveniently it also fixes the problem in a user\r
+> friendly way.\r
+\r
+I will argue that the "use-agent" option should be enabled.  If we force\r
+use of gpg-agent, then we don't allow people to opt out of using it.\r
+That's not very user friendly, particularly if someone has not enabled\r
+it for a specific reason.\r
+\r
+But I think more to the point we need a little bit of due diligence of\r
+the effects of this before we enable it.  What happens if gpg-agent is\r
+not available?  What happens if there is no X session?  Tests that probe\r
+the various circumstances would be useful.\r
+\r
+I do note, though, that the error messages are not very useful.  It\r
+would be nice if could figure out that the decryption failed because of\r
+lack of agent and inform the user of that.\r
+\r
+We should probably also update the show man page to make explicit that\r
+an agent may be required.\r
+\r
+jamie.\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.12 (GNU/Linux)\r
+\r
+iQIcBAEBCAAGBQJRLjDxAAoJEO00zqvie6q80YwP+wYQwBco4kcfFiwI6eHjxA3R\r
+jx6vGOBal6z3ET7WcS06YdY4iX/CuBJZu72NbR8TwMxU9JoW7Fq95ovWJdsPirJx\r
+gXzvPQtHt9RjDYVeateVDHKylqtz0PRdXzlndGEexRTG6jkaY1AqMzUkRnd5YBvJ\r
+pH+WYDTg10COnxEi5QdR5Bb9fBQQvykAvX4is6D76aGNpr4kexlbqiFPWILQzLwS\r
+vjikP2ZB8PF7pOrEFQKUrd/XJk+SWrE2QBZYIJq7kKuYivM+NXcuijIaWTFhVHoM\r
+V+pCae5fir82VgE0HWlyb0fM/Lq22y3NE9c33cLzdArv8Y+YZLi4SCnKVE++4kK3\r
+2Mvp7ZCvHGJ1Ygbe3irteknpKX1O4MlJlAr6r+zyjLZTSdT8BTxw/+FEY9DbfI4W\r
+++9wcSTgkfv2mIW4qHo15NA0FkhAzPyreKPe7gX66K/gf1X/B41tTRYS4JTCNbaT\r
+i/CO+d2CH+8oCzeWt1Y+XIAWWuotQaVym+zyeB3nAzWk54RUUok7dWnL06h7dx0x\r
+st2KRtkDVCwL8dAPUDD0G+5DWyXIrQ8HfaBrfFrKHiWgRQkI2TR60DWtw3/2D1NM\r
+CSP1X05QsimIGn+RqsY750wgJ7I26qFXFwOmuqTTveFLY2tn9DrxgY4xm6F4Wsqa\r
+ZWjGa6no6YdAiA6SmP3Q\r
+=ICqV\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r