Add-on or extension for thuderbird

Hi, I’m trying to develop an extension for thunderbird mail client. I’d like to save the selected mail (as eml file) and execute my local program installed on my pc. Is it possibile to extend the context menu ? If it’s so, how ?
thanks in advance
Umberto

If you are developing for the current release (68) and want it to work with future releases (76+) then you’ll have to develop a Mail Extension. The current APIs are here:
https://thunderbird-webextensions.readthedocs.io/en/latest/
I doubt if you could do exactly what you describe - the APIs are rather limited at the moment.

If you use an earlier version of TB (52, and maybe 60) you could develop a legacy (XUL) extension which can do much more. But it’s obsolete technology and the documentation won’t be online for ever.

Off topic, but could you achieve your goal outside Thunderbird - by extracting the email from the mailbox files and passing it to yout local program?