[PATCH] python: add bindings for notmuch_message_get_property

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Nov 17 01:03:09 PST 2017


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


More information about the notmuch mailing list