1 Return-Path: <tomi.ollila@iki.fi>
\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 56DC8431FDD
\r
6 for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 11:06:00 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 6wlJn2OD1Dlu for <notmuch@notmuchmail.org>;
\r
16 Sun, 18 Aug 2013 11:05:54 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 04E2F431FDB
\r
19 for <notmuch@notmuchmail.org>; Sun, 18 Aug 2013 11:05:54 -0700 (PDT)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 91A1F100086;
\r
22 Sun, 18 Aug 2013 21:05:45 +0300 (EEST)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
\r
25 Subject: Re: [PATCH] test: Canonicalize RFC 2047 encoding and charset
\r
26 In-Reply-To: <1376833926-6024-1-git-send-email-amdragon@mit.edu>
\r
27 References: <1376833926-6024-1-git-send-email-amdragon@mit.edu>
\r
28 User-Agent: Notmuch/0.16+3~g340c058 (http://notmuchmail.org) Emacs/24.3.1
\r
29 (x86_64-unknown-linux-gnu)
\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
31 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
32 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
33 Date: Sun, 18 Aug 2013 21:05:45 +0300
\r
34 Message-ID: <m238q698na.fsf@guru.guru-group.fi>
\r
36 Content-Type: text/plain
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\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: Sun, 18 Aug 2013 18:06:00 -0000
\r
51 On Sun, Aug 18 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
53 > RFC 2047 states that the encoding and charset in an encoded word are
\r
54 > case-insensitive, so force them to lower case in the reply test. This
\r
55 > fixes an issue caused by GMime versions (somewhere between 2.6.10 and
\r
56 > 2.6.16), which changed the capitalization of the encoding.
\r
58 > test/reply | 8 +++++---
\r
59 > 1 file changed, 5 insertions(+), 3 deletions(-)
\r
61 > diff --git a/test/reply b/test/reply
\r
62 > index d4389cf..a078927 100755
\r
65 > @@ -201,12 +201,14 @@ add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \
\r
66 > '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
\r
67 > '[body]="Encoding"'
\r
69 > -output=$(notmuch reply id:${gen_msg_id})
\r
70 > -# Note that GMime changes from Q- to B-encoding
\r
71 > +# GMime happens to change from Q- to B-encoding. We canonicalize the
\r
72 > +# case of the encoding and charset because different versions of GMime
\r
73 > +# capitalize the encoding differently.
\r
74 > +output=$(notmuch reply id:${gen_msg_id} | sed 's/=?[^?]*?[bB]?/\L&/g')
\r
76 The sed expression looks fancy enough to be GNU sed extension (\L& doing
\r
77 tolower to the matching part?). A more portable alternative could be:
\r
79 output=$(notmuch reply id:${gen_msg_id} | sed -e 's/?UTF-8?/?utf-8?/g' \
\r
80 -e 's/?ISO-88591-1?/?iso-88591-1?/g' -e 's/?B?/?b?/g')
\r
82 or alternatively (some bashism):
\r
84 output=$(notmuch reply id:${gen_msg_id})
\r
85 output=${output//\?UTF-8\?/?utf-8?}
\r
86 output=${output//\?ISO-8859-1\?/?iso-8859-1?}
\r
87 output=${output//\?B\?/?b?}
\r
93 > test_expect_equal "$output" "\
\r
94 > From: Notmuch Test Suite <test_suite@notmuchmail.org>
\r
95 > Subject: Re: =?iso-8859-1?b?4N/n?=
\r
96 > -To: =?UTF-8?b?4piD?= <snowman@example.com>
\r
97 > +To: =?utf-8?b?4piD?= <snowman@example.com>
\r
98 > In-Reply-To: <${gen_msg_id}>
\r
99 > References: <${gen_msg_id}>
\r
104 > _______________________________________________
\r
105 > notmuch mailing list
\r
106 > notmuch@notmuchmail.org
\r
107 > http://notmuchmail.org/mailman/listinfo/notmuch
\r