Closed Bug 287345 Opened 19 years ago Closed 14 years ago

Can't add attachment using Mac OS X "open -a" command

Categories

(Thunderbird :: OS Integration, defect, P1)

All
macOS
defect

Tracking

(blocking-thunderbird3.1 -, thunderbird3.1 wontfix)

RESOLVED FIXED
Thunderbird 3.3a1
Tracking Status
blocking-thunderbird3.1 --- -
thunderbird3.1 --- wontfix

People

(Reporter: alqahira, Assigned: humph)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 1 obsolete file)

When attempting to create an attachment using "open -a Thunderbird
filename.ext", Thunderbird fails to a create a message with attachment and
instead opens a window with an XML parsing error.

The open -a command is commonly used on Mac OS X for automated attachments (e.g.
OpenOffice.org "Email document" integration) and works correctly in other common
Mac mail clients like Mail and Eudora.
Forgot to mention this was with Tb 1.0.2, Mac OS X 10.3.7 (the latest nightly
doesn't even launch on my Mac)
Perhaps fixing this bug would make it easier to add attachments from other programs including Finder.
I can confirm this bug remains in Thunderbird version 1.5 (20051201).
Hi!

I'm just installing a bunch of new machines, and without the ability to use "mail as attachement" in NeoOffice the only option left seem to be trashing Thunderbird and using Mail.app instead. 

So I think this bug should be labeled as major. 

Jona
(In reply to comment #4)
> So I think this bug should be labeled as major. 

I agree.

By the way, I just tried this on Mac OS X 10.4.6 (PPC) with Thunderbird 1.5.0.2
and the attachment is not added, but I do not get a XML parsing error window either.
Problem still exists with 1.5.0.7.  Compose window opens, but no attachment is included.
confirmed error still exists
- mac osx 10.4.8 (all updates up to 11/30/06)
- thunderbird version 2 beta 1 (20061129)

command:

"open -a Thunderbird ~/Desktop/test.jpg"

new message opens, no errors...but no attachment. if this can be fixed, i can get at least one company with 200 users moved over to thunderbird.

don

don montalvo, nyc
curmudgeon at large
QA Contact: general
Phil explained to me on irc one day that this was related to broken command-line handlers in TB on Mac OS X (or something to that effect).
Version: 1.0 → Trunk
The broken Toolkit commandline handling just adds a little bit to the fun: to fix this, you have to write a commandline handler that will catch bare files on the commandline, sniff them (since they might be local RSS feeds, or saved email, or potential attachments) and dispatch them, but if the app is already running Toolkit just turns the commandline into window.arguments for the value of the browser.chromeURL pref, which is the compose window's URL to handle mailto:, so you also have to write a handler for it that can tell a file from a mailto or an nsMsgComposeParam block, and for bonus points do the sniffing and handle feeds.
wow... no way to fix this still??
Could you fix this ASAP? Hopefully this is fixed in upcoming TB 3.0?

-Esa
Assignee: mscott → nobody
Flags: wanted-thunderbird3+
marking p1, b2 (since any later would be scary).
Priority: -- → P1
Target Milestone: --- → Thunderbird 3.0b2
I have just moved from a PC to a Mac with OS X and assumed that all would be OK as I just transferred all my Thunderbird system across to the Mac. All OK apart from this problem which is a real pain. I didn't realise how much I used the "send to" facility from various applications.
I am considering moving away from TB to something that works on the Mac. Anyone know when this bug may be fixed? If it's imminent I will hold on
Come on guys and girls this would be a huge intergration function that is needed in Thunderbird.  Perhaps a new bug needs to be placed for a newer version as maybe this one has become forgotten?
I have to say this is causing me problems to the point that I am currently thinking about giving up and moving to MAC mail. Not as flexible but is does give an integrated environment
Keywords: helpwanted
Target Milestone: Thunderbird 3.0b1 → Thunderbird 3.0b2
I don't mean to be impatient, but come on... nearly four and a half years since this bug was submitted?  (Submitted March 2005 and now rapidly approaching October 2009)   Mozilli is looking silly.  Guess I'll just have to give Mac Mail a second look.
Assignee: nobody → david.humphrey
Status: NEW → ASSIGNED
Keywords: helpwanted
This works when the app is running, but I'm not in the right code path for startup.  Sid, can you look at this and comment based on your refactoring of this cmdline handling code?
Attachment #402115 - Flags: review?(sid.bugzilla)
Attached patch patch v2Splinter Review
This fix is good for every case except the startup case, but after exploring this, I'm convinced it's not related to this bug or fix--we simply lose startup args.  I've filed bug 518354 to address this.

Not sure who will have time to review this first, so rolling the dice.
Attachment #402115 - Attachment is obsolete: true
Attachment #402362 - Flags: review?(philringnalda)
Attachment #402362 - Flags: review?(bugzilla)
Attachment #402115 - Flags: review?(sid.bugzilla)
Target Milestone: Thunderbird 3.0b2 → Thunderbird 3.0rc1
i'd like this on the 3.1 radar
Flags: blocking-thunderbird3.1?
Comment on attachment 402362 [details] [diff] [review]
patch v2

I'm looking at this and wondering what is the best way to review it.

As we're not doing the startup case, would it actually be possible to write something for mozmill such that we could pass commands out to the system and watch for the expected results?

In the first instance, a few test command lines would certainly help though.
Adding my voice to this as well - especially related to Bug 352254 (which it may or may not fix) i.e. lack of ability to open a mail means that iPhoto can't drive Thunderbird, only Apple's mail application.
Realistically I'm not going to have time to work on this again for a while.  If someone else wants to work on getting tests in for this patch, and the bugs surrounding command-line/startup, I'd be grateful.
Assignee: david.humphrey → nobody
Status: ASSIGNED → NEW
Comment on attachment 402362 [details] [diff] [review]
patch v2

When it does come around to reviewing time, I have high hopes that Standard8 will feel confident about doing it, since I certainly don't.
Attachment #402362 - Flags: review?(philringnalda)
(In reply to comment #20)
> As we're not doing the startup case, would it actually be possible to write
> something for mozmill such that we could pass commands out to the system and
> watch for the expected results?

This sounds doable using nsIProcess or nsILocalHandlerApp and some OS specific-code.  If the latter route makes more sense, some of the code could probably be borrowed from <http://mxr.mozilla.org/mozilla-central/source/uriloader/exthandler/tests/mochitest/handlerApps.js>.
blocking-thunderbird3.1: --- → -
Flags: blocking-thunderbird3.1? → wanted-thunderbird+
Forgot to note that while I really really want this for Tb3.1, if it were the last bug standing, we wouldn't block on it, so blocking- has been set, but on the up side, wanted-thunderbird+ has as well.
I have the same problem.....FIX IT!!!
(In reply to comment #26)
> I have the same problem.....FIX IT!!!

This is not helpful in any way, and does not belong in Bugzilla.
I wonder why Firefox on Mac can use Thunderbird for sending links. It starts the client (with compose window) if it isn't already running. Always opening the compose window with subject and body filled correctly. So it seems, the primary command line functionality is there. Or is this because Firefox launches TB via URL? 

The best open source browser works with TB, but the best (open source) office app doesn't. I don't understand why. And because the integration between Firefox, OpenOffice and TB works as expected on Windows and Linux, but not on Mac OS X. There are really so much difference?
The Firefox/TB behavior is consistent with this bug, i.e. it is possible to run TB from the command line, but not possible to add an attachment.
Platform says: PowerPC Mac OS X 
I am experiencing the same problem in Intel Mac OS X (10.6.3)
Maybe this field should be modified, as more and more (and now most) Macs are Intel-based?
Yes, it is independent of the mac's processor architecture. All versions of OS X and ever hardware plattform is affected.
Component: General → OS Integration
QA Contact: general → os-integration
Hardware: PowerPC → All
I can confim that applying patch v2 to my installation of Thunderbird 3.1 on OSX 10.6.4 and then restarting Thunderbird fixes the problem nicely.

Excellent, thanks. I'd like to encourage committer to get this into the source tree ASAP. This one fix allows us to implement 'email to PDF' hacks for the OSX print dialog, a major step forward in usability.


Ari
As a followup to David Humphrey's patch and my testing, I've tried to do something like this on OSX:

open -a /Applications/Thunderbird.app ~/test.txt --args "to=me@isp.net"
open -a /Applications/Thunderbird.app ~/test.txt --args "-compose to=me@isp.net"

Neither of these things were successful in letting me set the to, body or other fields which the Thunderbird API should allow us to set ( https://developer.mozilla.org/en/Command_Line_Options#Syntax_Rules )

I poked around the javascript but couldn't see the answer. There is this elsewhere:

  remoteParams.shift();
  argstring.data = remoteParams.join(",");
  wwatch.openWindow(null, "chrome://messenger/content/messengercompose/messengercompose.xul", "_blank","chrome,dialog=no,all", argstring);

But I don't know enough about the API to see how this could be applied to our use case.

Could someone please move this task status from NEW to CONFIRMED and then PATCH AVAILABLE?
I've also applied the patch to TB3.  I make it work by writing to a .eml file, then using open, then hitting cmd-E to edit / compose the file.

I noticed the same as Ari during my initial experiments.  It wasn't clear to me how to combine arguments into one compose window.  It's great that I can finally use iCal with TB, for instance, but the situation can still be improved upon.  If I could, I would.  Thanks, David Humphrey.
I've attached a file which can be opened with AppleScript Editor, saved as an "application" and then placed in /Library/PDF Services/Mail PDF to Thunderbird.app

Once you do that, and with David's patch, you can email PDF through Thunderbird from any application in OSX.

I'd like to see my applescript idea actually embedded inside the Thunderbird.app itself. Then we can simply put an alias to /Applications/Thunderbird.app inside the /Library/PDF Services/ folder and we are all done. I see other applications (like ShoveBox) which do exactly that.
Attachment #455611 - Flags: feedback+
I've just done some testing on this, and it seems to work fine.

The specific cases I tested on Mac were:

open -a <app location> mailto:test@test.invalid
open -a <app location> <text filename>
open -a <app location> <eml filename>

These all seem to work fine. As items like feeds and other file types are handled before this, I think this will work fine.
Flags: in-litmus?(ludovic)
Comment on attachment 402362 [details] [diff] [review]
patch v2

r=Standard8. Sorry for the huge delay in getting to this.
Attachment #402362 - Flags: review?(bugzilla) → review+
Assignee: nobody → david.humphrey
Keywords: checkin-needed
Target Milestone: Thunderbird 3.0rc1 → Thunderbird 3.3a1
13617
13618
13619
Flags: in-litmus?(ludovic) → in-litmus+
Wow, this is nice, because it works if TB is not running and if TB is still running. The other command line arguments I used normally only worked if TB is not running.

(In reply to comment #34)
> As a followup to David Humphrey's patch and my testing, I've tried to do
> something like this on OSX:
> 
> open -a /Applications/Thunderbird.app ~/test.txt --args "to=me@isp.net"
> open -a /Applications/Thunderbird.app ~/test.txt --args "-compose
> to=me@isp.net"

Yes, I've also tried a few variants. If I do:
$ open -a /Applications/Thunderbird.app /test.rtf 
than I get a compose window with the attached file. And if I do
$ open -a /Applications/Thunderbird.app mailto:me@isp.net?subject=Hi
than I get a compose window with the email address and with the subject. But both together doesn't work. E.g. if I do:
$ open -a /Applications/Thunderbird.app /test.rtf mailto:me@isp.net?subject=Hi
than I get two compose windows. Hmmm.

(In reply to comment #36)
> Created attachment 455611 [details]
> Send PDF to Thunderbird from OSX print menu
> 
> I've attached a file which can be opened with AppleScript Editor, saved as an
> "application" and then placed in /Library/PDF Services/Mail PDF to
> Thunderbird.app
I've tried that, but sadly it doesn't work for me. If I save this as an application, than I do not see it in the PDF menu. If I save it as a Script, than I see it in the PDF menu, but it doesn't do anything if I click on it.

My dream would be a Contextual Menu Item, so you can attach every file from the Finder with a simple  right-click to a TB compose window. It is possible to build easily Contextual Menu Items with OnMyCommand.
(In reply to comment #40)
> But
> both together doesn't work. E.g. if I do:
> $ open -a /Applications/Thunderbird.app /test.rtf mailto:me@isp.net?subject=Hi
> than I get two compose windows. Hmmm.

That's probably because Thunderbird is treating these as two separate arguments - which is what they are. One is to attach the file, the other is to do a mailto.

I'm not sure if you can define an attachment in the mailto uri, but you can do it via the compose argument:

http://kb.mozillazine.org/Command_line_arguments_-_Thunderbird

> 
> (In reply to comment #36)
> > Created attachment 455611 [details] [details]
> > Send PDF to Thunderbird from OSX print menu
> > 
> > I've attached a file which can be opened with AppleScript Editor, saved as an
> > "application" and then placed in /Library/PDF Services/Mail PDF to
> > Thunderbird.app
> I've tried that, but sadly it doesn't work for me. If I save this as an
> application, than I do not see it in the PDF menu. If I save it as a Script,
> than I see it in the PDF menu, but it doesn't do anything if I click on it.

We should split these out to a separate bug(s).
(In reply to comment #41)
> That's probably because Thunderbird is treating these as two separate arguments
> - which is what they are. One is to attach the file, the other is to do a
> mailto.
> 
> I'm not sure if you can define an attachment in the mailto uri, but you can do
> it via the compose argument:
> 
> http://kb.mozillazine.org/Command_line_arguments_-_Thunderbird

Yes, via the compose argument it is the normal way I do this. But this does not work if TB is still running (Bug 469990), same for -remote or -edit (Bug 472891). "open -a" works whether or not TB is running. So thats a big advantage for "open -a".


(In reply to comment #41)
> We should split these out to a separate bug(s).
OK.
I'm not sure what versions its fixed in - but i notice that the original bug refered to integration with other apps not just the command line - for example I notice that MS Word doesn't recognise it (File / SendTo has email greyed out on machine). Is there another step needed in order to get apps to recognise TB as a valid mail program that can be called. 


FWIW: i'm running Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12pre) Gecko/20101001 Lanikai/3.1.5pre
Checked in to trunk: http://hg.mozilla.org/comm-central/rev/fcc4448dc5dd

Please file remaining issues/scripts etc in follow-up bugs.
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Blocks: 606918
Add Bug 606919 with my Applescript from this bug for further review.
Blocks: 606919
Depends on: 612023
As notoed, this apparently has not been fixed or resolved. Specifically, by way of example, from LibreOffice on SNowLeopard with TB set as default invocation of the sendmail option for Thunderbird 3.6 results either in Thunderbird coming forward but no envelope, or if one invokes thr binry, an error message indicating that TB is already running. This is the same behavior as in 469990 and the results are the same for Intel as was for PowerPC arch.

The thread is a bit scattered at this point (and perhaps a bit stale) and it would be helpful if Humph could provide some clarification as to what has been fixed versus what has not been fixed, whether we need to create yet a new item to address this bug or add it to 469990 (though it looks like 469990 has not been addressed at all)

Additionally, it is unclear whether the known issues with being unable to send files from Acrobat are part and parcel of this issue or not.
Sorry, posted before I was done....
Using 
$open -a /Applications/Thunderbird.app 
has behavior similar to that seen when the package is called (the current TB window comes forward),  adding mailto does bring up an envelope correctly, but referencing a file results in no new envelope.....
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: