Closed Bug 1402550 Opened 8 years ago Closed 1 year ago

File > Save As > File fails on .EML message opened from file system.

Categories

(Thunderbird :: Mail Window Front End, defect)

defect

Tracking

(thunderbird_esr115 wontfix, thunderbird_esr128? fixed, thunderbird131 fixed)

RESOLVED FIXED
132 Branch
Tracking Status
thunderbird_esr115 --- wontfix
thunderbird_esr128 ? fixed
thunderbird131 --- fixed

People

(Reporter: unicorn.consulting, Assigned: welpy-cw)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
This is something I thought their should be a bug for. But I can not find it so am filing this one. To reproduce Open an previously saved EML file. Save as is non functional for that occasion. The save as dialog does not even open.
Summary: File save as is non functional when the email being read is an → File save as is non functional when the email being read is anEML file
I can confirm this on Windows Trunk build. Error Console shows two Errors: | NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageService.messageURIToMsgHdr] mailCommands.js:395 | SaveAsFile chrome://messenger/content/mailCommands.js:395:18 | MsgSaveAsFile chrome://messenger/content/mailWindowOverlay.js:2149:3 | doCommand chrome://messenger/content/messageWindow.js:1194:9 | goDoCommand chrome://global/content/globalOverlay.js:93:7 | oncommand chrome://messenger/content/messageWindow.xul:1:1 | An error occurred executing the cmd_saveAsFile command: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMessageService.messageURIToMsgHdr]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://messenger/content/mailCommands.js :: SaveAsFile :: line 395" data: no] globalOverlay.js:95 | goDoCommand chrome://global/content/globalOverlay.js:95:5 | oncommand chrome://messenger/content/messageWindow.xul:1:1
Here is a short Call Stack: | xul.dll!nsParseLocalMessageURI(const char * uri, nsTString<char> & folderURI, unsigned int * key) Line 191 C++ Symbols loaded. | xul.dll!nsMailboxService::DecomposeMailboxURI(const char * aMessageURI, nsIMsgFolder * * aFolder, unsigned int * aMsgKey) Line 641 C++ Symbols loaded. | xul.dll!nsMailboxService::MessageURIToMsgHdr(const char * uri, nsIMsgDBHdr * * _retval) Line 668 C++ Symbols loaded. | xul.dll!XPTC__InvokebyIndex() Line 99 Unknown Symbols loaded. | xul.dll!NS_InvokeByIndex(nsISupports * that, unsigned int methodIndex, unsigned int paramCount, nsXPTCVariant * params) Line 58 C++ Symbols loaded. | xul.dll!CallMethodHelper::Invoke() Line 1997 C++ Symbols loaded. | xul.dll!CallMethodHelper::Call() Line 1315 C++ Symbols loaded. | xul.dll!XPCWrappedNative::CallMethod(XPCCallContext & ccx, XPCWrappedNative::CallMode mode) Line 1282 C++ Symbols loaded. | xul.dll!XPC_WN_CallMethod(JSContext * cx, unsigned int argc, JS::Value * vp) Line 929 C++ Symbols loaded. | xul.dll!js::CallJSNative(JSContext * cx, bool(*)(JSContext *, unsigned int, JS::Value *) native, const JS::CallArgs & args) Line 293 C++ Symbols loaded. The value of uri in nsParseLocalMessageURI(const char * uri ...) is "file:///C:/temp/CR_test.eml?type=application/x-message-display" But: | /* parses LocalMessageURI | * mailbox-message://folder1/folder2#123?header=none or | * mailbox-message://folder1/folder2#1234&part=1.2 <https://dxr.mozilla.org/comm-central/rev/b0580e39dcb50170b8ef04f7d4cc3b0d2de72d82/mailnews/local/src/nsLocalUtils.cpp#190> nsParseLocalMessageURI() searches for an '#' and if it isn't found, returns with NS_ERROR_FAILURE So nsParseLocalMessageURI() is the wrong function for a 'file:'-URI.
You mean: File > Save As, File, right? That doesn't work in TB 52 either, so nothing that went broken recently. IHMO it's not the most important feature, why are you saving a message you opened from disk in the first place? That said, of course it would be good to get this fixed, any volunteers?
Yes Jorg, I mean File > Save as > file. Crtl+S and the app menu as well. BTW I filed the bug as an offshoot of a SUMO support request. It is not an action I have ever done, but I would guess the poster was using the file conversions offered by the save as option from EML to HTML or TXT.

Hello,
this bug is still alive and it's quite critical in an business environment. If I save somewhere an email, I need to open and save somewhere else or with a different name.
Some time eml files are stored by other apps like ERP, CRM and so on, so you can't know the full path, you can only open stored files and then the only way to save somewhere else is using "save as". If "save as" doesn't work, you can't do anything to the file.

Flags: needinfo?(jorgk)
Attached patch 1402550-wip.patch (obsolete) — Splinter Review

Here's a hack attempt based on Alfred's analysis in comment #2. All I can say is that the saving pipeline is geared towards saving from a message in a folder, not a stand-alone file.

This patch gets us a little further, but now it fails on:
https://searchfox.org/comm-central/rev/266e9cc242cd0de076e85eb4aa0b8392fcb2ca01/mailnews/local/src/nsMailboxProtocol.cpp#184
I guess it might fail on getting the "folder" for the file.

It will take more convincing to get the file through the mailbox funnel.

Flags: needinfo?(jorgk)

I was thinking: Possibly best to just copy the file with 10-15 lines of code instead of trying to press it though the mailbox funnel. As I said, the code tries to find a folder for it and there isn't one.

Hi All,

It's great to note that this issue is already reported and a resolution is on going

I have a similiar use scenario as angerangel.
We have a situation where our e-mail communication is archived into project related folders which serves as an easy access
to all related information in one place and also easier to back up important data.amd
In our case multiple users save/export their e-mails (with attachments) as *.eml files .
At a later stage these e-mails(eml files) are sorted and renamed and stored into folders.

The thing is that this functionality has always worked on Outlook Express which we were using on an XP machine.
For all our routine e-mail we have switched to Thunderbird a long time ago.

For the single purpose of saving emails as described above we are forced to keep the old XP PC and use Outlook Express.
We have noticed this issue with Thunderbird and have been living with it
Now that PC has started giving us problems and looks like packing up any day now.

It would be great if we can use Thunderbird for this.

For me the issue exists on Thunderbird 68.4.1 (64-bit) running on Ubuntu 18.04 LTS
as well as Thunderbird 38.5.1 on Windows 7

OS: Unspecified → All
Hardware: Unspecified → All
Summary: File save as is non functional when the email being read is anEML file → File > Save As > File fails on .EML message opened from file system. nsIMsgMessageService.messageURIToMsgHdr error in globalOverlay.js (no folder)
See Also: → 1708736
Severity: normal → S3
See Also: → 927640
Blocks: 927640
  • Fix cmd_saveAsFile for .eml files that have just been opened from the file system.
  • Disable cmd_saveAsTemplate when such a message is displayed.
  • When an attached .eml file is opened, try to preserve the filename in the URI (see bug 927640)

Based on https://github.com/Betterbird/thunderbird-patches/blob/main/128/bugs/927640-1402550-fix-saving-eml.patch, which is itself based on SeaMonkey code.

Assignee: nobody → h.w.forms
Status: NEW → ASSIGNED
Attachment #9097033 - Attachment is obsolete: true
Summary: File > Save As > File fails on .EML message opened from file system. nsIMsgMessageService.messageURIToMsgHdr error in globalOverlay.js (no folder) → File > Save As > File fails on .EML message opened from file system.
Target Milestone: --- → 132 Branch

Pushed by benc@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/bfbca89854c6
Enable saving an .eml file directly. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Duplicate of this bug: 927640

Comment on attachment 9421842 [details]
Bug 1402550 - Enable saving an .eml file directly. r=mkmelin

[Approval Request Comment]
User impact if declined: See bug description
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): very low

Attachment #9421842 - Flags: approval-comm-beta?

Comment on attachment 9421842 [details]
Bug 1402550 - Enable saving an .eml file directly. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9421842 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9421842 [details]
Bug 1402550 - Enable saving an .eml file directly. r=mkmelin

[Approval Request Comment]
User impact if declined: it would be not possible to save an .eml that has just been opened
Testing completed (on c-c, etc.): c-c and beta
Risk to taking this patch (and alternatives if risky): low

Attachment #9421842 - Flags: approval-comm-esr128?

Comment on attachment 9421842 [details]
Bug 1402550 - Enable saving an .eml file directly. r=mkmelin

[Triage Comment]
Approved for esr128

Attachment #9421842 - Flags: approval-comm-esr128? → approval-comm-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: