Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / b0 / 88642eba655b88267384642467baa11cea6855
1 Return-Path: <dkg@fifthhorseman.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 6AB7D431FD0\r
6         for <notmuch@notmuchmail.org>; Thu, 25 Aug 2011 07:21:30 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 kk1CxZdTsE-O for <notmuch@notmuchmail.org>;\r
16         Thu, 25 Aug 2011 07:21:29 -0700 (PDT)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18         by olra.theworths.org (Postfix) with ESMTP id 9AA6C431FB6\r
19         for <notmuch@notmuchmail.org>; Thu, 25 Aug 2011 07:21:29 -0700 (PDT)\r
20 Received: from [192.168.13.75] (lair.fifthhorseman.net [216.254.116.241])\r
21         by che.mayfirst.org (Postfix) with ESMTPSA id 6D8F9F970;\r
22         Thu, 25 Aug 2011 10:21:26 -0400 (EDT)\r
23 Message-ID: <4E565A61.7040600@fifthhorseman.net>\r
24 Date: Thu, 25 Aug 2011 10:21:21 -0400\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
26 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:5.0) Gecko/20110807 Icedove/5.0\r
27 MIME-Version: 1.0\r
28 To: moabi2000 <moabi2000@gmail.com>, notmuch <notmuch@notmuchmail.org>\r
29 Subject: Re: How does notmuch detect the presence of attachments?\r
30 References:\r
31  <CAJ+wP3X5SxPPLyy=jbVMW5QZvuZSq5Vkt=6tVnL_Sd=W9Ys_SA@mail.gmail.com>\r
32 In-Reply-To:\r
33  <CAJ+wP3X5SxPPLyy=jbVMW5QZvuZSq5Vkt=6tVnL_Sd=W9Ys_SA@mail.gmail.com>\r
34 X-Enigmail-Version: 1.2.1\r
35 Content-Type: multipart/signed; micalg=pgp-sha512;\r
36         protocol="application/pgp-signature";\r
37         boundary="------------enig9DA2C5FC1FC3F0FE2D25E648"\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 Reply-To: notmuch <notmuch@notmuchmail.org>\r
42 List-Id: "Use and development of the notmuch mail system."\r
43         <notmuch.notmuchmail.org>\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
45         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
47 List-Post: <mailto:notmuch@notmuchmail.org>\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
51 X-List-Received-Date: Thu, 25 Aug 2011 14:21:30 -0000\r
52 \r
53 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)\r
54 --------------enig9DA2C5FC1FC3F0FE2D25E648\r
55 Content-Type: text/plain; charset=UTF-8\r
56 Content-Transfer-Encoding: quoted-printable\r
57 \r
58 On 08/03/2011 06:01 AM, moabi2000 wrote:\r
59 > 1) How does  notmuch detect the presence of attachments? I have some\r
60 > messages that have attachments (which I can see and open when reading\r
61 > the message), but for which the 'attachment' flag is not set (and\r
62 > therefore don't show up in a search like "from:myfriend AND\r
63 > attachment:pdf"). How can I try to work out what is going on?\r
64 \r
65 According to lib/index.cc (around line 366 in the current version), the\r
66 tag "attachment" is added to an e-mail only if one of the MIME parts of\r
67 the message has an explicit "Content-Disposition: attachment" MIME\r
68 subheader.\r
69 \r
70 So some mail clients may be attaching files with "Content-Disposition:\r
71 inline" (i do this sometimes when attaching text/* files) or without a\r
72 Content-Disposition: header on the MIME part at all.\r
73 \r
74 Perhaps notmuch could keep a (configurable?) list of Content-Types that\r
75 should be tagged with "attachment" no matter what Content-Disposition is\r
76 used?  I could imagine an initial list like:\r
77 \r
78  application/pdf\r
79  application/vnd.oasis.opendocument.text\r
80  application/vnd.oasis.opendocument.spreadsheet\r
81 \r
82 Or maybe just any mime part with "application" as the major Content\r
83 type?  That would be a relatively easy (though non-general) heuristic to\r
84 implement.  Want to take a crack at it?\r
85 \r
86 > 2) Is there an option for notmuch to also index the text of\r
87 > attachments (like recoll does, which also uses xapian)? People tend to\r
88 > save attachments with really useless filenames (report2.pdf...), what\r
89 > I'd like to be able to do is a search like "from:mycolleague AND\r
90 > attachment:pdf AND attachmentcontains:ourproject"\r
91 \r
92 This is another great suggestion for improvement, i think.  There are\r
93 even comments in the code (around the same part referenced above) that sa=\r
94 ys:\r
95 \r
96         /* XXX: Would be nice to call out to something here to parse\r
97          * the attachment into text and then index that. */\r
98 \r
99 A generic shim here, with a configurable index that associates\r
100 Content-Types with safe convert-to-text functions would be quite nice.\r
101 \r
102 This would probably be a new section in ~/.notmuch-config,\r
103 [textconverters], where the keys would be a specific Content-Type and\r
104 the values would be system calls that take the file on stdin and produce\r
105 plain text to index on stdout, like so:\r
106 \r
107  [textconverters]\r
108  application/pdf=3Dpdf2txt /dev/stdin\r
109 \r
110 Starting with an initially empty set of textconverters seems reasonable\r
111 and safe to me, and people could set up their own if they're interested.\r
112 \r
113 You'd need to re-index your message store after modifying the config,\r
114 though, if you wanted to have pre-existing messages get indexed this\r
115 way.  Is there a way to tell notmuch to re-index a particular message?\r
116 \r
117 The above proposal isn't implemented at all, i'm just throwing it out\r
118 for consideration.\r
119 \r
120         --dkg\r
121 \r
122 \r
123 --------------enig9DA2C5FC1FC3F0FE2D25E648\r
124 Content-Type: application/pgp-signature; name="signature.asc"\r
125 Content-Description: OpenPGP digital signature\r
126 Content-Disposition: attachment; filename="signature.asc"\r
127 \r
128 -----BEGIN PGP SIGNATURE-----\r
129 Version: GnuPG v1.4.11 (GNU/Linux)\r
130 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\r
131 \r
132 iQJ8BAEBCgBmBQJOVlphXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w\r
133 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQwRUU1QkU5NzkyODJEODBCOUY3NTQwRjFD\r
134 Q0QyRUQ5NEQyMTczOUU5AAoJEMzS7ZTSFznp1ZwP/iTBbAHrtb+vkJenkI8xXQFJ\r
135 oeWWaVLOIMWK01q6Aq6CTrz3yGpDgJvZiVGT6+vqUGpKb/jGmxK2qR6ZsICVQmpg\r
136 0U1SFnR3uV+XKoObGABuEbVKtaeuQFeVU8tkMGvo0b5lY6eBGzXbxsX4A2W3jH2f\r
137 HtartdrhNE5hT9Bbn6FXSkclZ5WDsgoXbvzberEkL6CpmOq6EAt6B6tKUMUvPsW4\r
138 SgQRM/tDTZ5leAuIy4kftfMPq1f6pAMbA3l8PNHAsx3fOYj8MHeEzDS4sWd2vii7\r
139 QGzkUvdw8gH/g/XnptUH/qVKVb6xVX+mLv2KThw7uWNBL/FMyBD1jAoGMZGvauGo\r
140 2Qe/r4xbVImAzEVe+6mVR1tOPijUhJVSIAbVV/7RLsSb1pdTsVG6lt+Dpo6y8UwS\r
141 aKQq2ApDjvoAMXUr4WljukKz9tl212bkL3QAiJGhbX3qRj+/ov/vULZCOWWqgkzb\r
142 J7p+Jgi54EmVye/RlRVdjpyHUGu5pndC4ijoEmeWSa93M4NmRndfhuTwMDWq11Pd\r
143 mD8iOmI0FZsktccG8STbqmjSzEp1lRQ41/o08t+k4QUBKDwkuTlUe5jAlITB5/T6\r
144 4Ev2P4acGKnpZlHaV+BeJY06QH+qrUP6npeYZJgqPliawAf6xgrXKZpZSlSomXtF\r
145 YahwnYfGcay8e28tRP7p\r
146 =jrRV\r
147 -----END PGP SIGNATURE-----\r
148 \r
149 --------------enig9DA2C5FC1FC3F0FE2D25E648--\r