--- /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 BD8286DE1410\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 04:26:20 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.636\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.636 tagged_above=-999 required=5 tests=[AWL=-0.016,\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 JyghjJefxzfU for <notmuch@notmuchmail.org>;\r
+ Tue, 8 Mar 2016 04:26:18 -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 7464F6DE0B28\r
+ for <notmuch@notmuchmail.org>; Tue, 8 Mar 2016 04:26:18 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 2C64F10005A;\r
+ Tue, 8 Mar 2016 14:26:25 +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: <87pov58b9y.fsf@zancas.localnet>\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
+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:26:24 +0200\r
+Message-ID: <m260wxkvf3.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:26:20 -0000\r
+\r
+On Tue, Mar 08 2016, David Bremner wrote:\r
+\r
+> [ text/plain ]\r
+> Matthew Lear <matt@bubblegen.co.uk> writes:\r
+>\r
+>>>\r
+>>> Please encrypt a message to the attached gpg key (from the notmuch test\r
+>>> suite), and send it to the list as an attachement if you can replicate\r
+>>> the bug.\r
+>>\r
+>> Done. Attached here.\r
+>>\r
+>> [ 1457383253_0.15104.sunrise,U=4513,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S: application/octet-stream ]\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
+2016-03-08 (Tue) 14:16:01: show --format=raw --part=3 id:56DDE706.6060702@bubblegen.co.uk\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
+2016-03-08 (Tue) 14:16:37: show --format=raw --part=2 id:56DDE706.6060702@bubblegen.co.uk\r
+\r
+there's no --decrypt when from search ... and interestingly there are other\r
+differences, too...\r
+\r
+Tomi\r
+\r