--- MsgComposeCommands.js.orig 2008-03-01 06:30:38.000000000 +0100 +++ MsgComposeCommands.js 2009-04-01 10:11:27.000000000 +0200 @@ -1253,10 +1253,23 @@ { var attachmentList = args.attachment.split(","); var attachment; + var localFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); + var ioService = Components.classes["@mozilla.org/network/io-service;1"] + ioService = ioService.getService(Components.interfaces.nsIIOService); + var fileHandler = ioService.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler); for (var i = 0; i < attachmentList.length; i ++) { + var attachmentStr = attachmentList[i]; attachment = Components.classes["@mozilla.org/messengercompose/attachment;1"].createInstance(Components.interfaces.nsIMsgAttachment); - attachment.url = attachmentList[i]; + if (attachmentStr.substr(0, 7) == "file://") + { + attachment.url = attachmentStr; + } + else + { + localFile.initWithPath(attachmentList[i]); + attachment.url = fileHandler.getURLSpecFromFile(localFile);; + } composeFields.addAttachment(attachment); } }