--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 148EB431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 10 Sep 2013 19:03:05 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 bmokPi2Za+JQ for <notmuch@notmuchmail.org>;\r
+ Tue, 10 Sep 2013 19:02:57 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 308D4431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 10 Sep 2013 19:02:57 -0700 (PDT)\r
+X-AuditID: 1209190e-b7f988e0000009a7-b9-522fcf4f6bb2\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 5E.4F.02471.F4FCF225; Tue, 10 Sep 2013 22:02:55 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r8B22rLY020427; \r
+ Tue, 10 Sep 2013 22:02:54 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r8B22qpM006425\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Tue, 10 Sep 2013 22:02:53 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1VJZlY-0001Wd-NT; Tue, 10 Sep 2013 22:02:50 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] lib/cli: pass GMIME_ENABLE_RFC2047_WORKAROUNDS to\r
+ g_mime_init()\r
+In-Reply-To: <1378839078-6298-1-git-send-email-jani@nikula.org>\r
+References: <1378839078-6298-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.16+37~g9701e9c (http://notmuchmail.org) Emacs/23.4.1\r
+ (i486-pc-linux-gnu)\r
+Date: Tue, 10 Sep 2013 22:02:47 -0400\r
+Message-ID: <8738pcjet4.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsUixCmqret/Xj/IYO9kHoum6c4W12/OZHZg\r
+ 8rh1/zW7x7NVt5gDmKK4bFJSczLLUov07RK4MqZOvcNUcFqi4vGikywNjFeFuxg5OSQETCQu\r
+ nrzPCGGLSVy4t54NxBYS2McocXgadxcjF5C9kVGi6/YjZgjnNJPEojuv2SGcJYwSrw8vZQdp\r
+ YRPQkNi2fznYKBEBK4lzD1+zgNjCAiESy96sYgWxOQXsJRY332GBWGEnMfXLCmYQW1QgTuJa\r
+ 50KwOIuAqsS7/ZfA4rxA532cMJ8NwhaUODnzCVgNs4CWxI1/L5kmMArMQpKahSS1gJFpFaNs\r
+ Sm6Vbm5iZk5xarJucXJiXl5qka6xXm5miV5qSukmRnBASvLtYPx6UOkQowAHoxIPr4GifpAQ\r
+ a2JZcWXuIUZJDiYlUV7nk0AhvqT8lMqMxOKM+KLSnNTiQ4wSHMxKIrxTnYByvCmJlVWpRfkw\r
+ KWkOFiVx3vUgKYH0xJLU7NTUgtQimKwMB4eSBG/EOaCsYFFqempFWmZOCUKaiYMTZDgP0PCF\r
+ Z0GGFxck5hZnpkPkTzEqSonzqoE0C4AkMkrz4HphCeMVozjQK8K8miBVPMBkA9f9CmgwE9Dg\r
+ 775gg0sSEVJSDYwq6anZhwPEI9be3GZ/+uq/sujyi6/WPny1xPDU6cZZwq+9FrWbcRe//v77\r
+ 1lzRhMDMxW8vLvjVzy1q3/v56YybF03La9ueM+yQNjKUllmyN9Ti2cwXx5elC1ocbUhnEVDM\r
+ V39x44/39a0N/sLXL73asTpOTDO35OH1A0Jd+5oYl9+bk/3cWTNbiaU4I9FQi7moOBEAJiI+\r
+ cvMCAAA=\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, 11 Sep 2013 02:03:05 -0000\r
+\r
+LGTM in principle, though I'd like to see a test of some of the\r
+malformed RFC 2047 that this lets us decode. Is there a summary\r
+somewhere of exactly what these workarounds enable?\r
+\r
+This isn't directly related to this patch, but is there a reason we\r
+g_mime_init in so many different places? Both the CLI and\r
+notmuch_database_open I can understand because the CLI also uses GMime\r
+and should be sure it's initialized. Maaaybe\r
+notmuch_message_file_get_header because notmuch_message_file\r
+theoretically independent of the database, even though I don't think\r
+it's possible to call into it without first calling\r
+notmuch_database_open. But _notmuch_message_index_file?\r
+\r
+On Tue, 10 Sep 2013, Jani Nikula <jani@nikula.org> wrote:\r
+> As explained by Jeffrey Stedfast, the author of GMime, quoted in [1]:\r
+>\r
+>> Passing the GMIME_ENABLE_RFC2047_WORKAROUNDS flag to g_mime_init()\r
+>> *should* solve the decoding problem mentioned in the thread. This\r
+>> flag should be safe to pass into g_mime_init() without any bad side\r
+>> effects and my unit tests do test that code-path.\r
+>\r
+> The thread being referred to is [2].\r
+>\r
+> [1] id:87bo56viyo.fsf@nikula.org\r
+> [2] id:08cb1dcd-c5db-4e33-8b09-7730cb3d59a2@gmail.com\r
+> ---\r
+> lib/database.cc | 2 +-\r
+> lib/index.cc | 2 +-\r
+> lib/message-file.c | 2 +-\r
+> notmuch.c | 2 +-\r
+> 4 files changed, 4 insertions(+), 4 deletions(-)\r
+>\r
+> diff --git a/lib/database.cc b/lib/database.cc\r
+> index 5cc0765..bb4f180 100644\r
+> --- a/lib/database.cc\r
+> +++ b/lib/database.cc\r
+> @@ -655,7 +655,7 @@ notmuch_database_open (const char *path,\r
+> \r
+> /* Initialize gmime */\r
+> if (! initialized) {\r
+> - g_mime_init (0);\r
+> + g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);\r
+> initialized = 1;\r
+> }\r
+> \r
+> diff --git a/lib/index.cc b/lib/index.cc\r
+> index a2edd6d..78c18cf 100644\r
+> --- a/lib/index.cc\r
+> +++ b/lib/index.cc\r
+> @@ -440,7 +440,7 @@ _notmuch_message_index_file (notmuch_message_t *message,\r
+> static bool mbox_warning = false;\r
+> \r
+> if (! initialized) {\r
+> - g_mime_init (0);\r
+> + g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);\r
+> initialized = 1;\r
+> }\r
+> \r
+> diff --git a/lib/message-file.c b/lib/message-file.c\r
+> index 4d9af89..a2850c2 100644\r
+> --- a/lib/message-file.c\r
+> +++ b/lib/message-file.c\r
+> @@ -228,7 +228,7 @@ notmuch_message_file_get_header (notmuch_message_file_t *message,\r
+> is_received = (strcmp(header_desired,"received") == 0);\r
+> \r
+> if (! initialized) {\r
+> - g_mime_init (0);\r
+> + g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);\r
+> initialized = 1;\r
+> }\r
+> \r
+> diff --git a/notmuch.c b/notmuch.c\r
+> index 78d29a8..7300c21 100644\r
+> --- a/notmuch.c\r
+> +++ b/notmuch.c\r
+> @@ -264,7 +264,7 @@ main (int argc, char *argv[])\r
+> \r
+> local = talloc_new (NULL);\r
+> \r
+> - g_mime_init (0);\r
+> + g_mime_init (GMIME_ENABLE_RFC2047_WORKAROUNDS);\r
+> #if !GLIB_CHECK_VERSION(2, 35, 1)\r
+> g_type_init ();\r
+> #endif\r
+> -- \r
+> 1.8.4.rc3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r