--- /dev/null
+Return-Path: <jani@nikula.org>\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 9999B431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 10 Sep 2013 11:51:25 -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 2OyoLTYZ1623 for <notmuch@notmuchmail.org>;\r
+ Tue, 10 Sep 2013 11:51:21 -0700 (PDT)\r
+Received: from mail-we0-f172.google.com (mail-we0-f172.google.com\r
+ [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 30515431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 10 Sep 2013 11:51:21 -0700 (PDT)\r
+Received: by mail-we0-f172.google.com with SMTP id w61so5913408wes.17\r
+ for <notmuch@notmuchmail.org>; Tue, 10 Sep 2013 11:51:18 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
+ bh=pn6YIg+L0p+i0NioRlwhK5cuFMW1ME5DOTl6ijqauF4=;\r
+ b=Ybdnq6Suih7Iba2oRlCiJKW07eBHHB/cljqvLrRCufWtgrwtwo6Ymd3qWZnErRKBe5\r
+ l+hxVRSVk8n50UntAV5JPb6jQUJf79YZzZ4+rsziv+vYdXUOKzoCOLXRX+Y4pkSZRf+G\r
+ F32xQJzHt4GAemKmUdrGCLa2+gIEFl3EotF738ar7F9oboT2wfN63EySBcP3sbj5IG4b\r
+ Mnhgq2nFz3TkYnrk8oIEXPlVSmCkrKZrl6+IqYpF1THjCKdpGYk/0ZN1I8tYKW3kalEd\r
+ ZUqkkZ8n8iYIgMoB6KzbgynAPDuozlyg4+sct5Jk8rtBfWWiE3Xl5tZ32QWgrpJGuKLn\r
+ E4NQ==\r
+X-Gm-Message-State:\r
+ ALoCoQmTfhgw6dVshDIN0Al0OZDW9Fk8p4QorhoqR08fFo+X3hHjGiJoU3xY59rOV2aBKOKzCAcm\r
+X-Received: by 10.180.20.42 with SMTP id k10mr14710434wie.0.1378839077461;\r
+ Tue, 10 Sep 2013 11:51:17 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91]) by mx.google.com with ESMTPSA id\r
+ mz14sm5493926wic.11.1969.12.31.16.00.00\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Tue, 10 Sep 2013 11:51:16 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] lib/cli: pass GMIME_ENABLE_RFC2047_WORKAROUNDS to\r
+ g_mime_init()\r
+Date: Tue, 10 Sep 2013 21:51:18 +0300\r
+Message-Id: <1378839078-6298-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.4.rc3\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: Tue, 10 Sep 2013 18:51:25 -0000\r
+\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