--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 40A3F6DE028A\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 04:39:04 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.635\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.635 tagged_above=-999 required=5 tests=[AWL=-0.017,\r
+ SPF_NEUTRAL=0.652] 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 5dMgUks3QkZ6 for <notmuch@notmuchmail.org>;\r
+ Tue, 8 Mar 2016 04:39:02 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 720776DE0274\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 04:39:02 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id D023D10005A;\r
+ Tue, 8 Mar 2016 14:39:11 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: David Bremner <david@tethera.net>, Matthew Lear <matt@bubblegen.co.uk>,\r
+ David Edmondson <dme@dme.org>\r
+Cc: notmuch@notmuchmail.org\r
+Subject: Re: (emacs) Parsing problems replying to encrypted html\r
+In-Reply-To: <m260wxkvf3.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
+User-Agent: Notmuch/0.21+81~g4743a61 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 08 Mar 2016 14:39:11 +0200\r
+Message-ID: <m21t7lkuts.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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 12:39:04 -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, 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" "--format=sexp" "--include-html" "--part=3" "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 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 --reply-to=sender thread:0000000000004a6f\r
+> 2016-03-08 (Tue) 14:16:01: show --format=raw --part=2 id:56DDE706.6060702@bubblegen.co.uk\r
+> 2016-03-08 (Tue) 14:16:01: show --format=sexp --include-html --part=3 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" :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
+> when replying from show:\r
+>\r
+> 2016-03-08 (Tue) 14:16:37: reply --format=sexp --format-version=1 --decrypt --reply-to=sender id:56DDE706.6060702@bubblegen.co.uk\r
+\r
+the --decrypt here provided the content (from part=3) in this case.\r
+\r
+\r
+Tomi\r