Discussion of features in Mozilla Thunderbird
Qwar
New Member
Posts: 1Joined: October 15th, 2017, 2:03 am
Posted October 15th, 2017, 2:08 am
Hi,
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..
Thanks
DanRaisch
Moderator

Posts: 122241Joined: September 23rd, 2004, 8:57 pmLocation: Somewhere on the right coast
Posted October 15th, 2017, 5:26 am
Have you tried setting Thunderbird to display attachments inline? Menu path View->Display Attachments Inline.
tanstaafl
Moderator

Posts: 45895Joined: July 30th, 2003, 5:06 pm
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. https://addons.mozilla.org/en-US/thunde ... la/?src=ss
morat
Posts: 3492Joined: February 3rd, 2009, 6:29 pm
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["@mozilla.org/file/local;1"]. createInstance(Components.interfaces.nsILocalFile); var process = Components.classes["@mozilla.org/process/util;1"]. createInstance(Components.interfaces.nsIProcess); var args = ["-norestore", "-nofirststartwizard", "-nologo", "-headless", "-p", aPath]; localFile.initWithPath("C:\\Program Files\\LibreOffice 3.5" + "\\program\\soffice.exe"); process.init(localFile); process.run(false, 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["@mozilla.org/file/directory_service;1"]. getService(Components.interfaces.nsIProperties). get("TmpD", Components.interfaces.nsIFile); // temporary folder file.append(attachment.name); file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 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["@mozilla.org/messenger;1"]. createInstance(Components.interfaces.nsIMessenger); messenger.saveAttachmentToFile(file, attachment.url, msgURI, attachment.contentType, new urlListener(file.path)); }, false /*allowDownload*/); }
Reference https://dxr.mozilla.org/comm-release/se ... imeMessagehttps://dxr.mozilla.org/comm-release/so ... mimemsg.jshttps://dxr.mozilla.org/comm-release/so ... senger.idlStarting the LibreOffice Software With Parameters http://help.libreoffice.org/Common/Star ... Parameters
Return to Thunderbird Features
Who is online
Users browsing this forum: No registered users and 0 guests
|