Re: [PATCH] [python] decode headers from utf-8 to unicode
[notmuch-archives.git] / ac / d34409b8c444e112df6cfff67a70d96b0f0584
1 Return-Path: <amdragon@gmail.com>\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 73808431FD0\r
6         for <notmuch@notmuchmail.org>; Tue, 25 Jan 2011 16:51:17 -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.798\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.798 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id v3Qty8U8dcG4 for <notmuch@notmuchmail.org>;\r
18         Tue, 25 Jan 2011 16:51:15 -0800 (PST)\r
19 Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com\r
20         [209.85.216.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits))\r
21         (No client certificate requested)\r
22         by olra.theworths.org (Postfix) with ESMTPS id 4E89B431FB6\r
23         for <notmuch@notmuchmail.org>; Tue, 25 Jan 2011 16:51:15 -0800 (PST)\r
24 Received: by qwe5 with SMTP id 5so423307qwe.26\r
25         for <notmuch@notmuchmail.org>; Tue, 25 Jan 2011 16:51:14 -0800 (PST)\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
27         h=domainkey-signature:mime-version:in-reply-to:references:date\r
28         :message-id:subject:from:to:cc:content-type;\r
29         bh=d1zd6reLY6Vjk9dOr5lQfvbOPZ+CdNc/EQzdXL/2Q8g=;\r
30         b=jORn0Sa47OHgQ9insOIAttNWS4PCV5E+fyPJBjdAy9qk8zAmrsoxfyfhjZMtgJlKv5\r
31         J38JUjY1ck2dHanyXVAJ3tFI9rzTXEJxfX1+4+ug4FvGhk/pogoxQOIaPkd0lh34nM4M\r
32         91MYN0LLOqgfXsc4NiV/mofrkeMgFH1t9HLMU=\r
33 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
34         h=mime-version:in-reply-to:references:date:message-id:subject:from:to\r
35         :cc:content-type;\r
36         b=rVIfL0Xrp7JzU3ytpB8kX20RtKZhYKonfIKPFugo/Skbe7V8+7nvlwBa7miTUkhQhz\r
37         /O4k4HZHLbrbv7zIBtWQUwyQft0H2vNsecu3m5656EbY/KrFXLoMmkBL1F+Z3+WncYgv\r
38         6P8MpWrW+GEmFP4+4mmYkoW16PXcFHzocWrn0=\r
39 MIME-Version: 1.0\r
40 Received: by 10.229.79.135 with SMTP id p7mr5334151qck.154.1296003074663; Tue,\r
41         25 Jan 2011 16:51:14 -0800 (PST)\r
42 Received: by 10.229.97.143 with HTTP; Tue, 25 Jan 2011 16:51:14 -0800 (PST)\r
43 In-Reply-To: <3wd4o8wa7fx.fsf@testarossa.amd.com>\r
44 References: <3wd4o8wa7fx.fsf@testarossa.amd.com>\r
45 Date: Tue, 25 Jan 2011 19:51:14 -0500\r
46 Message-ID: <AANLkTikzBkHoTUO41byUrZrTPk1YUgG+rDPKtsTSq2sy@mail.gmail.com>\r
47 Subject: Re: Strange match to my query\r
48 From: Austin Clements <amdragon@gmail.com>\r
49 To: Mark Anderson <MarkR.Anderson@amd.com>\r
50 Content-Type: multipart/alternative; boundary=00163616494fe4a459049ab53a1c\r
51 Cc: notmuch@notmuchmail.org\r
52 X-BeenThere: notmuch@notmuchmail.org\r
53 X-Mailman-Version: 2.1.13\r
54 Precedence: list\r
55 List-Id: "Use and development of the notmuch mail system."\r
56         <notmuch.notmuchmail.org>\r
57 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
59 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
60 List-Post: <mailto:notmuch@notmuchmail.org>\r
61 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
62 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
64 X-List-Received-Date: Wed, 26 Jan 2011 00:51:17 -0000\r
65 \r
66 --00163616494fe4a459049ab53a1c\r
67 Content-Type: text/plain; charset=ISO-8859-1\r
68 \r
69 Well-constructed test message.  Xapian's query parser is actually doing the\r
70 right thing [1] and this is a bug in the way notmuch indexes address list\r
71 headers.  For each address, _notmuch_message_gen_terms resets the term\r
72 generator's term position, so your To header indexes with positions as\r
73   c:1 hello:2 com:3 K:1 R:2 world:3 com:4\r
74 Thus, the phrase query "hello world" matches hello in position 2 and world\r
75 in position 3.  Probably the right thing for notmuch to do is to jump up the\r
76 term generator position between each address so phrase queries don't cross\r
77 them or span them.\r
78 \r
79 [1] Your to:\'$WORD1@$WORD2\' query didn't work because Xapian doesn't\r
80 accept a single quote after a prefix.\r
81 \r
82 On Tue, Jan 25, 2011 at 6:29 PM, Mark Anderson <MarkR.Anderson@amd.com>wrote:\r
83 \r
84 > Hi guys, What's up? ("Notmuch")\r
85 >\r
86 > Apparently matching on email addresses doesn't work the way I hoped.\r
87 >\r
88 > While debugging why my to:x@y.com <to%3Ax@y.com> search was matching far\r
89 > too many\r
90 > entries, I whittled it down to this:\r
91 >\r
92 > WORD1=hello\r
93 > WORD2=goodbye\r
94 > MSGID=junk$(date +%s)\r
95 > TESTDIR=$(notmuch config get database.path)/.tmp/new\r
96 > TESTMAIL=$TESTDIR/$MSGID:2,\r
97 >\r
98 > mkdir -p $TESTDIR\r
99 >\r
100 > echo Testcase for $WORD1@$WORD2, msgid: $MSGID@junk.com\r
101 >\r
102 > echo "From: nobody@nobody.com\r
103 > To: c@${WORD1}.com, K-R@${WORD2}.com\r
104 > Date: Mon, 24 Jan 2011 23:41:34 -0600\r
105 > Subject: Error\r
106 > Message-ID: <$MSGID@junk.com>\r
107 >\r
108 > Not empty body.=\r
109 >\r
110 > " > $TESTMAIL\r
111 >\r
112 > notmuch new\r
113 > notmuch search --output=files to:$WORD1@$WORD2\r
114 > notmuch search --output=files to:\"$WORD1@$WORD2\"\r
115 >\r
116 > Why does that match, but this doesn't?\r
117 >\r
118 > notmuch search --output=files to:\'$WORD1@$WORD2\'\r
119 >\r
120 > Apparently single quotes are the only quote for Xapian's parser?\r
121 >\r
122 > I guess this is a strong vote for the quick integration of the custom\r
123 > parser with optimization passes that turn emails into phrases that can't\r
124 > match across multiple emails.\r
125 >\r
126 > This was just an egregious example of notmuch giving me notmuch of what\r
127 > I wanted, or actually, far too much of what I didn't want.\r
128 >\r
129 > Thanks,\r
130 > -Mark\r
131 >\r
132 > _______________________________________________\r
133 > notmuch mailing list\r
134 > notmuch@notmuchmail.org\r
135 > http://notmuchmail.org/mailman/listinfo/notmuch\r
136 >\r
137 \r
138 --00163616494fe4a459049ab53a1c\r
139 Content-Type: text/html; charset=ISO-8859-1\r
140 Content-Transfer-Encoding: quoted-printable\r
141 \r
142 <div>Well-constructed test message. =A0Xapian&#39;s query parser is actuall=\r
143 y doing the right thing [1] and this is a bug in the way notmuch indexes ad=\r
144 dress list headers. =A0For each address, _notmuch_message_gen_terms resets =\r
145 the term generator&#39;s term position, so your To header indexes with posi=\r
146 tions as</div>\r
147 <div>=A0=A0c:1 hello:2 com:3 K:1 R:2 world:3 com:4</div><div>Thus, the phra=\r
148 se query &quot;hello world&quot; matches hello in position 2 and world in p=\r
149 osition 3. =A0Probably the right thing for notmuch to do is to jump up the =\r
150 term generator position between each address so phrase queries don&#39;t cr=\r
151 oss them or span them.</div>\r
152 <div><br></div><div>[1] Your to:\&#39;$WORD1@$WORD2\&#39; query didn&#39;t =\r
153 work because Xapian doesn&#39;t accept a single quote after a prefix.</div>=\r
154 <br><div class=3D"gmail_quote">On Tue, Jan 25, 2011 at 6:29 PM, Mark Anders=\r
155 on <span dir=3D"ltr">&lt;<a href=3D"mailto:MarkR.Anderson@amd.com">MarkR.An=\r
156 derson@amd.com</a>&gt;</span> wrote:<br>\r
157 <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=\r
158 x #ccc solid;padding-left:1ex;">Hi guys, What&#39;s up? (&quot;Notmuch&quot=\r
159 ;)<br>\r
160 <br>\r
161 Apparently matching on email addresses doesn&#39;t work the way I hoped.<br=\r
162 >\r
163 <br>\r
164 While debugging why my <a href=3D"mailto:to%3Ax@y.com">to:x@y.com</a> searc=\r
165 h was matching far too many<br>\r
166 entries, I whittled it down to this:<br>\r
167 <br>\r
168 WORD1=3Dhello<br>\r
169 WORD2=3Dgoodbye<br>\r
170 MSGID=3Djunk$(date +%s)<br>\r
171 TESTDIR=3D$(notmuch config get database.path)/.tmp/new<br>\r
172 TESTMAIL=3D$TESTDIR/$MSGID:2,<br>\r
173 <br>\r
174 mkdir -p $TESTDIR<br>\r
175 <br>\r
176 echo Testcase for $WORD1@$WORD2, msgid: $<a href=3D"mailto:MSGID@junk.com">=\r
177 MSGID@junk.com</a><br>\r
178 <br>\r
179 echo &quot;From: <a href=3D"mailto:nobody@nobody.com">nobody@nobody.com</a>=\r
180 <br>\r
181 To: c@${WORD1}.com, K-R@${WORD2}.com<br>\r
182 Date: Mon, 24 Jan 2011 23:41:34 -0600<br>\r
183 Subject: Error<br>\r
184 Message-ID: &lt;$<a href=3D"mailto:MSGID@junk.com">MSGID@junk.com</a>&gt;<b=\r
185 r>\r
186 <br>\r
187 Not empty body.=3D<br>\r
188 <br>\r
189 &quot; &gt; $TESTMAIL<br>\r
190 <br>\r
191 notmuch new<br>\r
192 notmuch search --output=3Dfiles to:$WORD1@$WORD2<br>\r
193 notmuch search --output=3Dfiles to:\&quot;$WORD1@$WORD2\&quot;<br>\r
194 <br>\r
195 Why does that match, but this doesn&#39;t?<br>\r
196 <br>\r
197 notmuch search --output=3Dfiles to:\&#39;$WORD1@$WORD2\&#39;<br>\r
198 <br>\r
199 Apparently single quotes are the only quote for Xapian&#39;s parser?<br>\r
200 <br>\r
201 I guess this is a strong vote for the quick integration of the custom<br>\r
202 parser with optimization passes that turn emails into phrases that can&#39;=\r
203 t<br>\r
204 match across multiple emails.<br>\r
205 <br>\r
206 This was just an egregious example of notmuch giving me notmuch of what<br>\r
207 I wanted, or actually, far too much of what I didn&#39;t want.<br>\r
208 <br>\r
209 Thanks,<br>\r
210 -Mark<br>\r
211 <br>\r
212 _______________________________________________<br>\r
213 notmuch mailing list<br>\r
214 <a href=3D"mailto:notmuch@notmuchmail.org">notmuch@notmuchmail.org</a><br>\r
215 <a href=3D"http://notmuchmail.org/mailman/listinfo/notmuch" target=3D"_blan=\r
216 k">http://notmuchmail.org/mailman/listinfo/notmuch</a><br>\r
217 </blockquote></div><br>\r
218 \r
219 --00163616494fe4a459049ab53a1c--\r