Open
Bug 376595
Opened 14 years ago
Updated 2 years ago
opened from compose window: attachments show as nsmail*.tmp or nsmail*.exe when forwarding inline
Categories
(Thunderbird :: Mail Window Front End, defect)
Thunderbird
Mail Window Front End
Tracking
(Not tracked)
NEW
People
(Reporter: zary, Unassigned)
References
Details
Attachments
(2 files, 1 obsolete file)
|
19.46 KB,
image/png
|
Details | |
|
1.49 KB,
patch
|
mkmelin
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux; X11) KHTML/3.5.6 (like Gecko) Build Identifier: When a message containing attachments is forwarded (and forwarding is configured as inline), the attachments correctly appear in the new message. But they're stored on disk as nsmail*.tmp files (windows) or even nsmail*.something (linux - looks like thunderbird is attempting to generate the extension according to file contents and gets it wrong sometimes?). This prevents user from opening the attachments. Reproducible: Always Steps to Reproduce: 1. Make sure forwarding is set to inline in preferences->composition->general 2. Click on any message containing an attachment and click forward 3. Double-click the attachment in the attachment window Actual Results: nsmail.tmp filename (windows) so it cannot be opened Expected Results: original filename or at least a generated filename with original extension
Comment 1•14 years ago
|
||
WFM on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.4pre) Gecko/20070404 Thunderbird/2.0.0.0pre ID:2007040403. Which version are you using? If not a 2.0 rc, try <http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/2.0.0.0-candidates/>
| Reporter | ||
Comment 2•14 years ago
|
||
Tried something more and got a better way to reproduce: 1. Create an unknown file - e.g. file called 1.xyz containing a couple of random characters 2. Create new message in Thunderbird and attach that file 3. Close the message and save it in Drafts folder 4. Reopen the message and doubleclick the attached file. The xyz extension is changed to tmp. Tested in 1.5.0.10 (Linux) and 1.5.0.7 (Windows). 2.0b2 does the same thing. In practice, this problem appeared on Windows with OpenOffice.org installed and .doc attachments.
Comment 3•14 years ago
|
||
Sorry, still WFM.
| Reporter | ||
Comment 4•14 years ago
|
||
Reproduced it right now with Thunderbird 2.0 RC2 under Linux. Created a text file named 1.xyz, attached to new message, stored in imap drafts folder and closed. Then reopened the message and doubleclicked the attachment - and nsmail-1.txt... Note that this happens only after the message is opened in its own window (doubleclicking the attachment in main Thunderbird window works fine).
Comment 5•14 years ago
|
||
Do you have it set up to open automatically with something? I get the Open with dialog...
| Reporter | ||
Comment 6•14 years ago
|
||
A dialog asks me if I want to open the file or save it, with nsmail* filename.
Comment 7•14 years ago
|
||
Ah, yes, I see that. xref/related bug 353847.
Summary: Attachments renamed to nsmail*.tmp or nsmail*.exe when forwarding messages inline → opened from compose window: attachments show as nsmail*.tmp or nsmail*.exe when forwarding inline
Updated•13 years ago
|
Assignee: mscott → nobody
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 9•11 years ago
|
||
I still see this behavior on TB 3.0.6, is there a workaround?? Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6
Comment 12•9 years ago
|
||
This seems to originate from here: http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/mimedrft.cpp#1859 1859 nsCOMPtr <nsIFile> tmpFile = nsnull; 1860 { 1861 // Let's build a temp file with an extension based on the content-type: nsmail.<extension> 1862 1863 nsCAutoString newAttachName ("nsmail");
Comment 13•9 years ago
|
||
Thomas how would you feel about contributing a patch to solve the issue ?
Comment 14•9 years ago
|
||
Still here in TB 15. Why hasn't this been fixed - this bug is 5 years old ! If I knew how to code in c++ I'd have a go myself. Very frustrating when a user wants to check that they are sending the correct attachment. Happy to assist with any testing etc.
Comment 15•8 years ago
|
||
Still here in TB17. The bug is when you forward an email, TB looks at the mime type to name the temporary file. I think it's a mistake. It should let the extension that was in the file name. No need to modify the C++ code. I made a workaround directly in the JS code to correct the problem. I'll attach it if it can be helpfull for someone else...
Comment 16•8 years ago
|
||
Comment 17•8 years ago
|
||
Comment on attachment 742972 [details]
hack for MsgComposeCommands.js file
could you create a patch using the diff command that would be helpfull for having your "fix" reviewed and maybe fix it for everybody.
Comment 18•8 years ago
|
||
Attachment #742972 -
Attachment is obsolete: true
Updated•8 years ago
|
Attachment #743030 -
Flags: review?(mkmelin+mozilla)
Comment 19•8 years ago
|
||
Comment on attachment 743030 [details] [diff] [review] patch to ignore attachments mime type when forwarding. Keep the original extension Review of attachment 743030 [details] [diff] [review]: ----------------------------------------------------------------- I can't reproduce the issue in this bug, using the latest nightly build (on linux). ::: MsgComposeCommands.js @@ +3565,4 @@ > // Don't allow file or mail/news protocol uris to leak out either. > else if (/^file:|^mailbox:|^imap:|^s?news:/i.test(attachment.name)) > attachment.name = getComposeBundle().getString("partAttachmentSafeName"); > + trailing whitescpace, here and in a few other places @@ +3573,5 @@ > + > + if (extFileName != extFileUrl) { > + try { > + let fileHandler = Services.io.getProtocolHandler("file") > + .QueryInterface(Components.interfaces.nsIFileProtocolHandler); wrap this long line @@ +3577,5 @@ > + .QueryInterface(Components.interfaces.nsIFileProtocolHandler); > + let file = fileHandler.getFileFromURLSpec(attachment.url); > + > + if (file.leafName.indexOf(".") != -1) { > + file.moveTo(null, file.leafName.replace(extFileUrl, extFileName)); The move-to target could potentially exist @@ +3578,5 @@ > + let file = fileHandler.getFileFromURLSpec(attachment.url); > + > + if (file.leafName.indexOf(".") != -1) { > + file.moveTo(null, file.leafName.replace(extFileUrl, extFileName)); > + let regexp = new RegExp("\." + extFileUrl + "$", "g"); this won't work if there are any special regexp chars in extFileurl... @@ +3586,5 @@ > + file.moveTo(null, file.leafName + "." + extFileName); > + attachment.url += "." + extFileName; > + } > + } catch(err) { > + dump("[AddAttachments] : " + err + "\n"); Use Components.utils.reportError(ex) intead
Attachment #743030 -
Flags: review?(mkmelin+mozilla) → review-
Comment 20•8 years ago
|
||
Are there any plans to fix this bug? It is out of there by too many years. Package thunderbird-24.2.0-3.fc20.i686
Comment 21•5 years ago
|
||
I'm still experiencing this more than 9 years after it was reported. While forwarding an email with a .docx attachment I tried to open the file and it came up as nsmail.tmp.
Comment 22•5 years ago
|
||
I'm also experiencing the bug
Comment 23•4 years ago
|
||
I got the error in a Dutch version: "Kan het volgende bestand niet openen. Bestand: nsmail.tmp". Anyone who knows how to solve this?
Comment 24•2 years ago
|
||
12 years and the bug still exists.
You need to log in
before you can comment on or make changes to this bug.
Description
•