Open .eml saved file passed from command line in MailNews instead of a browser window

RESOLVED DUPLICATE of bug 707631

Status

SeaMonkey
MailNews: Message Display
--
enhancement
RESOLVED DUPLICATE of bug 707631
8 years ago
6 years ago

People

(Reporter: FranceC, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.1.9) Gecko/20100317 SeaMonkey/2.0.4

Is it possible to open .eml file directly in Composer? When I double-click an .eml always browser is opened, or an empty composer. Otherwise if i open composer, then File->OpenFile .eml file, this works ok.
I tried theese commands:
seamonkey -mail "%1"
seamonkey.exe -compose "%1"
seamonkey.exe -osint  -compose "%1"
seamonkey -chrome chrome://messenger/content/messageWindow.xul  test.eml
seamonkey -remote "openURL(test.eml, message-window)"

Reproducible: Always

Steps to Reproduce:
1.save an email
2.double-click on .eml file
3.
Actual Results:  
only the browser is opened

Expected Results:  
I would like to open the composer that load .eml file like in Reply

I tried theese commands:
seamonkey -mail "%1"
seamonkey.exe -compose "%1"
seamonkey.exe -osint  -compose "%1"
seamonkey -chrome chrome://messenger/content/messageWindow.xul  test.eml
seamonkey -remote "openURL(test.eml, message-window)"
No ones works ok. Is it my faults or (I think) is this a bug, Isn't it?

Updated

8 years ago
Severity: normal → enhancement
Component: Composer → MailNews: Composition
QA Contact: composer → mailnews-composition
I would say an .eml file is only to be opened for viewing by default, suggesting WONTFIX.
Whiteboard: [CLOSEME INVA/WONT?]

Comment 2

7 years ago
Yes, being opened for viewing is right. But the expected behaviour is the use of the mail client, because it is a mail and not a website. Viewing the mail with the browser doesn't allow you to use the basic mail client features like forward, replay, adding to the addressbook and so forth.

When using Thunderbird and Firefox instead of the SeaMonkey suite, Firefox is processing the EML-Files.

This is definitely a bug that's needed to be fixed, not only an enhancement, because the software doesn't fulfill the expectations.

For my own purpose, I've written an extension that emulates the behaviour "File -> Open File" and is triggered by a command line switch "-openmail". Then, in the registry, "HKEY_CLASSES_ROOT\SeaMonkeyEML\shell\open\command" has to be changed. Unfortunately, SeaMonkey then recognizes the change and asks to set SeaMonkey Mail as default application.

I'm posting a patch soon.

Comment 3

7 years ago
Created attachment 549359 [details] [diff] [review]
Integrated the switch -openmail to seamonkey, so .eml-Files are opened directly with SeaMonkey Mail

I don't know if I can simply change the component ID of the altered handler. I didn't. Therefore, the users have to remove compreg.dat from their profile folders.

Don't know what to do with that "Flags" in this form ... (my first bug / patch)

Comment 4

7 years ago
The bug is in the wrong component section. It has to be in "MailNews: Message Display".

And platform should be Windows in general.
(In reply to comment #3)
> Created attachment 549359 [details] [diff] [review] [diff] [details] [review]
> Integrated the switch -openmail to seamonkey, so .eml-Files are opened
> directly with SeaMonkey Mail

Actually, since you are editing a file under /mailnews, the change applies to Thunderbird as well. That means you need request review from a TB reviewer, e.g. bienvenu or Standard8 (if they are not the right ones they'll find a better suited one for you). Just set the "review" flag to "?", enter a name and choose someone from the autocompletion.

Note that the indentation style in the file you are modifying is two spaces.

> I don't know if I can simply change the component ID of the altered handler.
> I didn't.

That is a question you need to ask the reviewer(s).
Component: MailNews: Composition → Backend
OS: Windows XP → All
Product: SeaMonkey → MailNews Core
QA Contact: mailnews-composition → backend
Hardware: x86 → All
Whiteboard: [CLOSEME INVA/WONT?]
Version: unspecified → Trunk
Didn't find a better component under MailNews Core.

Changed platform to All since the new command line switch will not be limited to Windows.

Updated

7 years ago
Attachment #549359 - Flags: review?(mbanner)
Attachment #549359 - Flags: review?(dbienvenu)
Comment on attachment 549359 [details] [diff] [review]
Integrated the switch -openmail to seamonkey, so .eml-Files are opened directly with SeaMonkey Mail

This doesn't seem right. Thunderbird, and hence mailnews already knows how to open an eml file from the command line via the -mail option, or just by passing the file name itself. You shouldn't need to add another command line argument to do that.

If SeaMonkey is getting it wrong and opening it in the browser instead, then my bet would be that something in SeaMonkey is set up wrong.
Attachment #549359 - Flags: review?(mbanner)
Attachment #549359 - Flags: review?(dbienvenu)
Attachment #549359 - Flags: feedback-
Component: Backend → MailNews: Message Display
Product: MailNews Core → SeaMonkey
QA Contact: backend → message-display
Mark is right, it's an SM-only issue. Moving back.
With the pref browser.dom.window.dump.enabled set to true you'll see that if you just pass an *.eml file from the command line, you'll get "Unrecognized URL: /path/to/your.eml" on the command line. This relates to:

http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMailNewsCommandLineHandler.js#125

IOW, nsMailNewsCommandLineHandler.js is not the one that handles this!

Instead, it's the application's handler, i.e. mail/components/nsMailDefaultHandler.js for TB and suite/browser/nsBrowserContentHandler.js for SM. You'll see that TB has code handling the EML case while SM doesn't. SM probably runs into a fallback that eventually leads to opening a browser tab. To fix this bug, the handling needs to be ported from TB.

Confirming (this can be reproduced reliably in SM and not at all in TB) and adjusting summary.

For starters, have a look at this:
http://mxr.mozilla.org/comm-central/source/mail/components/nsMailDefaultHandler.js#370
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Open .eml saved file in composer → Open .eml saved file passed from command line in MailNews instead of a browser window

Comment 10

7 years ago
Wasn't available the last weeks. Will try your suggestions.

Comment 11

7 years ago
http://mxr.mozilla.org/comm-central/source/mail/components/nsMailDefaultHandler.js#370

Thunderbird is relying on the file's extension? So when configuring my Windows to open all file's with the suffix ".eml2" with Thunderbird, it won't behave like opening file's with the suffix ".eml"?

Sounds strange.

Comment 12

7 years ago
Created attachment 552871 [details] [diff] [review]
Integrated the switch -openmail to seamonkey, so .eml-Files are opened directly with SeaMonkey Mail

Still didn't touched the component ID, so the user has to remove its compreg.dat
Attachment #549359 - Attachment is obsolete: true
Attachment #552871 - Flags: feedback?(mbanner)
Attachment #552871 - Flags: feedback?(jh)

Comment 13

7 years ago
the eml file might be passed via the -file switch. the raw eml file might also be passed directly to the application e.g. seamonkey /path/to/file.eml.

Thunderbird takes care of both situations and doesn't invent a new switch -openmail. Also what about the Gnome and Mac shell services?
Comment on attachment 552871 [details] [diff] [review]
Integrated the switch -openmail to seamonkey, so .eml-Files are opened directly with SeaMonkey Mail

Like Philip said, the expected behavior is that it "just works", i.e. that you provide a file on the command line without any extra switch. Furthermore this should be done in a way that is compatible with TB, i.e. if it also works using -file for them, it should also do for us. The point is that SM should work as a replacement for TB regarding basic command line switches and not invent extra switches that provide no additional benefit.
Attachment #552871 - Flags: feedback?(jh) → feedback-

Comment 15

7 years ago
You can't compare SM and Thunderbird this way. When I open a file with TB, it knows that the file has to be opened with TB. When doing the same with SM, SM can't know if the file should be opened with the Mail or the Browser component. 

Nevetheless, I think TB's current behaviour is wrong. Relying on the file's extension is not useful. I've just tried to register the extension .eml2 with TB: The file is appended as an attachment instead of opnening like an EML.

Therefore: Thunderbird itself needs the switch "-openmail", too.

Comment 16

7 years ago
What relevant standard specifies "eml2" as a file extension? Google cannot find any use of the "eml2" file extension.
<http://en.wikipedia.org/wiki/Email#Filename_extensions>

> Therefore: Thunderbird itself needs the switch "-openmail", too.
Please implement this for Thunderbird first. Then we shall consider if we want this for SeaMonkey. Until then -openmail is a non-starter.
Comment on attachment 552871 [details] [diff] [review]
Integrated the switch -openmail to seamonkey, so .eml-Files are opened directly with SeaMonkey Mail

Sorry, but I just don't understand/see the benefits of this, or why someone would really need a .eml2 which isn't standard - if you want to do that, you could do it via an extension if it is non standard.
Attachment #552871 - Flags: feedback?(mbanner) → feedback-

Comment 18

6 years ago
Opening .eml files from the commandline (like, eg., by double clicking) should just open a (standalone?) message window, not the composer.
Fixing this should not include adding arbitrary new commandline switches.

Duping this against a more-to-the-point bug.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 707631
You need to log in before you can comment on or make changes to this bug.