[PATCH v2 1/3] test: normalize only message filenames in show json
authorPeter Wang <novalazy@gmail.com>
Wed, 8 Aug 2012 12:27:50 +0000 (22:27 +1000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:59 +0000 (09:48 -0800)
fe/4df274864c253d2262b94f5e35229a9ea2553f [new file with mode: 0644]

diff --git a/fe/4df274864c253d2262b94f5e35229a9ea2553f b/fe/4df274864c253d2262b94f5e35229a9ea2553f
new file mode 100644 (file)
index 0000000..7b53316
--- /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 ABE57431FCB\r
+       for <notmuch@notmuchmail.org>; Wed,  8 Aug 2012 05:28:21 -0700 (PDT)\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 cjBUrWG22mEt for <notmuch@notmuchmail.org>;\r
+       Wed,  8 Aug 2012 05:28:20 -0700 (PDT)\r
+Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com\r
+       [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B3366431FBD\r
+       for <notmuch@notmuchmail.org>; Wed,  8 Aug 2012 05:28:17 -0700 (PDT)\r
+Received: by mail-gh0-f181.google.com with SMTP id 3so879463ghz.26\r
+       for <notmuch@notmuchmail.org>; Wed, 08 Aug 2012 05:28:17 -0700 (PDT)\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=A1SeD3Pd8IBIIpeIsFB/+bIfXsSVY2O/PLTAjB3GYCw=;\r
+       b=zBBDamLj9IhGiUKHYDv3hDcgF9S46DLeeEGcy1oOep/X1K2Qp9Wo6DaA9cyBRUTqQW\r
+       VPO0mkXHUNyLQjUE/Tsp+tN3ZHnKsG67MkbI8qzdak4JL3ZPUrvPUlelGK3kPIWqxDA3\r
+       IhfZ5IJIFpAbE++FQFhVKp9s7/GBReAcJAjyDRdaftnwESDv1/7kDc96ZrUmm/PTabWu\r
+       WbyDTq8xAmSv/3sBpPRsaLvaH6SEL6rH8hQr44H+avGyoYWur5hbDcHEO8bC5b6dwXm/\r
+       s5mFYkrNxhbf8tiVAEs1PvC8i+5zLvcE+i0vyYGpIQPQudKRkSkpvqHxEKxXOUTrRU86\r
+       L90g==\r
+Received: by 10.66.88.39 with SMTP id bd7mr33513018pab.50.1344428897304;\r
+       Wed, 08 Aug 2012 05:28:17 -0700 (PDT)\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 qx8sm9893074pbc.63.2012.08.08.05.28.14\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Wed, 08 Aug 2012 05:28:16 -0700 (PDT)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 1/3] test: normalize only message filenames in show json\r
+Date: Wed,  8 Aug 2012 22:27:50 +1000\r
+Message-Id: <1344428872-12374-2-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1344428872-12374-1-git-send-email-novalazy@gmail.com>\r
+References: <1344428872-12374-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: Wed, 08 Aug 2012 12:28:22 -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 791d2dc..983694e 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -577,7 +577,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.4.4\r
+\r