Last Comment Bug 550478 - Attached .eml - Other Actions --> View Source - only shows body.
: Attached .eml - Other Actions --> View Source - only shows body.
Status: RESOLVED FIXED
:
Product: Thunderbird
Classification: Client Software
Component: General (show other bugs)
: unspecified
: All All
: -- normal (vote)
: Thunderbird 11.0
Assigned To: Jim Porter (:squib)
:
Mentors:
Depends on:
Blocks: 269826
  Show dependency treegraph
 
Reported: 2010-03-05 07:49 PST by Kevin McCormick
Modified: 2011-12-28 04:12 PST (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Super-hacky patch (697 bytes, patch)
2011-11-06 12:10 PST, Jim Porter (:squib)
mozilla: review+
Details | Diff | Review

Description Kevin McCormick 2010-03-05 07:49:27 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3

Received an .eml file which I need to get the headers out of. I opened the .eml file in a new window. Selected: Other Actions --> View Source. The window only displayed the html of the body. The headers could not be seen.

Reproducible: Always

Steps to Reproduce:
1. Open .eml file.
2. Click Other Actions
3. Click View Source
Actual Results:  
<html>
<head>
<title>IT Service..</title>
<link rel="important stylesheet" href="chrome://messagebody/skin/messageBody.css">
</head>
<body>
<table border=0 cellspacing=0 cellpadding=0 width="100%" class="header-part1"><tr><td><div class="headerdisplayname" style="display:inline;">Subject: </div>IT Service..</td></tr><tr><td><div class="headerdisplayname" style="display:inline;">From: </div>&quot;Habermann, Thomas M., M.D.&quot; &lt;habermann.thomas@mayo.edu&gt;</td></tr><tr><td><div class="headerdisplayname" style="display:inline;">Date: </div>Fri, 5 Mar 2010 06:10:06 -0600</td></tr></table><table border=0 cellspacing=0 cellpadding=0 width="100%" class="header-part2"><tr><td><div class="headerdisplayname" style="display:inline;">To: </div>undisclosed-recipients:;</td></tr></table><br>

<div class="moz-text-html"  lang="x-western"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; ">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7655.7">
<TITLE>IT Service..</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>IT Service,<BR>
You have exceeded the limit of your mailbox set by your WEBCTSERVICE/Administrator, and you will be having problems in sending and recieving mails Until You Re-Validate. To prevent this, please click on the link below to reset your account.<BR>
CLICKHERE:<A HREF="http://form****.****.com/">http://form****.****.com/</A><BR>

Regards,<BR>
IT Service<BR>
System Administrator</FONT>
</P>

</BODY>
</HTML>
</div></body>
</html>


Expected Results:  
Return-Path: ****.***@****.***
Received: from *****.wiu.edu (LHLO *****.wiu.edu) (143.43.***.***) by
 ****.wiu.edu with LMTP; Fri, 5 Mar 2010 06:10:11 -0600 (CST)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by *****.wiu.edu (Postfix) with ESMTP id 1ED5A5341A3
	for <******@wiu.edu>; Fri,  5 Mar 2010 06:10:11 -0600 (CST)
X-Virus-Scanned: ******** at *****.wiu.edu
Received: from *****.wiu.edu ([127.0.0.1])
	by localhost (*****.wiu.edu [127.0.0.1]) (********, port 10024)
	with ESMTP id sMuBB-KndF1S for <******@wiu.edu>;
	Fri,  5 Mar 2010 06:10:10 -0600 (CST)
Received: from ****.wiu.edu (****.wiu.edu [143.43.***.***])
	by *****.wiu.edu (Postfix) with ESMTP id D160C534195
	for <******@wiu.edu>; Fri,  5 Mar 2010 06:10:10 -0600 (CST)
Received: from ******.wiu.edu (*****.wiu.edu [143.43.***.***])
	by ****.wiu.edu (8.14.1/8.14.1) with ESMTP id o25CBBEZ020022
	for <******@wiu.edu>; Fri, 5 Mar 2010 06:11:12 -0600 (CST)
******-Anti-Spam-Filtered: true
******-Anti-Spam-Result: AlglAKKDkEuBsNQvimdsb2JhbACDJoEcA4pji0hVFQEBAQoJDAcRBx0cAQETAQGHaJ0TgSV8GQYChQGIWRWCTAQIaYEnBIMXhzWDSQ
Received: from *****.****.*** ([129.176.***.***])
  by *****.wiu.edu with ESMTP; 05 Mar 2010 06:10:08 -0600
******-Anti-Spam-Filtered: true
******-Anti-Spam-Result: AgJaAK2DkEuBsNQ1/2dsb2JhbACEQgOKY4tIVXMcAQETAQGHaJ0TgSV8GQYChQGIWRWCTAQIaYEnBIMXhzWDSQ
Received: from ****.****.*** ([129.176.212.53])
  by ******.****.*** with ESMTP; 05 Mar 2010 06:10:08 -0600
Received: from ****.****.****.org (msgebh10.****.*** [129.176.***.***]) by ****.****.*** with ESMTP id BT-MMP-6035583; Fri, 5 Mar 2010 06:10:08 -0600
Received: from ****.****.****.org ([129.176..***.***]) by ****.****.****.org with Microsoft SMTPSVC(6.0.3790.3959);
	 Fri, 5 Mar 2010 06:10:07 -0600
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CABC5C.CAE261A1"
Subject: IT Service..
Date: Fri, 5 Mar 2010 06:10:06 -0600
Message-ID: <6861EB5183861645B21EA852ABB078D4068CBB@****.****.****.org>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: IT Service..
thread-index: Acq8XMpElH7KjyZJQPesLxsVW+Kijg==
From: "****, **** *., *.*" <****.***@****.***>
X-OriginalArrivalTime: 05 Mar 2010 12:10:07.0263 (UTC) FILETIME=[CB9E1AF0:01CABC5C]
To: undisclosed-recipients:;


IT Service,
You have exceeded the limit of your mailbox set by your WEBCTSERVICE/Administrator, and you will be having problems in sending and recieving mails Until You Re-Validate. To prevent this, please click on the link below to reset your account.
CLICKHERE:http://****.****.com/
Regards,
IT Service
System Administrator
Comment 1 zug_treno 2010-03-06 07:49:16 PST
Duplicate of MailNews Core bug 204350 comment 85?
Comment 2 Ludovic Hirlimann [:Usul] 2010-03-17 03:32:15 PDT
(In reply to comment #1)
> Duplicate of MailNews Core bug 204350 comment 85?

rsx11m Thoughts ?
Comment 3 Wayne Mery (:wsmwk, NI for questions) 2011-08-14 07:41:44 PDT
Do you still see this issue when using version 5 or 6 (due out in a week)?
- If you no longer see the problem, please set status to RESOLVED, and set resolution to WORKSFORME. (or perhaps INVALID, if you determined the problem is not Thunderbird)
- If you still see the problem, please provide updated details, and any additional steps needed to reproduce the problem.
Comment 4 Joshua Cranmer [:jcranmer] 2011-09-02 08:46:22 PDT
RESOLVED INCOMPLETE due to lack of response to previous question. If you feel this change was in error, please respond to this bug with your reasons why.
Comment 5 Kevin McCormick 2011-09-02 09:44:10 PDT
This is still a bug in 6.0.1.
Comment 6 Kevin McCormick 2011-09-02 09:48:37 PDT
Actually this does look like its a duplicate of Bug 204350.

Bug 204350 has been partially resolves, except for the view source.
Comment 7 Jim Porter (:squib) 2011-11-06 12:10:19 PST
Created attachment 572315 [details] [diff] [review]
Super-hacky patch

Here's a super-hacky patch to fix this. Maybe there's a better way, but I'd like to avoid messing with message URL generation.
Comment 8 David :Bienvenu 2011-11-08 12:26:52 PST
Comment on attachment 572315 [details] [diff] [review]
Super-hacky patch

Review of attachment 572315 [details] [diff] [review]:
-----------------------------------------------------------------

yeah, I don't blame you for not wanting to mess with the uri construction.
Comment 9 Jim Porter (:squib) 2011-11-08 18:53:31 PST
Checked in: http://hg.mozilla.org/comm-central/rev/45c94710b32b
Comment 10 Jens Hatlak (:InvisibleSmiley) 2011-11-11 09:47:23 PST
Comment on attachment 572315 [details] [diff] [review]
Super-hacky patch

I wonder whether this patch actually changed anything. Is there a test case (.eml file) this has been verified against?

I applied the patch to SeaMonkey code (which is quite similar here; I had to enable View Source for .eml files, though), and there an example value for "url" looked like this:

file:///C:/Users/jens/Desktop/test.eml?type=application/x-message-display

Since there was no trailing ampersand, the replace statement did nothing in this case. But even with an added question mark after the ampersand (to make the latter optional), I saw no difference in the View Source output. Which brings me back to the original question. [If TB behavior is indeed different from SM behavior here, I'd still like to have a test case to verify it!]
Comment 11 Jim Porter (:squib) 2011-11-20 12:38:10 PST
(In reply to Jens Hatlak (:InvisibleSmiley) from comment #10)
> Comment on attachment 572315 [details] [diff] [review] [diff] [details] [review]
> Super-hacky patch
> 
> I wonder whether this patch actually changed anything. Is there a test case
> (.eml file) this has been verified against?

View source for .eml files on the filesystem already works in Thunderbird. This just applies to *attached* messages.

There's no automated test case for this, though it would probably be possible to make one. I just forwarded myself an email and opened the attached message to test it.
Comment 12 Jens Hatlak (:InvisibleSmiley) 2011-11-20 14:46:17 PST
(In reply to Jim Porter (:squib) from comment #11)
> View source for .eml files on the filesystem already works in Thunderbird.
> This just applies to *attached* messages.

Aha! Comment 0 mislead me then, I read "Recevied an .eml file" and "opened the .eml file" as "Received an .eml file, saved it and opened it from the file system". X-)

Thanks for the clarification.

> There's no automated test case for this, though it would probably be
> possible to make one.

No need, I just wanted clear STR. Unless of course you want to make sure it doesn't break again if the order of parameters changes (see below). You could easily fix it for good by improving the patch, though.

> I just forwarded myself an email and opened the attached
> message to test it.

OK, so STR:
1. Create and HTML email and save it as a draft
2. Create a second email, attach the first to it and save the second one as a draft
3. View the second message, open the attached HTML email and use View Source on it

For me, using SeaMonkey, this results in an internal url value like:

mailbox:///home/jens/.mozilla/seamonkey/12345678.test/Mail/Local%20Folders/Drafts?number=12345&part=1.2&filename=Attached%20Message.eml&type=application/x-message-display

So at least for SeaMonkey your patch doesn't work as-is since there is no trailing ampersand. I don't know exactly where the url is constructed (especially whether it's shared code), but I guess any change to it could easily break your current code. So I suggest to make the ampersand optional, which is what I did in the initial patch attached to porting bug 704016.

Note You need to log in before you can comment on or make changes to this bug.