--- /dev/null
+Return-Path: <bremner@tethera.net>\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 232EB429E34\r
+ for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 19:15:54 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+ 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 lxT9YRcQ8DAZ for <notmuch@notmuchmail.org>;\r
+ Sun, 10 Nov 2013 19:15:48 -0800 (PST)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 46C72431FAE\r
+ for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 19:15:48 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1Vfhyd-0003CQ-B7; Sun, 10 Nov 2013 23:15:47 -0400\r
+Received: (nullmailer pid 14497 invoked by uid 1000); Mon, 11 Nov 2013\r
+ 03:15:43 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v2 1/2] test: add optional workaround for gmime bug.\r
+Date: Sun, 10 Nov 2013 23:15:33 -0400\r
+Message-Id: <1384139734-14427-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.8.4.2\r
+In-Reply-To: <1384100482-15453-3-git-send-email-david@tethera.net>\r
+References: <1384100482-15453-3-git-send-email-david@tethera.net>\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: Mon, 11 Nov 2013 03:15:54 -0000\r
+\r
+A new variable NOTMUCH_TEST_WORKAROUNDS is introduced, which enables this\r
+workaround. It could be used in the future for similar things.\r
+---\r
+ test/README | 7 +++++++\r
+ test/test-lib.sh | 9 +++++++++\r
+ 2 files changed, 16 insertions(+)\r
+\r
+diff --git a/test/README b/test/README\r
+index d12cff2..f132860 100644\r
+--- a/test/README\r
++++ b/test/README\r
+@@ -96,6 +96,13 @@ Note that some tests in the existing test suite rely on previous test\r
+ items, so you cannot arbitrarily skip any test and expect the\r
+ remaining tests to be unaffected.\r
+ \r
++Working around some bugs\r
++------------------------\r
++\r
++The test suite contains some workarounds for known (minor) problems in\r
++external dependencies. You can enable these workarounds by setting the\r
++environment variable NOTMUCH_TEST_WORKAROUNDS to a non-null value.\r
++\r
+ Writing Tests\r
+ -------------\r
+ The test script is written as a shell script. It should start with\r
+diff --git a/test/test-lib.sh b/test/test-lib.sh\r
+index 2aa4dfc..4554d5e 100644\r
+--- a/test/test-lib.sh\r
++++ b/test/test-lib.sh\r
+@@ -628,6 +628,15 @@ notmuch_json_show_sanitize ()\r
+ -e 's|"filename": "/[^"]*",|"filename": "YYYYY",|g'\r
+ }\r
+ \r
++notmuch_reply_sanitize ()\r
++{\r
++ if test -n "$NOTMUCH_TEST_WORKAROUNDS"; then\r
++ # work around GMIME bug #711305\r
++ sed -e 's/^References: /References: /'\r
++ else\r
++ cat\r
++ fi\r
++}\r
+ # End of notmuch helper functions\r
+ \r
+ # Use test_set_prereq to tell that a particular prerequisite is available.\r
+-- \r
+1.8.4.2\r
+\r