Closed Bug 373954 Opened 17 years ago Closed 17 years ago

Cannot send any attachment files which are attached in original message when I forward a mail as inline

Categories

(MailNews Core :: Internationalization, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: masayuki, Assigned: masayuki)

Details

(Keywords: intl, regression, verified1.8.1.3)

Attachments

(1 file, 2 obsolete files)

If there are these conditions, I cannot send a forwarding mail.

1. the forwarded message is inline.
2. the forwarded mail has attachment file.
3. if the user name of Windows has non-ASCII characters.

I think that this is a regression of bug 278161. Now we can see the assertion at that time.
http://lxr.mozilla.org/mozilla1.8/source/mailnews/compose/src/nsMsgSend.cpp#2328

Because in mime_draft_process_attachments, 
http://lxr.mozilla.org/mozilla1.8/source/mailnews/mime/src/mimedrft.cpp#548
tmpFile->orig_url has native encoded URI spec.
Flags: blocking-thunderbird2?
Attached patch Patch rv1.0 (obsolete) — Splinter Review
This patch fixes this bug, but I don't know whether the risk is low.
Assignee: smontagu → masayuki
Status: NEW → ASSIGNED
Attachment #258593 - Flags: superreview?(bienvenu)
Attachment #258593 - Flags: review?(bienvenu)
Thanks for jumping in here Masayuki,

One quick comment, I think you can use:

NS_GetURLSpecFromFile http://mxr.mozilla.org/seamonkey/source/netwerk/base/public/nsNetUtil.h#676

instead of this: 


+    nsCOMPtr<nsIIOService> ios =
+      do_GetService("@mozilla.org/network/io-service;1");
+    if (!ios)
+      return MIME_OUT_OF_MEMORY;
+    nsCOMPtr<nsIProtocolHandler> ph;
+    ios->GetProtocolHandler("file", getter_AddRefs(ph));
+    if (!ph)
+      return MIME_OUT_OF_MEMORY;
+    nsCOMPtr<nsIFileProtocolHandler> fph = do_QueryInterface(ph);
+    nsCAutoString fileURL;
+    fph->GetURLSpecFromFile(tmpFile, fileURL);

Attached patch Patch rv1.1 (obsolete) — Splinter Review
Thank you Scott for your advice.
Attachment #258593 - Attachment is obsolete: true
Attachment #258599 - Flags: superreview?(bienvenu)
Attachment #258599 - Flags: review?(bienvenu)
Attachment #258593 - Flags: superreview?(bienvenu)
Attachment #258593 - Flags: review?(bienvenu)
Comment on attachment 258599 [details] [diff] [review]
Patch rv1.1

thx for the patch!

two nits:

you don't need this:

+      nsCOMPtr<nsIFile> tmpFile = do_QueryInterface(lf);


nsILocalFile inherits from nsIFile, so you can use lf directly.

and

no need for the braces here:

+      {
+        nsMimeNewURI(getter_AddRefs(newAttachment->orig_url),
+                     fileURL.get(), nsnull);
+      }

r/sr=bienvenu, with those two nits...
Attachment #258599 - Flags: superreview?(bienvenu)
Attachment #258599 - Flags: superreview+
Attachment #258599 - Flags: review?(bienvenu)
Attachment #258599 - Flags: review+
I did step through this code for the ascii case and it still works fine.
Attached patch Patch rv1.2Splinter Review
Attachment #258599 - Attachment is obsolete: true
Attachment #258657 - Flags: superreview+
Attachment #258657 - Flags: review+
Attachment #258657 - Flags: approval-thunderbird2?
checked-in to trunk, thanks.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking-thunderbird2? → blocking-thunderbird2+
Comment on attachment 258657 [details] [diff] [review]
Patch rv1.2

Thank you Masayuki.
Attachment #258657 - Flags: approval-thunderbird2? → approval-thunderbird2+
checked-in to branch too.
Keywords: fixed1.8.1.3
-> v. on trunk and 1.8branch
Status: RESOLVED → VERIFIED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: