A clone of ssh://git@git.pep-security.lu:23000/thunderbird/pEpForThunderbird.git, until that one is open source again.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.5 KiB

Incoming message transformation


This is one of the fundamental areas where we want to extend Thunderbird. We want to be able to transform a received message in order to decrypt it and perform other operations if needed.

Main documentation

This https://thunderbird.topicbox.com/groups/addons/Tefecd2c30eac581d question to the Thunderbird's addon dev community has been important in clarifying some doubts. In case that link is broken, you can try to search the question from its title "Transforming an incoming message through its MIME representation (multipart/encrypted)".

Developing for the decryption workflow can be a bit tricky because the logic is encapsulated in a component that is created by a Thuderbird's factory when we click on a multipart/encrypted message. For most of the tests i used a prototype of the onPgpMime function listed in the question above.

I would call onPgpMime with functions that returned specific messages, so that i could unregister and try again from the command line without reinstalling the plugin. Towards the end when it was more stable i just called pEpController.addFactories/removeFactories, which is slower.

  • README.md you are reading this
  • decryption-control-flow-in-enigmail.md control flow for PGP/MIME in Enigmail, which led to the solution we are actually adopting
  • from-enigmail-to-pep.md why Enigmail's solution is not enough for us and how our current approach differs

Other contents

The investigation for P4TB-43 was long and i took some notes while reading the code and doing experiments. We can try to keep similar notes in the repo as a form of documentation. Eventually We could extend or reuse parts of it, find a convenient structure, or remove some of them.

I started from Thunderbird's code then moved to Enigmail. Enigmail handles attachments in the cases of PGP/Inline or PGP/MIME. The code related to PGP/Inline is larger, it's the first i found and the first i tried to use. The code related to PGP/MIME contains the solution we are using now.

  • thunderbird.txt i started from analysing Thunderbird's code, then i moved to Enigmail
  • style-and-markup.md initial search to figure out whether Enigmail is duplicating Thunderbird's markup for attachments
  • enigmailMessengerOverlay.md notes about PGP/Inline code in Enigmail. This involves a set of solutions we eventually discarded
  • open-enigmail-questions.md some open directions for deepening how PGP/MIME currently works in Enigmail