From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E633E6DE024A for ; Sun, 19 Nov 2017 02:19:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e85zO3nlpN3f for ; Sun, 19 Nov 2017 02:19:31 -0800 (PST) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id E87D06DE0183 for ; Sun, 19 Nov 2017 02:19:30 -0800 (PST) Received: from fifthhorseman.net (3.231.197.178.dynamic.wless.zhbmb00p-cgnat.res.cust.swisscom.ch [178.197.231.3]) by che.mayfirst.org (Postfix) with ESMTPSA id 79F1BF9A1; Sun, 19 Nov 2017 05:19:17 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id 4D63220C3E; Fri, 17 Nov 2017 17:03:09 +0800 (+08) From: Daniel Kahn Gillmor To: Ruben Pollan , notmuch@notmuchmail.org Subject: Re: [PATCH] python: add bindings for notmuch_message_get_property In-Reply-To: <20171115222954.8216-1-meskio@sindominio.net> References: <20171115222954.8216-1-meskio@sindominio.net> Date: Fri, 17 Nov 2017 17:03:09 +0800 Message-ID: <878tf5uvjm.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 10:19:32 -0000 On Wed 2017-11-15 23:29:54 +0100, Ruben Pollan wrote: > Message.get_property (prop) returns a string with the value of the property. Upon review, this is actually insufficient for making robust use of the session-key series :( In particular, it only returns the first value for the session key returned. There are (at least) two situations where a message may have more than one session key: * if two copies of the message are received by different channels, and each channel somehow obtains a different session key. For example: i send the message to an encrypted mailing list like schleuder that unwraps and then rewraps the encrypted message -- in this case, the version saved to sent-mail during sending has session key A, and the version received back from schleuder has session key B * if one encrypted message contains another encrypted message. then the outer message has session key A, and the inner attachment has session key B. of course there are more ways this can happen, as well as combinations of these ways :/ it mostly won't happen! so things will look like they're looking fine, but then you'll get a message (or two copies of a single message) and at some point you'll try to render one part or one version, but you'll only have the other session key available. In the session-key series, i work around this by simply trying each session key against an encrypted part until i find one that works. It would be "cleaner" (more principled) to somehow associate each session key with the part(s) of the message file(s) that it is capable of decrypting, but that's a lot of bookkeeping -- i think it's actually "cleaner" (less code, less computation in the standard case) to just take the current approach. --dkg