Autoopening of attachments!

Discussion of features in Mozilla Thunderbird
New Member
Posts: 1
Joined: October 15th, 2017, 2:03 am

Post Posted October 15th, 2017, 2:08 am


I have a remote camera that mail me a *.jpg file if anything moves in front of it. I want to configure thunderbirs in the way that it automatically loads the jpg-file and shows me the pic if I select the mail that it's within. Now I have to doubleclick on the attachment..



User avatar
Posts: 122411
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Post Posted October 15th, 2017, 5:26 am

Have you tried setting Thunderbird to display attachments inline? Menu path View->Display Attachments Inline.


User avatar
Posts: 46055
Joined: July 30th, 2003, 5:06 pm

Post Posted October 16th, 2017, 1:44 am

That will work but it is a security risk since it will automatically open any attachment, including spam. You might be able to use a message filter to automatically open and display any attachments using a "open file" action after testing that the message was sent from a specific email address (your remote camera). The FiltaQuilla add-on adds a "open file" action and a javascript action to message filters, among other things. ... la/?src=ss

Posts: 3593
Joined: February 3rd, 2009, 6:29 pm

Post Posted October 16th, 2017, 7:17 am

The FiltaQuilla Javascript Action stuff is pretty difficult.

Here is an old example of autoprinting the first attachment with LibreOffice. (not tested with current release)

Code: Select all
/*Javascript Action*/
function urlListener(aPath) {
  this.OnStartRunningUrl = function(aUrl) {}
  this.OnStopRunningUrl = function(aUrl, aExitCode) {
    if (Components.isSuccessCode(aExitCode)) {
      var localFile = Components.classes[";1"].
      var process = Components.classes[";1"].
      var args = ["-norestore", "-nofirststartwizard", "-nologo",
        "-headless", "-p", aPath];
      localFile.initWithPath("C:\\Program Files\\LibreOffice 3.5" +
      process.init(localFile);, args, args.length);
for (var i = 0; i < msgHdrs.length; i++) {
  var msgHdr = msgHdrs.queryElementAt(i, Components.interfaces.nsIMsgDBHdr);
  MsgHdrToMimeMessage(msgHdr, null, function(aMsgHdr, aMimeMsg) {
    if (aMimeMsg == null) return; // shouldn't happen, but sometimes does?
    var msgURI = aMsgHdr.folder.generateMessageURI(aMsgHdr.messageKey);
    var attachment = aMimeMsg.allAttachments[0];
    var file = Components.classes[";1"].
      get("TmpD", Components.interfaces.nsIFile); // temporary folder
      parseInt("666", 8));
    // 0666 read and write permission for owner, group, others
    // example.txt example-1.txt example-2.txt example-3.txt et cetera
    var messenger = Components.classes[";1"].
    messenger.saveAttachmentToFile(file, attachment.url, msgURI,
      attachment.contentType, new urlListener(file.path));
  }, false /*allowDownload*/);

Reference ... imeMessage ... mimemsg.js ... senger.idl

Starting the LibreOffice Software With Parameters ... Parameters

Return to Thunderbird Features

Who is online

Users browsing this forum: No registered users and 1 guest