Re: [PATCH 3/3] compact: Provide user with more error feedback
[notmuch-archives.git] / b7 / 44b04cdc14dcf2dc2d22808bb4dd6b89fede43
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 00112431FB6\r
6         for <notmuch@notmuchmail.org>; Wed, 27 Feb 2013 14:47:02 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id JiUv9yo+dElF for <notmuch@notmuchmail.org>;\r
16         Wed, 27 Feb 2013 14:47:01 -0800 (PST)\r
17 Received: from mail-la0-f54.google.com (mail-la0-f54.google.com\r
18         [209.85.215.54]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 322FE431FAF\r
21         for <notmuch@notmuchmail.org>; Wed, 27 Feb 2013 14:47:01 -0800 (PST)\r
22 Received: by mail-la0-f54.google.com with SMTP id gw10so1120191lab.41\r
23         for <notmuch@notmuchmail.org>; Wed, 27 Feb 2013 14:46:58 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=google.com; s=20120113;\r
26         h=x-received:from:to:subject:in-reply-to:references:user-agent:date\r
27         :message-id:mime-version:content-type:x-gm-message-state;\r
28         bh=TtxRpLLI0G9/5YcgxVx8R/HW2eJdwnhhrEjL+pw1W0A=;\r
29         b=nzaJvkujXGEHYMk+U9Ync4EQsu4TaEoAulOkr+QOYlT1C/jMl2uVVfTC1UOFVhXAj4\r
30         fspAwpbSFFtzeZPzeWya7p7pxOe6bcVrc8LmwSKqwNysQVAPF8xEDFXZXF5LmOTtHaDU\r
31         keKfKVcaNTQjRknEdhsHK1zovlUz62oNzxieNZTl23kAj8m5huJwXI86v0sZo3IOuhp0\r
32         mvhFP3L8wqqPB2TPQWBAYfKmIPLcc810khVbfhBvKhqrAqZ3zYglRGDXZF5ugD4R6Xdt\r
33         DyMb4N1tTlXLlPG1l2y3OhrdycDMDJH4zToLxBFDm3eSfy/G503FE9/TiGNfHqIXPba0\r
34         Q69w==\r
35 X-Received: by 10.112.99.65 with SMTP id eo1mr2832659lbb.78.1362005218272;\r
36         Wed, 27 Feb 2013 14:46:58 -0800 (PST)\r
37 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
38         [80.223.81.27])\r
39         by mx.google.com with ESMTPS id m1sm2257361lbh.5.2013.02.27.14.46.55\r
40         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
41         Wed, 27 Feb 2013 14:46:56 -0800 (PST)\r
42 From: Jani Nikula <jani@nikula.org>\r
43 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
44         David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
45 Subject: Re: [PATCH] cli: crypto: tell gmime to use gpg-agent\r
46 In-Reply-To: <87ehg1pt2u.fsf@servo.finestructure.net>\r
47 References: <1361950838-22919-1-git-send-email-jani@nikula.org>\r
48         <87hakxpwcu.fsf@servo.finestructure.net>\r
49         <87r4k1znor.fsf@maritornes.cs.unb.ca>\r
50         <87ehg1pt2u.fsf@servo.finestructure.net>\r
51 User-Agent: Notmuch/0.15.2+33~g98253a3 (http://notmuchmail.org) Emacs/24.2.1\r
52         (x86_64-pc-linux-gnu)\r
53 Date: Thu, 28 Feb 2013 00:46:57 +0200\r
54 Message-ID: <87txoxwf1a.fsf@nikula.org>\r
55 MIME-Version: 1.0\r
56 Content-Type: text/plain\r
57 X-Gm-Message-State:\r
58  ALoCoQl0zU3bUvTwwtY86o+YFcwdcMpqIB3Pp3XWqyayvrAjDYaD6B1AXitf8jLZldAeUfAHznUF\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Wed, 27 Feb 2013 22:47:03 -0000\r
72 \r
73 On Wed, 27 Feb 2013, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
74 > On Wed, Feb 27 2013, David Bremner <david@tethera.net> wrote:\r
75 >> But right now we force people to enable the agent globally via use-agent\r
76 >> if they want to decrypt mail in notmuch-cli/emacs. The proposed change\r
77 >> allows them to use the agent only for notmuch.\r
78 >\r
79 > Doesn't the proposed change actually *force* the user to use gpg-agent?\r
80 > How can the user opt out?\r
81 \r
82 If the user wants to have decryption in notmuch, the user *must* use\r
83 gpg-agent, regardless of this change or the "use-agent" configuration\r
84 option. There is no opt out if one wants to have decryption in notmuch,\r
85 regardless of this change.\r
86 \r
87 The proposed change gives the user the possibility to opt out of\r
88 *globally* using gpg-agent for everything, and still have decryption in\r
89 notmuch.\r
90 \r
91 The proposed change merely passes the --use-agent option to gpg. It does\r
92 not *force* anything. It tells gpg to *try* to connect to the gpg-agent\r
93 before it asks for a passphrase. (Except that notmuch will never ask for\r
94 a passphrase. It will fail if it can't connect to the gpg-agent. Without\r
95 --use-agent or "use-agent" option it will unconditionally fail.)\r
96 \r
97 When I use gpg on the command line, I want it to prompt for the\r
98 passphrase on the command line instead of popping up a gpg-agent\r
99 dialog. I don't think that is unreasonable. To achieve that I have\r
100 disabled the "use-agent" configuration option. Without the proposed\r
101 change, if I still wanted to have this *and* decryption in notmuch, I\r
102 would have to pass --no-use-agent on the gpg command line. I think that\r
103 *is* unreasonable.\r
104 \r
105 >> I don't think we should directly care about the presence of an X session\r
106 >> or not; the agent protocol doesn't depend on how the agent was started\r
107 >> afaik. \r
108 >\r
109 > Maybe, but I would like some example of what happens if you force usage\r
110 > of an agent and the agent is not present or there is no X session.\r
111 \r
112 There is no force anything. It tries to connect to the agent, and if one\r
113 is not present, decryption fails like it would have failed without this\r
114 change.\r
115 \r
116 Finally, look up the references I provided. The whole function in gmime\r
117 was provided *exactly* for situations like we have: the caller will fail\r
118 without the agent, so have a tiny bit of sanity and see if it's there\r
119 before failing.\r
120 \r
121 \r
122 BR,\r
123 Jani.\r