Open Bug 227872 Opened 20 years ago Updated 1 year ago

Save message with HTML attachment as HTML results in invalid HTML file

Categories

(MailNews Core :: Backend, defect)

x86
Windows 2000
defect

Tracking

(Not tracked)

People

(Reporter: mcow, Unassigned)

References

(Blocks 1 open bug)

Details

Compose a message with a valid .HTML attachment.  (Save as draft, or send it.)  
Save the message as HTML.  Resulting file has illegal nested <html> tags:

<html><head><title>...</title> ... </head>
 <body>
  <!--  mozilla mail-header stuff  -->
  <div><!--  message text  --></div>
  <hr ...><br><!DOCTYPE ...>
  <html><head>...</head>
    <body><!-- etc  -->
    </body>
  </html>
 </body>
</html>

I'm calling this a minor bug because simple attachments, at least, render just 
fine in Mozilla, IE, and Opera, but there may be more complex files (e.g. with 
embedded <script> or <style> blocks) that might fail.
OS is All.

And this is not just minor, this happens with messages that also have a HTML
version of the text attached. E.g. what Outlook does by default and Mozilla can
do too - Content-Type: multipart/alternative. If you use "save as" Mozilla
chooses the HTML version and inserts it into the output file as you have shown.

If the html version is different than the plain text counterpart (in content),
as spammers use to do, we have a problem. But that is another bug.
Product: MailNews → Core
(In reply to comment #0)
> Compose a message with a valid .HTML attachment.  (Save as draft, or send it.)  
> Save the message as HTML.  Resulting file has illegal nested <html> tags:

How can I save an eml as a html file? Saving a message as file always creates a eml file. Thats what I expect. Or have I overseen something?
I encountered a similar problem with a message containing both a HTML body and a "bogus" plain text body generated by Outlook. The HTML body contained an inline image. The mail saved with Save As -> File... is different from what is seen with 'view source': a single dot (.) is removed before the word 'shared' in the HTML body.

Suggested fix:
Stick to saving in the .eml file what is seen with 'view source' when possible.
xref bug 221348, bug 164154

Laurent Birtz, your issue is bug 339595 -- this bug is about saving a message as HTML, not saving an HTML message as .EML.
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Filter on "Nobody_NScomTLD_20080620"
QA Contact: esther → backend
Product: Core → MailNews Core
For consolidation, any objections against closing this a duplicate of bug 31052?
Whiteboard: dupme
Whiteboard: dupme → [closeme 2013-09-17][dupme to 31052]
Or maybe it's not a duplicate of bug 31052, but closely related.
Blocks: 31052
Whiteboard: [closeme 2013-09-17][dupme to 31052]
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.