--- /dev/null
+Return-Path: <bsniffen@akamai.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 D0EBE431FC4\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Dec 2014 11:35:07 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] 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 ow9PktyI2ADc for <notmuch@notmuchmail.org>;\r
+ Mon, 1 Dec 2014 11:35:03 -0800 (PST)\r
+X-Greylist: delayed 397 seconds by postgrey-1.32 at olra;\r
+ Mon, 01 Dec 2014 11:35:02 PST\r
+Received: from prod-mail-xrelay02.akamai.com (prod-mail-xrelay02.akamai.com\r
+ [72.246.2.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1CE59431FC0\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Dec 2014 11:35:02 -0800 (PST)\r
+Received: from prod-mail-xrelay02.akamai.com (localhost [127.0.0.1])\r
+ by postfix.imss70 (Postfix) with ESMTP id 891D928501\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Dec 2014 19:28:25 +0000 (GMT)\r
+Received: from prod-mail-relay07.akamai.com (prod-mail-relay07.akamai.com\r
+ [172.17.121.112])\r
+ by prod-mail-xrelay02.akamai.com (Postfix) with ESMTP id 746ED28500\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Dec 2014 19:28:25 +0000 (GMT)\r
+Received: from email.msg.corp.akamai.com (usma1ex-cas3.msg.corp.akamai.com\r
+ [172.27.123.32])\r
+ by prod-mail-relay07.akamai.com (Postfix) with ESMTP id 6DF3280047\r
+ for <notmuch@notmuchmail.org>; Mon, 1 Dec 2014 19:28:25 +0000 (GMT)\r
+Received: from USMA1EX-CAS3.msg.corp.akamai.com (172.27.123.32) by\r
+ usma1ex-dag1mb3.msg.corp.akamai.com (172.27.123.103) with Microsoft\r
+ SMTP Server (TLS) id 15.0.913.22; Mon, 1 Dec 2014 14:28:24 -0500\r
+Received: from Tereva.local (172.19.45.175) by\r
+ USMA1EX-CAS3.msg.corp.akamai.com (172.27.123.32) with Microsoft SMTP\r
+ Server (TLS) id 15.0.913.22 via Frontend Transport;\r
+ Mon, 1 Dec 2014 14:28:24 -0500\r
+From: Brian Sniffen <bsniffen@akamai.com>\r
+To: "notmuch@notmuchmail.org" <notmuch@notmuchmail.org>\r
+Subject: Exchange mutilation of multipart/encrypted\r
+User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-apple-darwin14.0.0)\r
+Date: Mon, 1 Dec 2014 14:28:24 -0500\r
+Message-ID: <m2iohvf9uv.fsf@usma1mc-0csx92.kendall.corp.akamai.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-Mailman-Approved-At: Tue, 02 Dec 2014 01:16:51 -0800\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, 01 Dec 2014 19:35:08 -0000\r
+\r
+My employer uses an Exchange server in place of an MTA. It mutilates\r
+multipart/encrypted messages, so that when I receive a PGP/MIME message\r
+the Emacs-notmuch interface shows me:\r
+\r
+ [ multipart/mixed ]\r
+ [ text/plain ]\r
+ [ ATT00002: application/pgp-encrypted ]\r
+ [ msg.asc: application/octet-stream ]\r
+\r
+When I used Gnus heavily, I wrote a little program to un-mutilate\r
+PGP/MIME mail:\r
+\r
+~~~\r
+(defun repair-multipart-encrypted (article)\r
+ "Switch a multipart/mixed header to multipart/encrypted.\r
+This helps cope with broken Exchange servers."\r
+ (interactive (list (gnus-summary-article-number)))\r
+ (gnus-with-article article\r
+ (message-narrow-to-head)\r
+ (goto-char (point-min))\r
+ (search-forward "Content-Type")\r
+ (search-forward "mixed")\r
+ (replace-match "encrypted; protocol=\"application/pgp-encrypted\"" t t)\r
+ (widen))\r
+ (let (gnus-mark-article-hook)\r
+ (gnus-summary-select-article t t nil article)))\r
+~~~\r
+\r
+I'd love to have a way to tell Emacs-notmuch to treat a part as of a\r
+different type, and provide parameters. Alternately, I'd be happy to\r
+edit the file on disk and have it re-indexed---but that seems likely to\r
+cause me regret. Any advice? I see\r
+`notmuch-show-insert-bodypart-internal` and expect to call that\r
+with a forced content-type.\r
+\r
+Thanks,\r
+Brian\r
+\r
+-- \r
+Brian Sniffen\r
+"I reserve the right to evolve my views, and state that views I previously\r
+ expressed may have been somehere along the spectrum from insufficiently\r
+ nuanced through ill-informed to dead wrong."\r