The default bug view has changed. See this FAQ.

Port Bug 358121 and Bug 246414 to SeaMonkey (Phishing detector fix; Background and text colors lost when using a template)

RESOLVED FIXED

Status

SeaMonkey
MailNews: Message Display
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: mcsmurf, Assigned: mcsmurf)

Tracking

({fixed-seamonkey1.1})

Trunk
fixed-seamonkey1.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

3.69 KB, patch
neil@parkwaycc.co.uk
: review+
neil@parkwaycc.co.uk
: superreview+
Robert Kaiser
: approval-seamonkey1.1+
Details | Diff | Splinter Review
3.71 KB, patch
Details | Diff | Splinter Review
(Assignee)

Description

11 years ago
Bug 358121 needs to be ported to SeaMonkey, the JS errors also occour in SeaMonkey:
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailNewsUrl.folder]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/mailWindowOverlay.js :: OnMsgLoaded :: line 2324"  data: no]
Source File: chrome://messenger/content/mailWindowOverlay.js
Line: 2324
Error: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgMailNewsUrl.folder]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: chrome://messenger/content/phishingDetector.js :: isMsgEmailScam :: line 60"  data: no]
Source File: chrome://messenger/content/phishingDetector.js
Line: 60
(Assignee)

Updated

11 years ago
Summary: Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file) → Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file)
(Assignee)

Comment 1

11 years ago
Created attachment 243694 [details] [diff] [review]
Patch
Attachment #243694 - Flags: superreview?
Attachment #243694 - Flags: review?
(Assignee)

Updated

11 years ago
Attachment #243694 - Flags: superreview?(neil)
Attachment #243694 - Flags: superreview?
Attachment #243694 - Flags: review?(neil)
Attachment #243694 - Flags: review?

Comment 2

11 years ago
Comment on attachment 243694 [details] [diff] [review]
Patch

>   // Ignore nntp and RSS messages
>-  var folder = aUrl.folder;
>-  if (folder.server.type == 'nntp' || folder.server.type == 'rss')
>+  // nsIMsgMailNewsUrl.folder can throw an error, especially if we are opening
>+  // a .eml message.
>+  var folder;
>+  try {
>+    folder = aUrl.folder;
>+  } catch (ex) {}
>+
>+  if (folder && (folder.server.type == 'nntp' || folder.server.type == 'rss'))
>     return isEmailScam;
You should test the variable inside the try block, since the folder isn't used anywhere else. Additionally consider using caching folder.server.type directly, or switch(!)ing to a switch statement.

>+    // nsIMsgMailNewsUrl.folder throws an error when opening .eml files.
>+    var folder;
>+    try {
>+      folder = aUrl.folder;
>+    } catch (ex) {}
Worth returning inside the catch block?
Attachment #243694 - Flags: superreview?(neil)
Attachment #243694 - Flags: superreview-
Attachment #243694 - Flags: review?(neil)
Attachment #243694 - Flags: review+
(Assignee)

Comment 3

11 years ago
Created attachment 244317 [details] [diff] [review]
Patch 2
Attachment #243694 - Attachment is obsolete: true
Attachment #244317 - Flags: superreview?(neil)
Attachment #244317 - Flags: review?(neil)
(Assignee)

Comment 4

11 years ago
This patch now fixes Bug 234354, too.
Blocks: 234354

Comment 5

11 years ago
Comment on attachment 244317 [details] [diff] [review]
Patch 2

>+    if (!bodyElement.getAttribute("text"))
>+    if (!bodyElement.getAttribute("bgcolor"))
Nit: should be hasAttribute

>+    } catch (ex) {return;}
Nit: return; on its own line please

r+sr=me with these fixed.
Attachment #244317 - Flags: superreview?(neil)
Attachment #244317 - Flags: superreview+
Attachment #244317 - Flags: review?(neil)
Attachment #244317 - Flags: review+
(Assignee)

Comment 6

11 years ago
Created attachment 244318 [details] [diff] [review]
Patch to check in
(Assignee)

Comment 7

11 years ago
Patch checked in by Bernd.
Status: NEW → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
Summary: Port Bug 358121 to SeaMonkey (Phishing detector throws an error when opening a .eml file) → Port Bug 358121 and Bug 246414 to SeaMonkey (Phishing detector fix; Background and text colors lost when using a template)
(Assignee)

Updated

11 years ago
Attachment #244317 - Flags: approval-seamonkey1.1?
Comment on attachment 244317 [details] [diff] [review]
Patch 2

first-a=me for 1.1

Comment 9

11 years ago
Comment on attachment 244317 [details] [diff] [review]
Patch 2

second-a=me for 1.1
Attachment #244317 - Flags: approval-seamonkey1.1? → approval-seamonkey1.1+

Comment 10

11 years ago
Comment on attachment 244318 [details] [diff] [review]
Patch to check in

landed on the branch

Updated

11 years ago
Keywords: fixed-seamonkey1.1
You need to log in before you can comment on or make changes to this bug.