--- /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 2FD876DE014D\r
+ for <notmuch@notmuchmail.org>; Fri, 22 Jul 2016 09:47:33 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.72\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.72 tagged_above=-999 required=5 tests=[AWL=0.000, \r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01] 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 R3ms9OYYbA-e for <notmuch@notmuchmail.org>;\r
+ Fri, 22 Jul 2016 09:47:25 -0700 (PDT)\r
+Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 365C16DE00C8\r
+ for <notmuch@notmuchmail.org>; Fri, 22 Jul 2016 09:47:25 -0700 (PDT)\r
+Received: from webmail04.plus.net ([84.93.228.66]) by avasout07 with smtp\r
+ id MsnN1t0071SbfYc01snNBn; Fri, 22 Jul 2016 17:47:23 +0100\r
+X-CM-Score: 0.00\r
+X-CNFS-Analysis: v=2.2 cv=UYYTc+aN c=1 sm=1 tr=0\r
+ a=C5+YawzV8SR07mwocaP9vA==:117 a=6WEHsjNRvCJYAr8w9WnCiA==:17\r
+ a=cAmyUtKerLwA:10 a=H4IEW4q-AAAA:8 a=mEHJS5tcBp7mKnBcrAgA:9\r
+ a=kz_rP2hIBAIkRpJ1_vYA:9 a=Nf2LC8gUDJIA:10 a=CdiWusdWvyIA:10\r
+ a=AS9mAr_Iad8o7WnExNUa:22\r
+Received: from localhost ([127.0.0.1] helo=webmail.plus.net)\r
+ by webmail04.plus.net with esmtp (Exim 4.76)\r
+ (envelope-from <matt@bubblegen.co.uk>)\r
+ id 1bQdbe-00057U-Hn; Fri, 22 Jul 2016 17:47:22 +0100\r
+Received: from 80.82.130.242 (SquirrelMail authenticated user bubblegen+matt)\r
+ by webmail.plus.net with HTTP; Fri, 22 Jul 2016 17:47:22 +0100\r
+Message-ID: <3d06c4bede0643230bea93cb5d58ca6d.squirrel@webmail.plus.net>\r
+In-Reply-To: <87lh4wj4kq.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
+ <m260wxkvf3.fsf@guru.guru-group.fi> <87wpp76ctq.fsf@zancas.localnet>\r
+ <m2shzvrccn.fsf@dme.org> <87h9fm315q.fsf@bubblegen.co.uk>\r
+ <87oa9timv7.fsf@zancas.localnet>\r
+ <575b60a1d39a1ecc7d06e5c0d625be61.squirrel@webmail.plus.net>\r
+ <87bn5tjw5e.fsf@tesseract.cs.unb.ca>\r
+ <5ed42cd5aafdc045b5d9e1b918d10748.squirrel@webmail.plus.net>\r
+ <87mvpdgp38.fsf@bubblegen.co.uk> <87lh4wj4kq.fsf@zancas.localnet>\r
+Date: Fri, 22 Jul 2016 17:47:22 +0100\r
+Subject: Re: (emacs) Parsing problems replying to encrypted html\r
+From: "Matthew Lear" <matt@bubblegen.co.uk>\r
+To: "David Bremner" <david@tethera.net>\r
+Cc: "Matthew Lear" <matt@bubblegen.co.uk>, notmuch@notmuchmail.org,\r
+ "David Edmondson" <dme@dme.org>, "Mark Walters" <markwalters1009@gmail.com>\r
+Reply-To: matt@bubblegen.co.uk\r
+User-Agent: SquirrelMail\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed;boundary="----=_20160722174722_30667"\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: Fri, 22 Jul 2016 16:47:33 -0000\r
+\r
+------=_20160722174722_30667\r
+Content-Type: text/plain; charset="iso-8859-1"\r
+Content-Transfer-Encoding: 8bit\r
+\r
+Hi David,\r
+\r
+> OK, with that setting I can duplicate the problem replying to encrypted\r
+> HTML mail.\r
+>\r
+> It's also true that notmuch-reply doesn't include the content in the\r
+> html version of the multipart/alternative. Unlike notmuch show, it\r
+> doesn't have the ability to send parts later, so I guess that's a\r
+> problem there.\r
+>\r
+> The following patch seems to fix it for me. What I haven't worked out is\r
+> if it will break other things. Perhaps David E or Mark (in copy) can\r
+> comment on whether this is a sensible change, given that we now give the\r
+> user control of showing the part on the emacs side.\r
+>\r
+> diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+> index 3c6d685..cd88d79 100644\r
+> --- a/notmuch-reply.c\r
+> +++ b/notmuch-reply.c\r
+> @@ -690,7 +690,7 @@ notmuch_reply_format_sprinter(void *ctx,\r
+>\r
+> /* Start the original */\r
+> sp->map_key (sp, "original");\r
+> - format_part_sprinter (ctx, sp, node, TRUE, TRUE, FALSE);\r
+> + format_part_sprinter (ctx, sp, node, TRUE, TRUE, TRUE);\r
+>\r
+> /* End */\r
+> sp->end (sp);\r
+\r
+I could have sworn that I replied to this thread months ago but can't find\r
+a record it in the archives... I think I also missed David E's reply to\r
+yours mentioning the patch from id:1459708823-1852-1-git-send-email-dme at\r
+dme.org, so I'm following up...\r
+\r
+With David E's patch, the decryption problem I reported is resolved.\r
+However, I notice that this change hasn't yet been committed / pushed. Is\r
+there a particular reason for this?\r
+\r
+I'm currently maintaining a version of this patch compatible with the\r
+current master which makes this change to notmuch-mua.el\r
+notmuch-mua-reply() by adding (notmuch-show-process-crypto process-crypto)\r
+before doing the show. I've attached that patch here.\r
+\r
+I just wondered if we were going to see this pushed to master any time soon?\r
+\r
+Cheers,\r
+-- Matt\r
+\r
+------=_20160722174722_30667\r
+Content-Type: text/x-patch; name="fix-encrypted-html.patch"\r
+Content-Transfer-Encoding: 8bit\r
+Content-Disposition: attachment; filename="fix-encrypted-html.patch"\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 0445975..0dcdb06 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -250,7 +250,11 @@ mutiple parts get a header."\r
+ ;; Don't omit long parts.\r
+ (notmuch-show-max-text-part-size 0)\r
+ ;; Insert headers for parts as appropriate for replying.\r
+- (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)\r
++ (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)\r
++ ;; Ensure that any encrypted parts are\r
++ ;; decrypted during the generation of the reply\r
++ ;; text.\r
++ (notmuch-show-process-crypto process-crypto)\r
+ ;; Don't indent multipart sub-parts.\r
+ (notmuch-show-indent-multipart nil))\r
+ (notmuch-show-insert-body original (plist-get original :body) 0)\r
+------=_20160722174722_30667--\r
+\r
+\r