1

I have a JavaScript function which operates on strings, and I’d like to write a Thunderbird extension to apply it to every MIME part in an outgoing message – both inline parts like the body and any attachments. However, I can’t find the API call I need to request the MIME data from Thunderbird. Ideally, I’d write something like

var parts = GetMimeParts();
for (var i = 0; i < parts.length; i++) {
    parts[i].data = mutate_string(parts[i].data);
}

What Thunderbird API should I use to retrieve the MIME parts from an outgoing message?

Benjamin Barenblat
  • 1,311
  • 6
  • 19

1 Answers1

0

The tl;dr is, there's no simple API to do that. You would have to:

What exactly are you trying to achieve?

Community
  • 1
  • 1
Jonathan Protzenko
  • 1,709
  • 8
  • 13
  • I’m experimenting with a secure mail system in which your message is saved on a secure server and a token is sent in its stead. I need to get the MIME parts of the message so I can replace them with the token. – Benjamin Barenblat Oct 16 '13 at 22:56
  • Do you have one token for each mime part? – Jonathan Protzenko Oct 17 '13 at 07:32
  • The system is flexible; it simply accepts data blobs and generates tokens. It could issue one token per MIME part; it could also issue one token for the entire message. Which approach do you recommend? – Benjamin Barenblat Oct 17 '13 at 21:01
  • It would probably be much easier to have one token for the entire message. Then your only problem left is how to intercept the message before it's sent, which has been covered in the newsgroups and is done by some addons; see http://mdn.beonex.com/en/Extensions/Thunderbird/HowTos/Common_Thunderbird_Use_Cases/Compose_New_Message.html#Intercept_Outgoing_Message for instance. – Jonathan Protzenko Oct 18 '13 at 08:29