Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lacre:ongoing [2024/05/31 11:01] – add isue 150 to plan pfmlacre:ongoing [2024/07/12 17:17] (current) – cont: Research: Thunderbird's handling pfm
Line 33: Line 33:
   - We could use header-only parser mentioned above during delivery planning (''lacre.core'', function ''delivery_plan'').   - We could use header-only parser mentioned above during delivery planning (''lacre.core'', function ''delivery_plan'').
   - Finally, if the message is known to be processed in PGP/Inline mode, we could load each MIME entity's body and process it. (Without ContentManager //if possible//.)   - Finally, if the message is known to be processed in PGP/Inline mode, we could load each MIME entity's body and process it. (Without ContentManager //if possible//.)
 +
 +===== Research: Thunderbird's handling of OpenPGP-encrypted messages =====
 +
 +Turns out when Thunderbird is expected to send a plain text message (something that would usually become a ''text/plain'' MIME entity accompanied by a bunch of headers), it does the following:
 +
 +  * It creates a ''multipart/encrypted'' MIME entity (RFC 4880 and 3156 compliant);
 +  * creates a ''multipart/mixed'' MIME entity;
 +  * populates its contents;
 +  * encrypts it and puts in the MIME entity from step 1.
 +
 +Populating the contents depends on the mode:
 +
 +  * If ''Subject:'' is encrypted too, original ''Subject:'' is replaced with the string ''...''.
 +  * If the user chooses to sign the message, their public key is included in the ''multipart/mixed'' entity.
 +  * Actual message body is included as Base 64-encoded MIME part of the ''multipart/mixed'' entity.
 +
 +Unfortunately we need to compose new MIME entity for every PGP/MIME-encrypted message, so we need to load contents of each part. To avoid transformation we could switch from ''get_content()'' to ''get_payload(decode=False)'', so we'd get strings with raw MIME entity payloads, giving us a chance to populate ''multipart/mixed'' in step 2 above with non-transformed payloads.