I want to port an old legacy thunderbird plugin I wrote

Hi all, I hope I’m posting my question at the right place.
For years I wrote a very simple thunderbird plugin capable of inserting the selected mail into a content management system.
Before starting development, I would like to know if the different actions I did are still available in the webextension API. I would also like to have some pointers or source code of people that did something equivalent

The code I wrote
1/ reads the windows registry to look for 3 parameters (not a very important step reading a file or hardcoding this values is possible)
2/ starts an indexing program (exe file) with parameters. (This indexing program is in charge of creating a XML file with the indexes, it is done outside thundebird)
3/ reads the return code of the indexing program and if ok saves the eml file corresponding to the selected mail in a folder near the XML file
4/ Both eml and xml file are then copied to a hot folder. Every 20 minutes an external job takes files from this hotfolder and uploads them to the content management system

So to sum up, I need to read parameters, add in the context menu of the selected mail the action “send-to-ged”, call an external exe program with parameters and then save the selected mail to a filesystem folder

Any help would be greatly appreciated
Benoît

First off, you can find documentation including some guides and a link to the raw API documentation at https://developer.thunderbird.net/add-ons/about-add-ons

You’ll also note that it has a mailing list for TB extension developers. You will likely encounter people with more experience in TB extension dev there.

I am not very familiar with the sample extensions provided there, but maybe have a look yourself.

The replacement for reading the registry would be https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/managed though based on the API docs the storage APIs may not be available.

To interact with nativ programs, nativeMessaging is your API (which is part of the runtime namespace which is documented as available): https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging

If writing files directly is absolutely required, you’d have to do that in your native application. Extensions have no direct file system access.

Pretty sure there are APIs for context menus, or at oeast mail related actions and for reading/writing mails.

Thanks a lot Martin for your help.
I will look in details the 2 Webextensions links you gave and also try to send via json the mail to the native application for writing to the filesystem
I will also post my next questions to the TB extension developers mailing list

Thanks again,
Benoît