--- /dev/null
+Return-Path: <fejj@gnome.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 3B21D431FC4\r
+ for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 06:40:58 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.438\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_NONE=-0.0001]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id H+pjH8h+CXKV for <notmuch@notmuchmail.org>;\r
+ Thu, 29 Jan 2015 06:40:54 -0800 (PST)\r
+Received: from resqmta-po-10v.sys.comcast.net (resqmta-po-10v.sys.comcast.net\r
+ [96.114.154.169])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 94619431FBC\r
+ for <notmuch@notmuchmail.org>; Thu, 29 Jan 2015 06:40:54 -0800 (PST)\r
+Received: from resomta-po-12v.sys.comcast.net ([96.114.154.236])\r
+ by resqmta-po-10v.sys.comcast.net with comcast\r
+ id lqg51p00C56HXL001qgtqe; Thu, 29 Jan 2015 14:40:53 +0000\r
+Received: from [192.168.1.102] ([24.91.170.86])\r
+ by resomta-po-12v.sys.comcast.net with comcast\r
+ id lqgr1p00a1sBWGw01qgsuU; Thu, 29 Jan 2015 14:40:53 +0000\r
+Message-ID: <54CA467B.30408@gnome.org>\r
+Date: Thu, 29 Jan 2015 09:40:59 -0500\r
+From: Jeffrey Stedfast <fejj@gnome.org>\r
+User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64;\r
+ rv:31.0) Gecko/20100101 Thunderbird/31.4.0\r
+MIME-Version: 1.0\r
+To: David Bremner <david@tethera.net>, gmime-devel-list@gnome.org\r
+Subject: Re: [gmime-devel] gmime and S/MIME\r
+References: <87twz9wyf8.fsf@maritornes.cs.unb.ca>\r
+In-Reply-To: <87twz9wyf8.fsf@maritornes.cs.unb.ca>\r
+Content-Type: text/plain; charset=windows-1252; format=flowed\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 29 Jan 2015 14:40:59 -0000\r
+\r
+Hi David,\r
+\r
+On 1/29/2015 7:42 AM, David Bremner wrote:\r
+> With a few others, I've been attempting to get S/MIME supported in\r
+> notmuch (which as you might or might not remember is using gmime\r
+> underneath). The signature verification part is working OK, but I've\r
+> gotten a bit bogged down trying to get decryption working.\r
+>\r
+> What I have learned is that according RFC5751, smime message (parts)\r
+> look like\r
+>\r
+> Media type: application/pkcs7-mime\r
+> parameters: any\r
+> file suffix: any\r
+>\r
+> Media type: multipart/signed\r
+> parameters: protocol=3D"application/pkcs7-signature"\r
+> file suffix: any\r
+>\r
+> Media type: application/octet-stream\r
+> parameters: any\r
+> file suffix: p7m, p7s, p7c, p7z\r
+>\r
+> Unless I miss something, out of the box there is only support for\r
+> decrypting multipart/encrypted. In particular the gmime tests for\r
+> S/MIME use this "container format" [1].\r
+\r
+Correct, I don't think I ever got around to implementing the=20\r
+GMimeApplicationPkcs7Mime class.\r
+\r
+>\r
+> So I'm wondering if I'm confused about the RFC(s), or about GMIME, or i=\r
+s\r
+> one suppose to write analogs of g_mime_multipart_encrypted_decrypt for\r
+> other top level parts?\r
+\r
+You are not confused. I would probably hesitate to say that it was my=20\r
+*intention* for everyone to implement their own S/MIME class for=20\r
+pkcs7-mime, but in any case, that is what needs to be done right now :(\r
+\r
+FWIW, I've written another library called MimeKit in C# which shares a=20\r
+similar design to GMime that is hosted on GitHub that implements the=20\r
+pkcs7-mime class:\r
+\r
+https://github.com/jstedfast/MimeKit/blob/master/MimeKit/Cryptography/App=\r
+licationPkcs7Mime.cs\r
+\r
+Hopefully that helps provide you with ideas on how to implement the same =\r
+\r
+sort of thing using GMime for notmuch.\r
+\r
+(btw, if you end up implementing this, I'd love to accept your patches=20\r
+into GMime proper)\r
+\r
+Jeff\r
+\r