--- /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 DCFE76DE103A\r
+ for <notmuch@notmuchmail.org>; Tue, 1 Mar 2016 05:16:59 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.386\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.386 tagged_above=-999 required=5 tests=[AWL=0.334,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
+ 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 mAexUNzAWBed for <notmuch@notmuchmail.org>;\r
+ Tue, 1 Mar 2016 05:16:57 -0800 (PST)\r
+X-Greylist: delayed 457 seconds by postgrey-1.35 at arlo;\r
+ Tue, 01 Mar 2016 05:16:56 PST\r
+Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id E0DBA6DE00DF\r
+ for <notmuch@notmuchmail.org>; Tue, 1 Mar 2016 05:16:55 -0800 (PST)\r
+Received: from webmail04.plus.net ([84.93.228.66]) by avasout07 with smtp\r
+ id Qd9G1s0021SbfYc01d9G6A; Tue, 01 Mar 2016 13:09:16 +0000\r
+X-CM-Score: 0.00\r
+X-CNFS-Analysis: v=2.1 cv=QqujpgGd c=1 sm=1 tr=0\r
+ a=C5+YawzV8SR07mwocaP9vA==:117 a=G4bc5lkgapKKm1P+Twxy3Q==:17\r
+ a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=8nJEP1OIZ-IA:10\r
+ a=7OsogOcEt9IA:10 a=xLoQFyq0T0LXa8BorckA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19\r
+ a=wPNLvfGTeEIA:10\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>) id 1aak3A-0008PB-4j\r
+ for notmuch@notmuchmail.org; Tue, 01 Mar 2016 13:09:16 +0000\r
+Received: from 80.229.236.194 (SquirrelMail authenticated user bubblegen+matt)\r
+ by webmail.plus.net with HTTP; Tue, 1 Mar 2016 13:09:16 -0000\r
+Message-ID: <f50e07855e9bbbdd780ef925d8e2d879.squirrel@webmail.plus.net>\r
+Date: Tue, 1 Mar 2016 13:09:16 -0000\r
+Subject: (emacs) Parsing problems replying to encrypted html\r
+From: "Matthew Lear" <matt@bubblegen.co.uk>\r
+To: 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, 01 Mar 2016 13:17:00 -0000\r
+\r
+Hi,\r
+I've noticed a problem when replying to an encrypted email when I have\r
+html set as preferred over plain text. Looks like notmuch fails to parse\r
+the body and the original body text in notmuch-reply just looks like this:\r
+\r
+> [ text/html ]\r
+> !!! Bodypart insert error: End of file during parsing !!!\r
+\r
+A few things which might help understand what could be happening here...\r
+\r
+notmuch from git with head @ 07b6220\r
+gmime 2.6.20-r1 (gentoo)\r
+\r
+(setq mm-text-html-renderer 'shr)\r
+(setq shr-inhibit-images nil)\r
+(setq mime-view-text/html-previewer 'shr)\r
+(setq mm-inline-text-html-with-images t)\r
+\r
+(set-locale-environment "en_GB.UTF-8")\r
+(set-language-environment 'utf-8)\r
+(set-selection-coding-system 'utf-8)\r
+(prefer-coding-system 'utf-8)\r
+(set-default-coding-systems 'utf-8)\r
+(set-terminal-coding-system 'utf-8)\r
+(set-keyboard-coding-system 'utf-8)\r
+(setq default-buffer-file-coding-system 'utf-8)\r
+\r
+(setq notmuch-multipart/alternative-discouraged '("text/plain"\r
+"multipart/related"))\r
+\r
+The message I'm replying to looks like:\r
+\r
+User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101\r
+ Thunderbird/38.6.0\r
+MIME-Version: 1.0\r
+In-Reply-To: <removed>\r
+Content-Type: multipart/encrypted;\r
+ protocol="application/pgp-encrypted";\r
+ boundary="et6k1RmUSFFnhWFnwewqvineB8rlw3boE"\r
+\r
+This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156)\r
+--et6k1RmUSFFnhWFnwewqvineB8rlw3boE\r
+Content-Type: application/pgp-encrypted\r
+Content-Description: PGP/MIME version identification\r
+\r
+Version: 1\r
+\r
+--et6k1RmUSFFnhWFnwewqvineB8rlw3boE\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
+hQEMA41hzuYEoCb4AQgApMvj7nt6Goj1kLDUheofRWwORI/CNFgExIIAAz8ivJxH\r
+...\r
+...\r
+6nVgRBQIJp+59xsmfC2axrASSAh11/ZdVl3T60LvlrsoKLkBHNAC4W+H/cyxxDk0\r
+BnJC8+QJbgbyRBANUV4d5PCUbKcuDRW/TVQhtZY=\r
+=rKjq\r
+-----END PGP MESSAGE-----\r
+\r
+--et6k1RmUSFFnhWFnwewqvineB8rlw3boE--\r
+\r
+\r
+Notmuch shows this as:\r
+\r
+[ multipart/encrypted ]\r
+[ Decryption successful ]\r
+[ Good signature by: xxxx ]\r
+[ application/pgp-encrypted ]\r
+Version: 1\r
+[ multipart/mixed ]\r
+[ multipart/alternative ]\r
+[ text/plain (hidden) ]\r
+[ multipart/related ]\r
+[ text/html (hidden) ]\r
+[ image.jpg: image/jpeg (hidden) ]\r
+\r
+Things of interest:\r
+\r
+1/ I have the same encrypted email in plain text only and replying to it\r
+works fine with notmuch.\r
+\r
+2/ I can view the html from the email in a browser, and it looks fine.\r
+\r
+3/ If I switch emacs to use w3m instead of shr, I don't see the 'Bodypart\r
+insert error' fro notmuch-reply but there is no original message included\r
+in the reply composition either.\r
+\r
+I'm not quite sure if this is a notmuch issue as such, or attributed to my\r
+emacs config, or something else...\r
+\r
+I don't know exactly what is supposed to happen when replying to html\r
+emails, but if I reply to an html email which is not encrypted, there is\r
+no '> [ text/html ]' in the reply composition window - it's just text from\r
+the original message that I'm replying to and nothing more.\r
+\r
+Since the encrypted email I'm replying has a text part, can notmuch use\r
+this and quote it when replying (obviously ensuring that the entire reply\r
+will be encrypted).\r
+\r
+Any thoughts?\r
+\r
+Thanks a lot.\r
+-- Matt\r
+\r