--- /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 292A2429E31\r
+ for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 08:22:14 -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 lLufTO3Q4oc6 for <notmuch@notmuchmail.org>;\r
+ Sun, 10 Nov 2013 08:22:07 -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 A383D431FDA\r
+ for <notmuch@notmuchmail.org>; Sun, 10 Nov 2013 08:22:07 -0800 (PST)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1VfXm2-0005po-QA; Sun, 10 Nov 2013 12:22:06 -0400\r
+Received: (nullmailer pid 15733 invoked by uid 1000); Sun, 10 Nov 2013\r
+ 16:22:02 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] test: add optional workaround for gmime bug.\r
+Date: Sun, 10 Nov 2013 12:21:21 -0400\r
+Message-Id: <1384100482-15453-2-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.8.4.2\r
+In-Reply-To: <1384100482-15453-1-git-send-email-david@tethera.net>\r
+References: <1384100482-15453-1-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: Sun, 10 Nov 2013 16:22:14 -0000\r
+\r
+A new variable NOTMUCH_TEST_SLOPPY 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..eb1a2e6 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_SLOPPY 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..c71bd4e 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_SLOPPY"; 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