Closed Bug 1729632 Opened 3 years ago Closed 2 years ago

Temporary file during mail transfers are sometimes not in the correct extensions

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 91
x86_64
Windows 10
defect

Tracking

(thunderbird_esr91+ verified)

VERIFIED FIXED
96 Branch
Tracking Status
thunderbird_esr91 + verified

People

(Reporter: adrien.rybarczyk, Assigned: mkmelin)

References

Details

(Keywords: dupeme)

Attachments

(3 files)

Attached image attachment.png

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36

Steps to reproduce:

Forward an email with an attachment of a non-classic extension type (Do not use pdf, xls, txt, png, ...).

Actual results:

The temporary file has the txt extension.

Expected results:

The temporary file keeps the same extension as the base file.

duplicate?

Flags: needinfo?(mkmelin+mozilla)

Probably.
I assume for this case .lst is mapped in the os as being text, and then at some point in the process it uses the standard suffix for the type.

Flags: needinfo?(mkmelin+mozilla)
Keywords: dupeme
Blocks: tb91found

I see it from tb78.7.1 to TB Trunk.

(In reply to Magnus Melin [:mkmelin] from comment #2)

Probably.
I assume for this case .lst is mapped in the os as being text, and then at some point in the process it uses the standard suffix for the type.

Yes, I think that is what is being done here:

https://searchfox.org/comm-central/source/mailnews/mime/src/mimedrft.cpp#1818
| // Let's build a temp file with an extension based on the content-type:
| // nsmail.<extension>

https://searchfox.org/comm-central/rev/0f03d5e0469635ae6c2dd85f28b751b813ddf703/mailnews/mime/src/mimedrft.cpp#1834
| rv = mimeFinder->GetPrimaryExtension(contentType, EmptyCString(),
| fileExtension);

(In reply to Wayne Mery (:wsmwk) from comment #1)

duplicate?

Bug 823233

'.lst' or '.log' files become nsmail.txt
'*.7z' becomes nsmail.tmp

And Bug 1713213 then has for sure the same cause.

Calum, do you agree with comment 4? If so, can you close these as dups?

Flags: needinfo?(calum.mackay)

I'm not sure about duplicates; I can't reproduce Bug 823233 (Daily 0917; MacOS 10.15.7); but then the submitter notes that it was specific to one account.

Indeed, I can't reproduce this bug either; tried extensions lst, rty, aaa: all fine.

Perhaps only happens on Windows?

Flags: needinfo?(calum.mackay)

STR (TB91.1.1/Trunk):

  • Drop this email into a TB folder (IMAP, POP3 or local doesn't matter)
  • Start a new email through 'Forward Inline' or 'Edit As New'
  • Check the temp folder or hover the mouse cursor over the attachment icon

As comment 0 describes it, the temporary files now have a different name.

I must admit that I had never sent the mail until now. There the correct name is used again.
So maybe WONTFIX?

The only flaw is that when I drag and drop one of the attachment icons from the compose window into a file folder, the temporary file name is used.

The problem is that the sender cannot check his attachments before sending if the extension has been renamed (extension changes may lead to modifications in the file), which is a problem when you have to be sure all that everything is OK in your mail before sending.

Assignee: nobody → mkmelin+mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/84a052d7dbca
use original file extension for temporary nsmail attachments. r=benc

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

Comment on attachment 9253196 [details]
Bug 1729632 - use original file extension for temporary nsmail attachments. r=benc

[Approval Request Comment]
Regression caused by (bug #): not a regression
User impact if declined: for some cases, opening a file attached, during composition, will "not be possible"
Testing completed (on c-c, etc.): c-c, beta
Risk to taking this patch (and alternatives if risky): should be safe

Attachment #9253196 - Flags: approval-comm-esr91?

Comment on attachment 9253196 [details]
Bug 1729632 - use original file extension for temporary nsmail attachments. r=benc

[Triage Comment]
Approved for esr91

Walt, Rob, we will want to have good testing on the release candidate around attachment handling

Flags: needinfo?(wls220spring)
Attachment #9253196 - Flags: approval-comm-esr91? → approval-comm-esr91+

Attachment handling looks okay to me using the 91.4.1 release candidate on Windows 10.

Viewed the .lst and .log files in Notepad when composing a forwarded message.

I think the reporter should let use know how it works for them when they update before verifying the fix.

Flags: needinfo?(wls220spring)

It works, thank you very much.

Verified by the reporter. Thanks!

Status: RESOLVED → VERIFIED
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: