Closed Bug 247450 Opened 21 years ago Closed 21 years ago

File name have incorrect (base64) encoding when saving message.

Categories

(SeaMonkey :: MailNews: Message Display, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: eaglus, Assigned: mscott)

References

Details

(Keywords: fixed1.7, intl, Whiteboard: fixed-aviary1.0)

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.9 Build Identifier: Thunderbird/0.7-20040616 (Windows; U; Windows NT 5.1; en-US) Sorry for my poor english... I found a bug and fixed it. When i save message as file (eml, html... any type.), and message subject is base64-encoded, save dialog makes file name from message subject and leaves it encoded in base64. Thus, i can't save message with russian subject correctly. Example message: Subject: =?koi8-r?B?UmU6IPPU1cTFztTZ?= I need filename to save it: "students.eml" (english translated...) But i what i get: "=?koi8-r?B?UmU6IPPU1cTFztTZ?=.eml" I have fixed this bug: ==> In thunderbird dir/chrome/mail.jar/content/messenger/mailCommands.js, at line 370, i found a function: ==> function SaveAsFile(uri) { if (uri) { var filename = null; try { var subject = messenger.messageServiceFromURI(uri) .messageURIToMsgHdr(uri).subject; filename = GenerateValidFilename(subject, ".eml"); } catch (ex) {} messenger.saveAs(uri, true, null, filename); } } i have changed "messageURIToMsgHdr(uri).subject" to "messageURIToMsgHdr(uri).mime2DecodedSubject", and i got right-decoded file name: ==> Good function: function SaveAsFile(uri) { if (uri) { var filename = null; try { var subject = messenger.messageServiceFromURI(uri). messageURIToMsgHdr(uri).mime2DecodedSubject; filename = GenerateValidFilename(subject, ".eml"); } catch (ex) {} messenger.saveAs(uri, true, null, filename); } } Reproducible: Always Steps to Reproduce: 1. In any folder, select a message with base64-encoded header. 2. In menu "File", select "Save as..." 3. Look at file name. Actual Results: I have not-decoded file name. Expected Results: It should make file name from _decoded_ message subject.
Yes, that patch works. But is this save for all environments to write out those "weird" octets as filename? This is a dupe of bug 239994 and bug 231364. I'm not duping it because I'm not sure if these bugs shouldn't duped to this since this one has a patch.
*** Bug 239994 has been marked as a duplicate of this bug. ***
*** Bug 231364 has been marked as a duplicate of this bug. ***
Thanks for the patch. Btw, does it also fix the problem mentioned in bug 231364 comment #1? I guess it does. I'll try it.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: intl
Product: Thunderbird → MailNews
Target Milestone: --- → mozilla1.8alpha2
Version: unspecified → Trunk
Attached patch eaglus' patch Splinter Review
Comment on attachment 151442 [details] [diff] [review] eaglus' patch To ask for r/sr, I made a patch per eaglus' comment #0.
Attachment #151442 - Flags: superreview?(mscott)
Attachment #151442 - Flags: review?(bienvenu)
Attachment #151442 - Flags: superreview?(mscott) → superreview+
I made a version of this patch that fixes it for Thunderbird's version of mailCommands.js That patch is checked into the trunk and the aviary branch.
Whiteboard: fixed-aviary1.0
Attachment #151442 - Flags: review?(bienvenu) → review+
Thanks again for the patch and r/sr. Fixed on the seamonkey trunk.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment on attachment 151442 [details] [diff] [review] eaglus' patch asking for 1.7.1a. This is a one-liner that went into aviary-1.0 branch as well as the trunk. It fixes a long- standing bug that the suggested filename when mail/news message is RFC2047-encoded (i.e. RFC 2047 decoding is not applied).
Attachment #151442 - Flags: approval1.7.1?
Comment on attachment 151442 [details] [diff] [review] eaglus' patch a=mkaply for 1.7.1
Attachment #151442 - Flags: approval1.7.1? → approval1.7.1+
thanks for a. fixed on 1.7branch
Keywords: fixed1.7
This doesn't look like it actually went in on the aviary 1.0 branch.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: