[PATCH v5 1/4] test: normalize only message filenames in show json
authorPeter Wang <novalazy@gmail.com>
Sat, 15 Dec 2012 03:06:42 +0000 (14:06 +1100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:11 +0000 (09:52 -0800)
da/b97d2418c914a477d5c1b496293fb9b56d51b8 [new file with mode: 0644]

diff --git a/da/b97d2418c914a477d5c1b496293fb9b56d51b8 b/da/b97d2418c914a477d5c1b496293fb9b56d51b8
new file mode 100644 (file)
index 0000000..2b17f7f
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <novalazy@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id C48EC431FBF\r
+       for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 19:07:31 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 53SoZYMotH44 for <notmuch@notmuchmail.org>;\r
+       Fri, 14 Dec 2012 19:07:31 -0800 (PST)\r
+Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com\r
+       [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 20942431FBD\r
+       for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 19:07:31 -0800 (PST)\r
+Received: by mail-pb0-f53.google.com with SMTP id jt11so2594874pbb.26\r
+       for <notmuch@notmuchmail.org>; Fri, 14 Dec 2012 19:07:30 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=jlbd0eFzEVH0+mewbfKYdgD7/JgLUCvkowf04s79WBA=;\r
+       b=z0WQMgcoF2QB8wUigI3Ufl0cj7A2kTXXOMpxKvtsc5cyMh1xNgA8h+FlgrsZ+JfNnM\r
+       td0yo6cHWeZKy4mRM6AIzliz4zuA1996ltmZamjnImEerKZfi08J+tSoKGW1mAyuscp9\r
+       lSC6SHNPdo2eJaWg9nyqPLz/QW/GhDxk5Ekn7EkgJJLz9J3b4uzNk99agA/E7xyERcdn\r
+       hwUMCGQaqEafSQuVBVRp6u8QvirBWYkjZ4PNhgLWYhdZkf5U3UcYke3+NEE1/U0If39G\r
+       wWShcy+8mptvqpgE5ccwnFOWat07s0dawrer8wwAQw7jCYue8/bBTjsFyVLzRJW02iJO\r
+       gvwg==\r
+Received: by 10.68.132.10 with SMTP id oq10mr2195220pbb.18.1355540850332;\r
+       Fri, 14 Dec 2012 19:07:30 -0800 (PST)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+       [220.233.42.215])\r
+       by mx.google.com with ESMTPS id j8sm4225919paz.30.2012.12.14.19.07.25\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 14 Dec 2012 19:07:29 -0800 (PST)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v5 1/4] test: normalize only message filenames in show json\r
+Date: Sat, 15 Dec 2012 14:06:42 +1100\r
+Message-Id: <1355540805-24937-2-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.7.12.1\r
+In-Reply-To: <1355540805-24937-1-git-send-email-novalazy@gmail.com>\r
+References: <1355540805-24937-1-git-send-email-novalazy@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 15 Dec 2012 03:07:32 -0000\r
+\r
+notmuch_json_show_sanitize replaced "filename" field values even in part\r
+structures, where the value is predictable.  Make it only normalize the\r
+filename value if it is an absolute path (begins with slash), which is\r
+true of the Maildir filenames that were intended to be normalized away.\r
+---\r
+ test/multipart   | 2 +-\r
+ test/test-lib.sh | 2 +-\r
+ 2 files changed, 2 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/test/multipart b/test/multipart\r
+index 0527f84..344ed81 100755\r
+--- a/test/multipart\r
++++ b/test/multipart\r
+@@ -630,7 +630,7 @@ cat <<EOF >EXPECTED\r
+  "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]},\r
+  {"id": 7,\r
+  "content-type": "text/plain",\r
+- "filename": "YYYYY",\r
++ "filename": "attachment",\r
+  "content": "This is a text attachment.\n"},\r
+  {"id": 8,\r
+  "content-type": "text/plain",\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index fd64736..6ce3b31 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -600,7 +600,7 @@ notmuch_json_show_sanitize ()\r
+ {\r
+     sed \\r
+       -e 's|"id": "[^"]*",|"id": "XXXXX",|g' \\r
+-      -e 's|"filename": "[^"]*",|"filename": "YYYYY",|g'\r
++      -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'\r
+ }\r
\r
+ # End of notmuch helper functions\r
+-- \r
+1.7.12.1\r
+\r