1 Return-Path: <wking@tremily.us>
\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 A6276431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 2 Feb 2014 12:54:39 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id Qnf8rC7eOq0n for <notmuch@notmuchmail.org>;
\r
17 Sun, 2 Feb 2014 12:54:31 -0800 (PST)
\r
18 X-Greylist: delayed 489 seconds by postgrey-1.32 at olra;
\r
19 Sun, 02 Feb 2014 12:54:31 PST
\r
20 Received: from qmta02.westchester.pa.mail.comcast.net
\r
21 (qmta02.westchester.pa.mail.comcast.net [76.96.62.24])
\r
22 by olra.theworths.org (Postfix) with ESMTP id 54819431FBC
\r
23 for <notmuch@notmuchmail.org>; Sun, 2 Feb 2014 12:54:31 -0800 (PST)
\r
24 Received: from omta06.westchester.pa.mail.comcast.net ([76.96.62.51])
\r
25 by qmta02.westchester.pa.mail.comcast.net with comcast
\r
26 id MXyj1n00516LCl051YmLTS; Sun, 02 Feb 2014 20:46:20 +0000
\r
27 Received: from odin.tremily.us ([24.18.63.50])
\r
28 by omta06.westchester.pa.mail.comcast.net with comcast
\r
29 id MYmK1n00E152l3L3SYmKoc; Sun, 02 Feb 2014 20:46:20 +0000
\r
30 Received: by odin.tremily.us (Postfix, from userid 1000)
\r
31 id 8EB50FB067C; Sun, 2 Feb 2014 12:46:17 -0800 (PST)
\r
32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;
\r
33 t=1391373977; bh=XcX8eC78IwtVg8Uji22aGMQAHvvr5LgCO8tU9GKnE20=;
\r
34 h=Date:From:To:Subject;
\r
35 b=ery8RxIRh+9FBbfllTt5CqvJMIo+ADrcT7dZZSQ7ET6LSB3wwF8b2ngL5CHjb8wm6
\r
36 tfupHdoBsjZp79Noq6arMwRB7dV8CCVwJbWCDI9ac3xinnz1vN0cVBjri5G+a9xEYQ
\r
37 uy9nF+F8O+S3H9HQf956TU1pcbBJci2SKQg+F0Ok=
\r
38 Date: Sun, 2 Feb 2014 12:46:17 -0800
\r
39 From: "W. Trevor King" <wking@tremily.us>
\r
40 To: notmuch@notmuchmail.org
\r
41 Subject: [RFC] Content-Description when naming MIME parts in Emacs mode
\r
42 Message-ID: <20140202204616.GD14197@odin.tremily.us>
\r
44 Content-Type: multipart/signed; micalg=pgp-sha1;
\r
45 protocol="application/pgp-signature"; boundary="cHOhevsz5PKyTXvv"
\r
46 Content-Disposition: inline
\r
47 OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;
\r
48 url=http://tremily.us/pubkey.txt
\r
49 User-Agent: Mutt/1.5.22 (2013-10-16)
\r
50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
51 s=q20121106; t=1391373980;
\r
52 bh=kVNMZCpAdEgUE+AJlaP8p0JpEXDQHZN3PvccdLc4bZ0=;
\r
53 h=Received:Received:Received:Date:From:To:Subject:Message-ID:
\r
54 MIME-Version:Content-Type;
\r
55 b=HpfG4Ip/7T77DeaFBu04M6DpRrdfCWnZouobboccTHVIx1qYN/Jl+jKooRXC8ptuS
\r
56 /WF3D62ZU1hWkjySxTbIF/dn2tb9JxegyuH32NVzvx0HJnTFAAkPApRMs2ZM/4wcat
\r
57 kTXUN8R2LQ9Utzl6Ix7Qr83s3cmmbPo2PsuPzKqx7mTAGLjaHOcvqlHEatq7wNMk1S
\r
58 NTxM1gOvIWH3IPxo/OT/oYrzJbJPJUiXWJrsdAxVxCrtVc+S83If0/hlICGLo/A5aT
\r
59 PMTMCXVwxzT2kfY+PKyyTh4/9QRZ6JyNySw9I7FQCv0MDXMHPL30CmhsoWtN4Tof1I
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\r
64 List-Id: "Use and development of the notmuch mail system."
\r
65 <notmuch.notmuchmail.org>
\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
69 List-Post: <mailto:notmuch@notmuchmail.org>
\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
72 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
73 X-List-Received-Date: Sun, 02 Feb 2014 20:54:39 -0000
\r
77 Content-Type: text/plain; charset=utf-8
\r
78 Content-Disposition: inline
\r
79 Content-Transfer-Encoding: quoted-printable
\r
81 On the rss2email list, Victor Orlikowski pointed out [1] that a number
\r
82 of MUAs don't use the Subject header of attached message/rfc822 parts
\r
83 to label multipart/digest subparts [2]. Instead, notmuch and several
\r
84 other MUAs use the filename parameter [3] as a content hint [4].
\r
85 Using the filename parameter seems more sane than diving into the
\r
86 message/rfc822 part header, but that's still not what the filename
\r
87 parameter was designed for. It makes more sense to me to use the
\r
88 message/rfc822 part's Content-Description header [5,6], falling back
\r
89 on the filename parameter if Content-Description isn't set.
\r
91 It's pretty easy to patch notmuch-show-insert-bodypart to do this:
\r
93 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
\r
94 index 1ac80ca..485c7d1 100644
\r
95 --- a/emacs/notmuch-show.el
\r
96 +++ b/emacs/notmuch-show.el
\r
97 @@ -874,13 +874,16 @@ useful for quoting in replies)."
\r
99 (nth (plist-get part :id))
\r
101 + (name (if (plist-get part :content-description)
\r
102 + (plist-get part :content-description)
\r
103 + (plist-get part :filename)))
\r
104 ;; Hide the part initially if HIDE is t.
\r
105 (show-part (not (equal hide t)))
\r
106 ;; We omit the part button for the first (or only) part if
\r
107 ;; this is text/plain, or HIDE is 'no-buttons.
\r
108 (button (unless (or (equal hide 'no-buttons)
\r
109 (and (string=3D mime-type "text/plain") (<=3D=
\r
111 - (notmuch-show-insert-part-header nth mime-type content-=
\r
112 type (plist-get part :filename))))
\r
113 + (notmuch-show-insert-part-header nth mime-type content-=
\r
115 (content-beg (point)))
\r
117 ;; Store the computed mime-type for later use (e.g. by attachment hand=
\r
120 But that doesn't work, because :content-description doesn't exist in
\r
121 the part plist. I've looked through the source for a bit and can't
\r
122 figure out where that part plist is coming from. Is it loaded from
\r
123 notmuch output in notmuch-show-build-buffer? I assume that
\r
124 information comes from the index, in which case I'd need to tweak
\r
125 _index_mime_part in lib/index.cc to add the description. Indexing
\r
126 descriptions seems like a generally useful thing, even outside of my
\r
127 digest usecase (e.g. search image/jpeg attachements with =E2=80=9Cgenome=E2=
\r
129 their description [6]). However, adding a field to the schema is more
\r
130 invasive than changing the Emacs mode's attachment formatting; I
\r
131 thought I should check in here for feedback and advice before wading
\r
132 in with my =E2=80=94a=CC=B6x=CC=B6e=CC=B6=E2=80=94 scalpel ;).
\r
137 [1]: http://article.gmane.org/gmane.mail.rss2email/211
\r
138 [2]: Digests: http://tools.ietf.org/html/rfc2046#section-5.1.5
\r
139 [3]: Filename: http://tools.ietf.org/search/rfc2183#section-2.3
\r
140 [4]: Filename hint to notmuch-show-insert-part-header:
\r
141 http://git.notmuchmail.org/git/notmuch/blob/HEAD:/emacs/notmuch-show.e=
\r
143 [5]: Content-Desciption:
\r
144 http://tools.ietf.org/html/rfc2045#section-8
\r
145 [6]: Content-Description examples:
\r
146 http://tools.ietf.org/html/rfc2183#section-3
\r
149 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
\r
150 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
\r
153 Content-Type: application/pgp-signature; name="signature.asc"
\r
154 Content-Description: OpenPGP digital signature
\r
156 -----BEGIN PGP SIGNATURE-----
\r
157 Version: GnuPG v2.0.22 (GNU/Linux)
\r
159 iQIcBAEBAgAGBQJS7q6UAAoJEKKfehoaNkbtDloQAKqHKmui8Ron0MtQSKgnDHMj
\r
160 NT4jftGDWGLtunq+1zr5+IIglzEQ88Z+Q2+2NpHq1IQYKfI1NPnScVGoCjJucv1O
\r
161 pB9TKxsWOPptVE8s8A2W50Hb01pVzXNt9oN5VsPzZ8GkjaLu3UL3E/UrY1mqGP92
\r
162 ChBWU/lMPED4we9KQAifFV4zM88c3gzHVQKCXHRRRDZ0FpjDWB7ZK5sqtfNXgmU5
\r
163 pnwBgxpE2OK4xTq3ZuttmsIPcxO7l0p6WD93kCxQRNcC/JjRyms5an+n4hv72Wop
\r
164 ulvCwGqm1kO6x7NMAqSCi4pDb8If8b9K39D6AnKXo9OKORnVrIdWS/y9pD8mI0nP
\r
165 3VRmcWVCezSutP5kod4022kd1GxmziHNV4a2MJ0rL8AICAd5ufiISXC7bVWqLppf
\r
166 RZm35nv51wNHGoouJgnVPaQFNlfNaZE6mlt+3jYc4dyLrU3UDyZ0bJ5w3qrJDLfD
\r
167 uud8mkHFx7TvssmgY+Qf8+OR14GI2MSvfabINhIXjIhrhFjxrQEKEtRpr1+WOwBQ
\r
168 l5gtPJEpigqmtARbzEcXcv964VGF9PsfJRNps48ZqEoyGLbTOTVu28qySouoaULR
\r
169 gmZVvSI18DB3cKIAgV/njolobn9MMwv5YR9VkKoLbaJYeNX0j4Er1Lp5ubXTfqvz
\r
170 tKNTxGYhjyYhphGxNPdo
\r
172 -----END PGP SIGNATURE-----
\r
174 --cHOhevsz5PKyTXvv--
\r