Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d7 / a482764c26d7432e9002590d40ad965c42c19a
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 764C9431FB6\r
6         for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 08:20:06 -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\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 cyu-4A2-tyRv for <notmuch@notmuchmail.org>;\r
16         Fri,  9 Mar 2012 08:20:05 -0800 (PST)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18         by olra.theworths.org (Postfix) with ESMTP id CBEE2431FAE\r
19         for <notmuch@notmuchmail.org>; Fri,  9 Mar 2012 08:20:05 -0800 (PST)\r
20 Received: from [192.168.23.207] (dsl254-070-154.nyc1.dsl.speakeasy.net\r
21         [216.254.70.154])\r
22         by che.mayfirst.org (Postfix) with ESMTPSA id 102AFF970;\r
23         Fri,  9 Mar 2012 11:20:01 -0500 (EST)\r
24 Message-ID: <4F5A2DB1.7040301@fifthhorseman.net>\r
25 Date: Fri, 09 Mar 2012 11:20:01 -0500\r
26 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
27 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20120125 Icedove/9.0.1\r
28 MIME-Version: 1.0\r
29 To: David Bremner <david@tethera.net>, notmuch <notmuch@notmuchmail.org>\r
30 Subject: Re: [PATCH] mime_node_open: skip envelope from lines at the start\r
31         of messages\r
32 References: <m2aa3qjbfo.fsf@guru.guru-group.fi>\r
33         <1331301387-23630-1-git-send-email-david@tethera.net>\r
34 In-Reply-To: <1331301387-23630-1-git-send-email-david@tethera.net>\r
35 Content-Type: text/plain; charset=UTF-8; format=flowed\r
36 Content-Transfer-Encoding: 7bit\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 09 Mar 2012 16:20:06 -0000\r
50 \r
51 On 03/09/2012 08:56 AM, David Bremner wrote:\r
52 > Some MDAs such as procmail (in MH mode), and exim (doing local\r
53 > delivery in some configurations of the appendfile transport) add a\r
54 > line to the front of a message with "From " followed by envelope\r
55 > sender.  Since this is not a proper RFC822 header field, gmime (at\r
56 > least since version 2.6) refuses to parse it, unless in mbox mode.\r
57 >\r
58 > This change reads the line of the file, and if they start with\r
59 > "From ", pass the stream to gmime starting from the second line.\r
60 >\r
61 > This makes mime_node_open more consistent with (but still stricter\r
62 > than) the permissive behaviour of notmuch_file_get_header\r
63 > (message-file.c), which allows a certain number of "broken_headers".\r
64 >\r
65 > We avoid putting gmime into mbox mode in case of side effects; this\r
66 > leaves the situation of mboxes accidentally indexed by notmuch the\r
67 > same as before, namely "undefined behaviour".  Ideally they should at\r
68 > least be warned by notmuch-new.  Although strict rfc822 adherence\r
69 > would be one way to detect mboxes, it doesn't seem to fit with the\r
70 > spirit or code of message-file.c.\r
71 \r
72 The above justification (and the version of the associated patch without \r
73 the memory leak and using strncmp instead of strcmp) seems good to me.\r
74 \r
75 While I'd prefer to have nothing but spic-and-span, perfectly clean \r
76 RFC2822 messages, we have (perhaps accidentally) traditionally supported \r
77 message files with leading "From " lines, so they will be \r
78 already-indexed by previous versions of notmuch.\r
79 \r
80 This patch defines the non-MIME variance we're willing to accept quite \r
81 narrowly (just a single leading line that starts with "From ", no \r
82 escaping of the rest of the text), avoids breaking compatibility with \r
83 existing indexes, and satisfies indexing some plausible MTA delivery \r
84 configurations.\r
85 \r
86 The only way it would be better is if it were to auto-detect that a file \r
87 is actually a multi-message mbox, and alert the user to the fact that \r
88 all but the first message in the mbox is unindexed.  But we don't \r
89 currently do that anyway, so it's not a regression (and that additional \r
90 cleanup should probably be a separate patch anyway).\r
91 \r
92 so: LGTM.\r
93 \r
94         --dkg\r