thunderbird-addon

Thunderbird78+: How to check for message create, reply and forward

老子叫甜甜 提交于 2021-01-29 07:07:56
问题 I am a beginner in thunderbird addons so I really appreciate if you can help me. I am trying to find a way in my background javascript to check whenever a user has opened the window for create a new message, reply a message and forward a message. I want to put a default text in the message window before the user is gonna send it. I know thunderbird 78+ should only uses web extension APIs and i found this Compose API but how to use it in my background script. https://thunderbird-webextensions

Save e-mail body and its attachments from Thunderbird

微笑、不失礼 提交于 2021-01-28 02:07:47
问题 I'm trying to save the e-mail body and its attachments from javascript using a custom addin, and I'm not able to do it as described in http://forums.mozillazine.org/viewtopic.php?f=19&t=2030903 Do you have any suggestions? Does the e-mail body can be saved into the native EML format? Thank you! alert("Messages selected: " + gFolderDisplay.selectedCount); let enumerator = gFolderDisplay.selectedMessages; for each (let msgHdr in fixIterator(enumerator, Ci.nsIMsgDBHdr)) { var messageID = msgHdr

How to intercept incoming email and retrieve message body in thunderbird

点点圈 提交于 2020-02-22 08:45:07
问题 In my Thunderbird add-on I want to listen to new incoming emails and process the message body. So I have written a mailListener and added it to an instance of nsIMsgFolderNotificationService . The listener works fine and notifies when a mail comes. I get the nsIMsgDBHdr object which was fetched, but I cannot stream the message for the particular folder in the msgAdded function of my mailListener . it hangs, and I cannot even see the message body in the Thunderbird's message pane. I think the

Stop Email From Sending

一世执手 提交于 2019-12-30 11:34:28
问题 I am working on writing an add-on for Thunderbird and would like to be able to cancel the sending of an email under certain conditions. I have the following code which allows me to execute code before the email is sent, but I don't know how to stop it. document.getElementById("msgcomposeWindow").addEventListener( "compose-send-message", function(){ var msgcomposeWindow = document.getElementById( "msgcomposeWindow" ); var msg_type = msgcomposeWindow.getAttribute( "msgtype" ); // do not

Get selected message data in Thunderbird extension

∥☆過路亽.° 提交于 2019-12-24 04:52:19
问题 I need to get some e-mail message data in my Thunderbird extension. I found this example on MDN (https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIMsgMessageService): var content = ""; var MessageURI = GetFirstSelectedMessage(); var MsgService = messenger.messageServiceFromURI(MessageURI); var MsgStream = Components.classes["@mozilla.org/network/sync-stream-listener;1"].createInstance(); var consumer = MsgStream.QueryInterface(Components.interfaces.nsIInputStream); var

How can I “hack” the Thunderbird Lightning extension to fully color categories

爱⌒轻易说出口 提交于 2019-12-20 21:01:33
问题 (Note: While I'm not entirely sure if this be better asked on SuperUser, I guess the fact that you probably will have to mess around in the xpi/jar file with the css settings, should make it suitable for SO.) Mozilla Thunderbird's Calendar extension, Lightning, will use different colors for different calendars, and just use a narrow vertical bar for the category color: (Light blue as calendar color and red as category color) What I would like to find out is how I could go about changing/

Get sender and recipients in Thunderbird extension upon sending message

倾然丶 夕夏残阳落幕 提交于 2019-12-20 03:53:08
问题 I'm playing around trying to create a Thunderbird extension, one of the bootstrapped/restartless type (I mean, javascript code is not run from overlays. Instead listeners fire for various events). At some point I'd like to check the sender and recipients (To, Cc, Bcc) when user decides to send the message, so to perform some checks on them. I already have a number of event listeners set up and working, including one for compose-send-message event that gets properly fired when user confirms

Thunderbid extension: open eml file

六月ゝ 毕业季﹏ 提交于 2019-12-13 02:42:10
问题 I already created an extension that does the following: When I run Thinderbird with the command line thunderbird -MyCustomParam1 "12345" my extension will open a compose window and add the parameter "12345" to the window. Some code that I use: // In the calling code var args = { param1: 12345, }; args.wrappedJSObject = args; var watcher = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher); watcher.openWindow(null, url, windowName,