--- /dev/null
+Return-Path: <matt@bubblegen.co.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id AABCF6DE01F5\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 06:06:48 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.66\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.66 tagged_above=-999 required=5 tests=[AWL=0.040, \r
+ RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id ipzM4_zLZXEi for <notmuch@notmuchmail.org>;\r
+ Tue, 8 Mar 2016 06:06:47 -0800 (PST)\r
+Received: from avasout04.plus.net (avasout04.plus.net [212.159.14.19])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id B753A6DE020B\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 06:06:44 -0800 (PST)\r
+Received: from localhost ([84.93.237.98]) by avasout04 with smtp\r
+ id TS6h1s006283uBY01S6ilC; Tue, 08 Mar 2016 14:06:42 +0000\r
+X-CM-Score: 0.00\r
+X-CNFS-Analysis: v=2.1 cv=K//fZHiI c=1 sm=1 tr=0\r
+ a=BJaFPv9AyABFDM2hXLRoEA==:117 a=BJaFPv9AyABFDM2hXLRoEA==:17\r
+ a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=8nJEP1OIZ-IA:10\r
+ a=7OsogOcEt9IA:10 a=80hmnl3cAAAA:8 a=nTBm7qOPAKf81V_2nAYA:9\r
+ a=9h0y6MHcAV6JqX-w:21 a=O4tOLaTqGRudZjUL:21 a=wPNLvfGTeEIA:10\r
+Received: from localhost ([127.0.0.1] helo=webmail.plus.net)\r
+ by localhost with esmtp (Exim 4.76)\r
+ (envelope-from <matt@bubblegen.co.uk>)\r
+ id 1adIHZ-00087u-5V; Tue, 08 Mar 2016 14:06:41 +0000\r
+Received: from 216.31.211.11 (proxying for unknown)\r
+ (SquirrelMail authenticated user bubblegen+matt)\r
+ by webmail.plus.net with HTTP; Tue, 8 Mar 2016 14:06:41 -0000\r
+Message-ID: <ac9b21e31f5581025ff92fd70a8cef79.squirrel@webmail.plus.net>\r
+In-Reply-To: <m21t7lkuts.fsf@guru.guru-group.fi>\r
+References: <f50e07855e9bbbdd780ef925d8e2d879.squirrel@webmail.plus.net>\r
+ <m2a8miwc6x.fsf@dme.org>\r
+ <c4ff9f2c141441be10b1cb4b1e0300a7.squirrel@webmail.plus.net>\r
+ <56DD48B3.90604@bubblegen.co.uk> <87mvqatr6y.fsf@zancas.localnet>\r
+ <87h9gigfyz.fsf@bubblegen.co.uk> <87pov58b9y.fsf@zancas.localnet>\r
+ <m260wxkvf3.fsf@guru.guru-group.fi>\r
+ <m21t7lkuts.fsf@guru.guru-group.fi>\r
+Date: Tue, 8 Mar 2016 14:06:41 -0000\r
+Subject: Re: (emacs) Parsing problems replying to encrypted html\r
+From: "Matthew Lear" <matt@bubblegen.co.uk>\r
+To: "Tomi Ollila" <tomi.ollila@iki.fi>\r
+Cc: "David Bremner" <david@tethera.net>,\r
+ "Matthew Lear" <matt@bubblegen.co.uk>, "David Edmondson" <dme@dme.org>,\r
+ notmuch@notmuchmail.org\r
+Reply-To: matt@bubblegen.co.uk\r
+User-Agent: SquirrelMail\r
+MIME-Version: 1.0\r
+Content-Type: text/plain;charset=iso-8859-1\r
+Content-Transfer-Encoding: 8bit\r
+X-Priority: 3 (Normal)\r
+Importance: Normal\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 08 Mar 2016 14:06:48 -0000\r
+\r
+> On Tue, Mar 08 2016, Tomi Ollila wrote:\r
+>\r
+>> [ text/plain ]\r
+>> On Tue, Mar 08 2016, David Bremner wrote:\r
+>>\r
+>>> [ text/plain ]\r
+>>> Matthew Lear <matt@bubblegen.co.uk> writes:\r
+>>>\r
+>>>\r
+>>> Thanks for the test case. I can duplicate a (the?) bug as\r
+>>> follows. Replying to that message from notmuch-show mode works, but\r
+>>> replying from notmuch-search mode yields\r
+>>>\r
+>>>> !!! Bodypart insert error: Wrong type argument: number-or-marker-p,\r
+>>>> nil !!!\r
+>>>> [ application/pgp-encrypted ]\r
+>>>> Version: 1\r
+>>>> [ encrypted.asc: application/octet-stream (as text/plain) ]\r
+>>>> !!! Bodypart insert error: Internal error: No :content from ("show"\r
+>>>> "--format=sexp" "--include-html" "--part=3"\r
+>>>> "id:56DDE706.6060702@bubblegen.co.uk") !!!\r
+>>>\r
+>>> Followed by the ciphertext.\r
+>>>> -----BEGIN PGP MESSAGE-----\r
+>>>\r
+>>> If anyone wants to play with this, you just need to import the notmuch\r
+>>> test key into your keyring, something like\r
+>>>\r
+>>> gpg --import path/to/notmuch-source/test/gnupg-secret-key.asc\r
+>>>\r
+>>> What's odd is that the notmuch command in the error message works on\r
+>>> the\r
+>>> command line.\r
+>>\r
+>> I got these to my log:\r
+>>\r
+>> when replying from search:\r
+>>\r
+>> 2016-03-08 (Tue) 14:16:01: reply --format=sexp --format-version=1\r
+>> --reply-to=sender thread:0000000000004a6f\r
+>> 2016-03-08 (Tue) 14:16:01: show --format=raw --part=2\r
+>> id:56DDE706.6060702@bubblegen.co.uk\r
+>> 2016-03-08 (Tue) 14:16:01: show --format=sexp --include-html --part=3\r
+>> id:56DDE706.6060702@bubblegen.co.uk\r
+>\r
+> The above line returns (same as in latest !!! bodypart insert error !!!)\r
+>\r
+> (:id 3 :content-type "application/octet-stream" :filename "encrypted.asc"\r
+> :content-length 1875)\r
+>\r
+> -- there is no content to be included from that line :/ (and wat is this\r
+> "encrypted.asc" anyway ?)\r
+\r
+encrypted.asc is what Enigmail uses when sending using PGP/MIME. I think\r
+it wraps up the message body in this file (armor encrypted) and marks it\r
+with disposition inline. Enigmail also sends PGP/MIME version\r
+identification information in another MIME part\r
+(application/pgp-encrypted) - so you have two MIME parts per PGP/MIME\r
+encrypted message.\r
+\r
+You can view all headers in the test message if you're in notmuch-show by\r
+using V. You'll see something like:\r
+\r
+Content-Type: multipart/encrypted;\r
+ protocol="application/pgp-encrypted";\r
+ boundary="xxx"\r
+\r
+This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\r
+--xxx\r
+Content-Type: application/pgp-encrypted\r
+Content-Description: PGP/MIME version identification\r
+\r
+Version: 1\r
+\r
+--xxx\r
+Content-Type: application/octet-stream; name="encrypted.asc"\r
+Content-Description: OpenPGP encrypted message\r
+Content-Disposition: inline; filename="encrypted.asc"\r
+\r
+-----BEGIN PGP MESSAGE-----\r
+Version: GnuPG v2\r
+...\r
+-----END PGP MESSAGE-----\r
+\r
+--xxx--\r
+\r
+\r