Support opening a message from the command line

RESOLVED FIXED

Status

Thunderbird
General
RESOLVED FIXED
10 years ago
4 years ago

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

10 years ago
We should be able to open a message from the command line. The command line should be something like:

thunderbird -mail mailbox-message://user@host/<folder>#msgkey

or

thunderbird -mail mailbox-message://user@host/<folder>?messageId=<message id>
(Assignee)

Comment 1

10 years ago
Created attachment 270982 [details] [diff] [review]
work in progress

This basically works, though there are some potential refinements, like handling escape of the message id...
(Assignee)

Comment 2

10 years ago
And perhaps we should have case-insensitive parsing of "messageId", and perhaps have a pref for whether we open the new message in a stand-alone window, or in the  3-pane ui.

Comment 3

10 years ago
Bug 11076 should be at least partly dupe...
(Assignee)

Comment 4

10 years ago
Created attachment 271112 [details] [diff] [review]
proposed fix

I'd like to land this on the trunk so developers can try it out...
Attachment #271112 - Flags: superreview?(mscott)
(Assignee)

Comment 5

10 years ago
We may also want to make it so messages open in a new tab, though I don't know how we're going to communicate that from nsMessengerBootstap.cpp to msgMail3PaneWindow.js. Some extra param in the array that gets passed to it, I guess.

Comment 6

10 years ago
Comment on attachment 271112 [details] [diff] [review]
proposed fix

ditch the braces here ? 

+        else
+        {
+          GetMsgDBHdrFromURI(nativeArg.get(), getter_AddRefs(msgHdr));
+        }
Attachment #271112 - Flags: superreview?(mscott) → superreview+
(Assignee)

Comment 7

10 years ago
fixed on trunk.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 8

10 years ago
Thanks, I'll take a look at it.

Comment 9

10 years ago
Comment on attachment 271112 [details] [diff] [review]
proposed fix

>+        if (queryIndex > 0)
>+        {
>+          nsCString messageId, folderUri;
>+          nativeArg.Right(messageId, nativeArg.Length() - queryIndex - 11);
>+          nativeArg.Left(folderUri, queryIndex);
>+          folderUri.Cut(folderUri.Find("-message"), 8);
>+          return OpenMessengerWindowForMessageId(folderUri, messageId);
>+        }
>+        else
>+        {
>+          GetMsgDBHdrFromURI(nativeArg.get(), getter_AddRefs(msgHdr));
>+        }
Nit: unnecessary else after return

Comment 10

5 years ago
Related to this bug:  what is the correct URL format for thunderbird and openURL?  

Another question, in the regular scheme should special characters be an issue.  I get an error if a I use -mail to open a message with the following messageId: 
057301cdc814$7d689740$7839c5c0$@rice.edu

The error is illegal value.  If I change the dollar symbols to %24, I still get an error.

Comment 11

4 years ago
I tried to use it with

thunderbird.exe -console -mail mailbox-message://user@host/<folder>?messageId=<message id>

but in the console there's this error:

Unrecognized URL: mailbox-message://user@host/<folder>?messageId=<message id>


(The "Thunderbird console" shows up only if started with first instance of Thunderbird)
You need to log in before you can comment on or make changes to this bug.