Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f6 / b83330272846de8081e983ff164a89204915e5
1 Return-Path: <micah@riseup.net>\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 10C53431FBC\r
6         for <notmuch@notmuchmail.org>; Mon, 15 Feb 2010 09:55:04 -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.832\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.832 tagged_above=-999 required=5 tests=[AWL=0.166,\r
12         BAYES_50=0.001, RCVD_IN_DNSWL_LOW=-1, UNPARSEABLE_RELAY=0.001]  autolearn=ham\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 FWuitxcmlJ74 for <notmuch@notmuchmail.org>;\r
16         Mon, 15 Feb 2010 09:55:03 -0800 (PST)\r
17 Received: from mx1.riseup.net (mx1.riseup.net [204.13.164.18])\r
18         by olra.theworths.org (Postfix) with ESMTP id 3007C431FAE\r
19         for <notmuch@notmuchmail.org>; Mon, 15 Feb 2010 09:55:03 -0800 (PST)\r
20 Received: from [127.0.0.1] (localhost [127.0.0.1])\r
21         (Authenticated sender: micah@mx1.riseup.net)\r
22         with ESMTPSA id 8DDE425FA1E\r
23 Received: by lillypad (Postfix, from userid 1000)\r
24         id 4D2F24B0008; Mon, 15 Feb 2010 12:55:30 -0500 (EST)\r
25 From: micah <micah@riseup.net>\r
26 To: notmuch@notmuchmail.org\r
27 Date: Mon, 15 Feb 2010 12:55:29 -0500\r
28 Message-ID: <87zl3az8mm.fsf@lillypad.riseup.net>\r
29 MIME-Version: 1.0\r
30 Content-Type: multipart/signed; boundary="=-=-=";\r
31         micalg=pgp-sha512; protocol="application/pgp-signature"\r
32 X-Virus-Scanned: clamav-milter 0.95.3 at mx1\r
33 X-Virus-Status: Clean\r
34 Subject: [notmuch] Handling encrypted email\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39         <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Mon, 15 Feb 2010 17:55:04 -0000\r
48 \r
49 --=-=-=\r
50 Content-Transfer-Encoding: quoted-printable\r
51 \r
52 \r
53 It took me a while before I figured out how to read OpenPGP encrypted\r
54 email with the emacs interface to notmuch. I thought it would be useful\r
55 to the list the steps that I go through to read encrypted email, both\r
56 for people who are wondering the same thing, but also hopefully to spur\r
57 a discussion about how to improve the process, as it is clearly\r
58 problematic and annoying.\r
59 \r
60 At the moment, if you simply hit 'v' on a message that contains a\r
61 PGP/MIME encoded email part, the notmuch attachment viewer seems to do\r
62 the right thing and ask you about decrypting the message, but then it\r
63 puts the result in some mysterious place, or closes that window\r
64 immediately.=20\r
65 \r
66 However, there is a set of steps that let you work around this. Its a\r
67 pain to do, and I'm not skilled enough in elisp to know how to pull all\r
68 of that together into something that fixes the problem.\r
69 \r
70 These are the steps I can go through to read encrypted email:\r
71 \r
72 1. Determine if there is a PGP/MIME part, or if the message is in-line\r
73  encrypted.\r
74 \r
75  PGP/MIME messages typically have no interesting body, although they\r
76  could, but they do have:\r
77 \r
78  Attachment: (null) (application/pgp-encrypted)\r
79  Content-type: application/octet-stream\r
80  Non-text part: application/octet-stream\r
81 \r
82  If you look closer at the mime parts, you see that the above is\r
83  represented as follows:\r
84 \r
85   mimepart_4b47a295c184f_2474..fdbe903a82212\r
86   Content-Type: application/pgp-encrypted\r
87   Content-Disposition: attachment\r
88 \r
89   Version: 1\r
90 \r
91   mimepart_4b47a295c184f_2474..fdbe903a82212\r
92   Content-Type: application/octet-stream; charset=3D3DUTF-8\r
93   Content-Disposition: inline; filename=3D3Dmessage.asc\r
94 \r
95   in-line PGP messages have the encrypted chunk in the body of the message\r
96   itself, which can be seen when you view the message. It always starts\r
97   with this header:\r
98 \r
99   ----BEGIN PGP MESSAGE-----\r
100   Version: GnuPG v1.4.6 (GNU/Linux)\r
101 \r
102   and ends with this one:\r
103 \r
104   ----END PGP MESSAGE-----\r
105 \r
106   (Obviously the Version line is going to be different, depending on the\r
107   implementation, but I believe it is always there with an ascii armored\r
108   OpenPGP blob)\r
109 \r
110   2. If it is a PGP/MIME message, then you have to hit 'V' to view the\r
111   raw message, otherwise if it is in-line PGP you would skip this step\r
112   and go to 3.\r
113 \r
114   3. using emacs selection, select the region that is bounded by the\r
115   header and footer of the PGP ASCII armored blob, as described above.\r
116 \r
117   4. M-x epa-decrypt-region (i think this only will work in emacs23)\r
118 \r
119   5. You are asked, "Replace the original text? (y/n)", I think it is\r
120   not worth doing so, but see what you think.\r
121 \r
122   6. Now the window is split in three: the original raw message from\r
123   notmuch; the result of the pgp verification of the data ("Good\r
124   signature from...") appears in a small window (this is good\r
125   information!); and then the decrypted text.\r
126 \r
127   7. after reading the message, you have to kill a bunch of buffers, and\r
128   if you want to reply to the message, you have to do some annoying\r
129   return to the original message, after copying the text you wish to\r
130   quote....=20\r
131 \r
132   So what is the desired behavior? I think that the emacs mode should\r
133   detect pgp messages, in-line or PGP/MIME and when they are viewed\r
134   (notmuch show) they should be decrypted and verified. The decrypted\r
135   text should just replace the encrypted text, and the signature\r
136   verification should also be represented in a useful way (it is very\r
137   important to know if a signed/encrypted message has a bad signature,\r
138   or doesn't verify!), and it should clean-up nicely so you don't have\r
139   to kill a bunch of windows.\r
140 \r
141   mutt deals with inline pgp by just looking in each message, as it is\r
142   displayed (with a display hook) for the following in the body:\r
143 \r
144   "^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"'\r
145 \r
146   for pgp/MIME, mutt enables you to set various pgp customizable commands\r
147   to make things work, however these pieces may be taken care of with\r
148   epa-mode.\r
149 \r
150 Hopefully someone can take this and run with it, improving the emacs UI\r
151 so that it is able to handle this automatically!\r
152 \r
153 micah\r
154 \r
155 --=-=-=\r
156 Content-Type: application/pgp-signature\r
157 \r
158 -----BEGIN PGP SIGNATURE-----\r
159 Version: GnuPG v1.4.10 (GNU/Linux)\r
160 \r
161 iQIcBAEBCgAGBQJLeYqRAAoJEIy/mjIoYaeQEWAP/ih3yWyEUmMtGeoU4IEBKAZ1\r
162 TdyDNlAzBy94HZMXylIASI7xz0LQ1CHVl38jyP4iDgYcO8yFfrL/MWOSwr3hYIzK\r
163 mVl3cVm7TFwXcDM6gHPesHxgZh2VTlB6NV11Y/ir67Ono+OslSPE45R+0swYabRs\r
164 cz2tThVxgzS21CVH8Opy1Q2bGVKCYvEZ8bl3EwA1JQhP7UfZC+qOkSWCRTQ/xPq0\r
165 5EtQsZSARi9XMeWK/xnRNFqMYVwMTDCXsupuxuX7JY4KBbBDFEONaOykvG1VuIDv\r
166 Hk90ZPHwvBHUO6lCZvKB4UU4gjiZRm5Aq0ma5uoMFAotgMp7eRsrTp/ZVOWLOxIO\r
167 OGctby9xYj+lyG0TlazBV1TzZ9iR21w2LxB3FEW1EJznVVkj6iabw1MDKgBeJNE1\r
168 t4NjYuujdoN+nQe3+LFYeJGgPqbW4GJKM4viO7ULzLID68Ep9H7TerW3c2fjoI3E\r
169 bpLQv/1qWyvz55H/XUcgmPy1i91xBBEa8R2DYyLJubsSEW5Sk/5GHi6yZWlNEbeN\r
170 YMF2b/ve9LKa6rZ9F6KH/4ylJaqUHGdEg2eEO+7KXKCsIpny40mryAgtyVXQlFZT\r
171 B4hpnnFLEKY/kbu7gWT4jfVMM+jH5cEvCwfsumJpeT1JwGD5FxzU9FOqlMzpxM0F\r
172 oIVC80BPvN5o/NruUptj\r
173 =bkgG\r
174 -----END PGP SIGNATURE-----\r
175 --=-=-=--\r