Closed Bug 685112 Opened 13 years ago Closed 12 years ago

Attached .doc file is replaced by the email's text upon Open, if broken mime-type like =?iso-8859-1?q?application/msword; is specified in Content-Type: header

Categories

(MailNews Core :: Attachments, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 659355

People

(Reporter: Frederic.Meynadier, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Build ID: 20110905175240 Steps to reproduce: Config : TB 6.0.1, Ubuntu 11.04 64 bits, LibreOffice for reading word documents. I am connected to an IMAP mail server. I have received an email with an attached Word document (.doc format). In the message panel, I click on the attachment's name. A dialog box appears, proposing to open the file with LibreOffice writer : I click OK Actual results: LibreOffice launches, but what appears is a copy of the email's body text, instead of the intended attachment. I remember it already occured some months ago, with an earlier version of TB. Back then I thought it was a sender's error. Expected results: I should have had the .doc file imported and displayed in LibreOffice writer. Additionnal comments : - I have opened the very same email from a webmail : the attachment is the right one. - From thunderbird, if I save the attachment (right-click, "save" in the context menu), I get the right file too. - If I copy this mail in another folder, the issue is still there : I get the wrong content if I left-click on the attachment name, but I get the right content if I right-click and save the attachment. Unfortunately I can't forward the mail itself as it contains professional informations. Possibly relevant headers : User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.21) Gecko/20110830 Thunderbird/3.1.13 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050902040609080307040602" This is a multi-part message in MIME format. --------------050902040609080307040602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit [The email's text, which erroneously appears in LibreOffice] --------------050902040609080307040602 Content-Type: =?iso-8859-1?q?application/msword; name="[filename].doc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="[filename].doc" [The attachement's code in base64] --------------050902040609080307040602--
Six mails has same structure and identical data, except (a) content-type of mail body part(text/plain or text/html), (b) content-type of part which is opened by application. [Mail structure] Content-Type: multipart/mixed; boundary="Bdy" Part-1, mail body : Content-Type: text/{Body_Type} Part-2, text attachment #1 [details] [diff] [review] : Content-Type: text/plain Part-3, .doc attachment ; Content-Type: {Broken_or_Undefined} Part-4, text attachment #2 [details] [diff] [review] : Content-Type: text/plain [Test mails] {Body_Type} {Broken_or_Undefined} mail-A-01 : plain =?iso-8859-1?q?application/msword; mail-A-02 : plain unknown-major/unknown-sub; mail-A-03 : plain ?corrupted?major?/?broken?sub?; mail-B-01 : plain =?iso-8859-1?q?application/msword; mail-B-02 : plain unknown-major/unknown-sub; mail-B-03 : plain ?corrupted?major?/?broken?sub?; When Part-3 is opened by Notepad via Open of context menu, shown data was: mail-x-01/mail-x-03 : HTML which has content of Part-1, Part-2, Part-4. Text in Part-2, Part-4, is embed in <PRE> tag. When x=A, text in Part-1(Mail Body) is also embed in <PRE> tag. When x=B, text in Part-1(Mail Body) is placed as-is becasue of text/html. mail-x-02 : Content of Part-2, as expectd. Problem looks; If mime-type in Content-Type: is broken, all text parts is gathered, and converted to HTML, then passed to application. Confirmed with Tb 6.0 and next trunk nightly build. > Mozilla/5.0 (Windows NT 5.1; rv:9.0a1) Gecko/20110828 Thunderbird/9.0a1
Status: UNCONFIRMED → NEW
Component: General → Attachments
Ever confirmed: true
Product: Thunderbird → MailNews Core
QA Contact: general → attachments
Version: 6 → Trunk
OS: Linux → All
Hardware: x86_64 → All
{Body_Type} for mail-B-nn was wrong. Read as next, please. Sorry for spam. {Body_Type} {Broken_or_Undefined} mail-B-01 : html =?iso-8859-1?q?application/msword; mail-B-02 : html unknown-major/unknown-sub; mail-B-03 : html ?corrupted?major?/?broken?sub?;
Summary: Attached .doc file is replaced by the email's text → Attached .doc file is replaced by the email's text upon Open, if broken mime-type like =?iso-8859-1?q?application/msword; is specified in Content-Type: header
Bug 659355 was found for same external symptom. > Bug 659355 Cannot open PDF attachment in some mails (Content-Type: =?windows-1252?q?application/pdf) But that bug was for mail generated by Tb. 1. mail of broken mime-type is sent to Tb user. 2. when user tried to open the broken mime-type attachment, he requested "always open with the application", then bad mimeTypes.rdf entry was generated. 3. when user send mail with attachment, Tb generates broken mime-type. 4. thus, any Tb user can't open the attachment of broken mime-type(this bug) That bug now focuses on 2./3. instead of 4. To analyze/resolve problem of 4., this bug should be kept open separately. IIRC, phenomenon of this bug was already reported in some bugs. I'll try to search such bugs. I think this bug is better kept, because crisp bug report and pointing to "email's text" is done by you.
A bug I saw in the past was Bug 580971, and was for broken mime-type of =?windows-1252?q?application/pdf;. This bug and that bug are report of identical problem. > Bug 580971 Thunderbird gets an incorrect mime part when opening an attachment of a received message with malformed content type
Text shown by Notepad when Open of the .doc part(mail-A-01/mail-A-03) > <div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [The email's text, which erroneously appears in LibreOffice] > </pre></div><BR><FIELDSET CLASS="mimeAttachmentHeader"></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > Text of correct text/plain part #1 > </pre></div><BR><FIELDSET CLASS="mimeAttachmentHeader"></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > Text of correct text/plain part #2 > </pre></div> Text shown by Notepad when Open of the .doc part(mail-B-01/mail-B-03) > <p>[The email's text, which erroneously appears in LibreOffice]</p> > <BR><FIELDSET CLASS="mimeAttachmentHeader"></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > Text of correct text/plain part #1 > </pre></div><BR><FIELDSET CLASS="mimeAttachmentHeader"></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > Text of correct text/plain part #2 > </pre></div> If mail body is text/html, and if text part is mail body only, phenomenon looks "text/html part(or mail body) is selected instead of part to which Open is requested".
As funny cid: url was seen with test mail of Bug 580971, I checked "html mail which uses cid: url" case. [Mail structure] multipart/mixed mail part-1 : multipart/related part-1-1 : text/html with <iframe src="cid:..."> part-1-2 : text/plain part referred by the cid: url part-2 : Content-Type: ?broken?/?corrupted? part-3 : multipart/related part-3-1 : text/html with <iframe src="cid:..."> part-3-2 : text/plain part referred by the cid: url part-4 : Content-Type: ?broken?/?corrupted? part-5 : multipart/related part-5-1 : text/html with <iframe src="cid:..."> part-5-2 : text/plain part referred by the cid: url [Data shown by Notepad] (1) View/Message Body As/... HTML, Display Attachment Inline=Off (part-2 is opened) > <html><head></head><body><p>[This is mail body #1]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.1.2&filename=brokendocfile-1.doc&type=?broken?/?corrupted?&filename=brokendocfile-1.doc&filename=sigfile_1.txt" width="320" height="40~>This is iframe 1</iframe></div></body></html> (part-4 is opened) > <html><head></head><body><p>[This is mail body #1]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.1.2&filename=brokendocfile-2.doc&type=?broken?/?corrupted?&filename=brokendocfile-2.doc&filename=sigfile_1.txt" width="320" height="40~>This is iframe 1</iframe></div></body></html> (2) View/Message Body As/... HTML, Display Attachment Inline=On (part-2 is opened) > <html><head></head><body><p>[This is mail body #1]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.1.2&filename=brokendocfile-1.doc&type=?broken?/?corrupted?&filename=brokendocfile-1.doc&filename=sigfile_1.txt" width="320" height="40~>This is iframe 1</iframe></div></body></html> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_02.html</LEGEND></FIELDSET><BR/><html><head></head><body><p>[Attached html #2]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.3.2&filename=brokendocfile-1.doc&type=?broken?/?corrupted?&filename=brokendocfile-1.doc&filename=sigfile_2.txt" width="320" height="40~>This is iframe 2</iframe></div></body></html> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_03.html</LEGEND></FIELDSET><BR/><html><head></head><body><p>[Attached html #3]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.5.2&filename=brokendocfile-1.doc&type=?broken?/?corrupted?&filename=brokendocfile-1.doc&filename=sigfile_3.txt" width="320" height="40~>This is iframe 3</iframe></div></body></html> (part-4 is opened) > <html><head></head><body><p>[This is mail body #1]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.1.2&filename=brokendocfile-2.doc&type=?broken?/?corrupted?&filename=brokendocfile-2.doc&filename=sigfile_1.txt" width="320" height="40~>This is iframe 1</iframe></div></body></html> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_02.html</LEGEND></FIELDSET><BR/><html><head></head><body><p>[Attached html #2]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.3.2&filename=brokendocfile-2.doc&type=?broken?/?corrupted?&filename=brokendocfile-2.doc&filename=sigfile_2.txt" width="320" height="40~>This is iframe 2</iframe></div></body></html> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_03.html</LEGEND></FIELDSET><BR/><html><head></head><body><p>[Attached html #3]</p><div><iframe src="mailbox:///C|/wada/@@@/Mail0/bug-685112-02?number=0&part=1.5.2&filename=brokendocfile-2.doc&type=?broken?/?corrupted?&filename=brokendocfile-2.doc&filename=sigfile_3.txt" width="320" height="40~>This is iframe 3</iframe></div></body></html> (3) View/Message Body As/Plan Text, Display Attachment Inline=On (part-2 is opened) > <div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [This is mail body #1] > </pre></div> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_02.html</LEGEND></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [Attached html #2] > </pre></div> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_03.html</LEGEND></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [Attached html #3] > </pre></div> (part-4 is opened) > <div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [This is mail body #1] > </pre></div> > <BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_02.html</LEGEND></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [Attached html #2] > </pre></div><BR><FIELDSET CLASS="mimeAttachmentHeader"><LEGEND CLASS="mimeAttachmentHeaderName">html_attach_03.html</LEGEND></FIELDSET><BR/><div class="moz-text-plain" wrap=true graphical-quote=true style="font-family: -moz-fixed"><pre wrap> > [Attached html #3] > </pre></div> Phenemenon was; (i) Data was "email's body text" as you say, instead of "gathered text parts". "Internal HTML source currently used for mail display by UI" was passed to application. (ii) cid: url in <iframe> refers correct part number(&part= portion). However, &type= and &filename= portion of the cid: url looks somehow replaced by mime-type and filename of opened attachment. Symptom was not "wrong part(mail body part) is selected" which Bug 580971 says.
Creation of such corrupted Content-Type: by Tb is due to bug 503309. Setting dependency.
Depends on: 503309
Fix was proposed to Bug 659355, so closing as DUP.
Status: NEW → RESOLVED
Closed: 12 years ago
No longer depends on: 739025
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: