RE: [Spam-verdenking][english 100%] RE: Reply all - issue
[notmuch-archives.git] / fe / 4c5441f39a9d0432298c6df54dc3d3e79b5782
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 D66A0431FAF\r
6         for <notmuch@notmuchmail.org>; Thu,  3 Jan 2013 09:19:12 -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 GLIaA6Xn33Ie for <notmuch@notmuchmail.org>;\r
16         Thu,  3 Jan 2013 09:19:12 -0800 (PST)\r
17 Received: from mail-bk0-f51.google.com (mail-bk0-f51.google.com\r
18         [209.85.214.51]) (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 33BA6431FAE\r
21         for <notmuch@notmuchmail.org>; Thu,  3 Jan 2013 09:19:12 -0800 (PST)\r
22 Received: by mail-bk0-f51.google.com with SMTP id ik5so6861629bkc.38\r
23         for <notmuch@notmuchmail.org>; Thu, 03 Jan 2013 09:19:11 -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:cc:subject:in-reply-to:references:user-agent\r
27         :date:message-id:mime-version:content-type:x-gm-message-state;\r
28         bh=weg9zmvlX5oI7ii9MuCExFpek3nkOZ49dPt7RsXx6cM=;\r
29         b=OHlGToXKfiJJrf2nxkR+mh9yORAKv+N9NLCPz+SHIsz8FAU8agsIvQIn2nWThSc4q3\r
30         TquirsvzIG54BI1gXeZCSP4IAicW3MCm69rj96gJv2qrzr5dDJKNCTYcG4PAtFg888q0\r
31         jM4zZN99uHVtuigO6Mo5GtaO1L+Xv+Vb994cL1Ww/8ZP2l7r9R0SM0YlKR8SVo6Vt9uG\r
32         g5/1uEnoF/JDSEztPOlKfJf2cSSIGRQRDAEyZVKDK7bsEG0eohlR4G5ItAXRYpZLIg2a\r
33         rp4pEMG40nxi83sQjMxBDKfIffEvBSffGQ7VOZBH02AWAG7t1rOm5DHJ0k3mj1WYS2AJ\r
34         dSDQ==\r
35 X-Received: by 10.204.148.134 with SMTP id p6mr23785251bkv.75.1357233550728;\r
36         Thu, 03 Jan 2013 09:19:10 -0800 (PST)\r
37 Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
38         by mx.google.com with ESMTPS id u3sm34662405bkw.9.2013.01.03.09.19.08\r
39         (version=SSLv3 cipher=OTHER); Thu, 03 Jan 2013 09:19:09 -0800 (PST)\r
40 From: Jani Nikula <jani@nikula.org>\r
41 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
42 Subject: Re: [PATCH v4 3/5] dump: Disallow \n in message IDs\r
43 In-Reply-To: <1356936162-2589-4-git-send-email-amdragon@mit.edu>\r
44 References: <1356936162-2589-1-git-send-email-amdragon@mit.edu>\r
45         <1356936162-2589-4-git-send-email-amdragon@mit.edu>\r
46 User-Agent: Notmuch/0.14+235~gdaf492b (http://notmuchmail.org) Emacs/23.2.1\r
47         (x86_64-pc-linux-gnu)\r
48 Date: Thu, 03 Jan 2013 18:19:02 +0100\r
49 Message-ID: <87sj6igp6h.fsf@nikula.org>\r
50 MIME-Version: 1.0\r
51 Content-Type: text/plain; charset=us-ascii\r
52 X-Gm-Message-State:\r
53  ALoCoQk7dkZ4EVax45iSmdEH4CpjQoyF79IJK+j57UHP5ztnuKHF52mVUAjLBePfNwxZ+Z4o8c7c\r
54 Cc: tomi.ollila@iki.fi\r
55 X-BeenThere: notmuch@notmuchmail.org\r
56 X-Mailman-Version: 2.1.13\r
57 Precedence: list\r
58 List-Id: "Use and development of the notmuch mail system."\r
59         <notmuch.notmuchmail.org>\r
60 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
62 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
63 List-Post: <mailto:notmuch@notmuchmail.org>\r
64 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
65 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
67 X-List-Received-Date: Thu, 03 Jan 2013 17:19:13 -0000\r
68 \r
69 On Mon, 31 Dec 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
70 > When we switch to using regular Xapian queries in the dump format, \n\r
71 > will cause problems, so we disallow it.  Specially, while Xapian can\r
72 > quote and parse queries containing \n without difficultly, quoted\r
73 > queries containing \n still span multiple lines, which breaks the\r
74 > line-orientedness of the dump format.  Strictly speaking, we could\r
75 > still round-trip these, but it would significantly complicate restore\r
76 > as well as scripts that deal with tag dumps.  This complexity would\r
77 > come at absolutely no benefit: because of the RFC 2822 unfolding\r
78 > rules, no amount of standards negligence can produce a message with a\r
79 > message ID containing a line break (not even Outlook can do it!).\r
80 >\r
81 > Hence, we simply disallow it.\r
82 > ---\r
83 >  notmuch-dump.c       |    9 +++++++++\r
84 >  test/random-corpus.c |    4 +++-\r
85 >  2 files changed, 12 insertions(+), 1 deletion(-)\r
86 >\r
87 > diff --git a/notmuch-dump.c b/notmuch-dump.c\r
88 > index d2dad40..29d79da 100644\r
89 > --- a/notmuch-dump.c\r
90 > +++ b/notmuch-dump.c\r
91 > @@ -132,6 +132,15 @@ notmuch_dump_command (unused (void *ctx), int argc, char *argv[])\r
92 >       if (output_format == DUMP_FORMAT_SUP) {\r
93 >           fputs (")\n", output);\r
94 >       } else {\r
95 > +         if (strchr (message_id, '\n')) {\r
96 > +             /* This will produce a line break in the output, which\r
97 > +              * would be difficult to handle in tools.  However,\r
98 > +              * it's also impossible to produce an email containing\r
99 > +              * a line break in a message ID because of unfolding,\r
100 > +              * so we can safely disallow it. */\r
101 > +             fprintf (stderr, "Error: cannot dump message id containing line break: %s\n", message_id);\r
102 > +             return 1;\r
103 \r
104 How about just skipping the message in the dump, with a warning, instead\r
105 of bailing out? If the user is desperate to do a backup for whatever\r
106 reason, I don't think it's a good idea to require deleting the message\r
107 from the db before dump can succeed. The fs holding the db might be\r
108 remounted ro and all that.\r
109 \r
110 And perhaps the message id in the error message should be wrapped in\r
111 quotes, because it will span multiple lines due to having a\r
112 newline... ;)\r
113 \r
114 Otherwise, LGTM.\r
115 \r
116 Jani.\r
117 \r
118 > +         }\r
119 >           if (hex_encode (notmuch, message_id,\r
120 >                           &buffer, &buffer_size) != HEX_SUCCESS) {\r
121 >                   fprintf (stderr, "Error: failed to hex-encode msg-id %s\n",\r
122 > diff --git a/test/random-corpus.c b/test/random-corpus.c\r
123 > index f354d4b..8b7748e 100644\r
124 > --- a/test/random-corpus.c\r
125 > +++ b/test/random-corpus.c\r
126 > @@ -96,7 +96,9 @@ random_utf8_string (void *ctx, size_t char_count)\r
127 >           buf = talloc_realloc (ctx, buf, gchar, buf_size);\r
128 >       }\r
129 >  \r
130 > -     randomchar = random_unichar ();\r
131 > +     do {\r
132 > +         randomchar = random_unichar ();\r
133 > +     } while (randomchar == '\n');\r
134 >  \r
135 >       written = g_unichar_to_utf8 (randomchar, buf + offset);\r
136 >  \r
137 > -- \r
138 > 1.7.10.4\r