Closed Bug 1468492 Opened 6 years ago Closed 6 years ago

Enhance handling of mail attachments in SeaMonkey

Categories

(SeaMonkey :: MailNews: Message Display, enhancement)

enhancement
Not set
normal

Tracking

(seamonkey2.49esr fixed, seamonkey2.60 fixed, seamonkey2.53 fixed, seamonkey2.57esr fixed)

RESOLVED FIXED
seamonkey2.60
Tracking Status
seamonkey2.49esr --- fixed
seamonkey2.60 --- fixed
seamonkey2.53 --- fixed
seamonkey2.57esr --- fixed

People

(Reporter: frg, Assigned: frg)

References

Details

User Story

Bug 873872 - Feed messages with image attachments and Display Inline set should show the remote image.
Bug 953165 - Picture in feed not showing.
Bug 1284004 - Improve remote attachment handling.
Bug 1411732 - prevent file name tricks for external http attachments.

For a followup bug to not hold up 2.49.4:
Bug 657856 - Improve interface for attachment objects in the message reader
Bug 676754 - Detaching a single attachment doesn't work
Bug 1284004 - Improve remote attachment handling, Part 2.

Attachments

(5 files)

+++ This bug was initially created as a clone of Bug #1468079 +++

We are somewhat behind Thunderbird in handling attachements. A few bugs should be ported for a better user experience and to provide enhanced security. See user story.
User Story: (updated)
Part 1 good for 2.57+
Attachment #8985182 - Flags: review?(iann_bugzilla)
Attachment #8985182 - Flags: approval-comm-esr60?
Part 1 good for 2.49 and patched up 2.53
Attachment #8985183 - Flags: approval-comm-esr52?
Part 2 good for all versions

The feed from Bug 953165 now shows the picture
Attachment #8985184 - Flags: review?(iann_bugzilla)
Attachment #8985184 - Flags: approval-comm-esr60?
Attachment #8985184 - Flags: approval-comm-esr52?
Part 3. Port Bug 1284004 part 1 only.
Attachment #8985185 - Flags: review?(iann_bugzilla)
Attachment #8985185 - Flags: approval-comm-esr60?
Attachment #8985185 - Flags: approval-comm-esr52?
Part 4. Port Bug 1411732. See the testmessage there. Do not add it here or this bug needs to locked down afterwards.
Attachment #8985186 - Flags: review?(iann_bugzilla)
Attachment #8985186 - Flags: approval-comm-esr60?
Attachment #8985186 - Flags: approval-comm-esr52?
Comment on attachment 8985182 [details] [diff] [review]
1468492-part1-feedsimages-257.patch

>+          img.addEventListener("load", function(event) {
>+            if (this.clientWidth > this.parentNode.clientWidth) {
>+              img.setAttribute("overflowing", "true");
>+              img.setAttribute("shrinktofit", "true");
>+            }
>+          });

This includes part of Bug 534083 - Provide image scaling for embedded images, shouldn't the rest of it be ported into suite's mailWindow.js (messagePaneOnResize and messagePaneOnClick functions)?
Are there other partial ports?

>+  let match = GlodaUtils.PART_RE.exec(url);
>+  this.partID = match && match[1];

Currently partID is not used, do you have patches for porting Bug 736881 - Improve calculation of attached message size and previous related patches?
Flags: needinfo?(frgrahl)
Attachment #8985182 - Flags: review?(iann_bugzilla)
Attachment #8985182 - Flags: review+
Attachment #8985182 - Flags: approval-comm-esr60?
Attachment #8985182 - Flags: approval-comm-esr60+
Comment on attachment 8985183 [details] [diff] [review]
1468492-part1-feedsimages.patch

Same questions as before
Attachment #8985183 - Flags: review+
Attachment #8985183 - Flags: approval-comm-esr52?
Attachment #8985183 - Flags: approval-comm-esr52+
Comment on attachment 8985184 [details] [diff] [review]
1468492-part2-picturefeeds.patch

LGTM r/a=me
Attachment #8985184 - Flags: review?(iann_bugzilla)
Attachment #8985184 - Flags: review+
Attachment #8985184 - Flags: approval-comm-esr60?
Attachment #8985184 - Flags: approval-comm-esr60+
Attachment #8985184 - Flags: approval-comm-esr52?
Attachment #8985184 - Flags: approval-comm-esr52+
Comment on attachment 8985185 [details] [diff] [review]
1468492-part3-externalattachments1.patch

r/a=me assuming previous questions are resolved
Attachment #8985185 - Flags: review?(iann_bugzilla)
Attachment #8985185 - Flags: review+
Attachment #8985185 - Flags: approval-comm-esr60?
Attachment #8985185 - Flags: approval-comm-esr60+
Attachment #8985185 - Flags: approval-comm-esr52?
Attachment #8985185 - Flags: approval-comm-esr52+
Comment on attachment 8985186 [details] [diff] [review]
1468492-part4-attachmentname.patch

LGTM r/a=me
Attachment #8985186 - Flags: review?(iann_bugzilla)
Attachment #8985186 - Flags: review+
Attachment #8985186 - Flags: approval-comm-esr60?
Attachment #8985186 - Flags: approval-comm-esr60+
Attachment #8985186 - Flags: approval-comm-esr52?
Attachment #8985186 - Flags: approval-comm-esr52+
>  img.addEventListener("load", function(event) {

Thanks. You are right wrt the event listener. Copied too much here. I will rip it out and retest. We already have a bug for the size code. If I find some time I will look at it.

> Currently partID is not used

This is now also needed for setting the correct image source:
> img.src = attachment.url;

I am a bit unfamiliar with mailnews code flow and just wanted to be sure I didn't miss anything and stay as close as possible to mail. Looked also at the size code then and decided not to port the other parts for size in this bug. These are not relevant here.
Flags: needinfo?(frgrahl)
partID also needed for part 2.
Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/c77311a28429
Part 1. Port Bug 873872 [Feed messages with image attachments and Display Inline set should show the remote image] to SeaMonkey. r=IanN
https://hg.mozilla.org/comm-central/rev/25106ab79502
Part 2. Port Bug 953165 [Picture in feed not showing] to SeaMonkey. r=IanN
https://hg.mozilla.org/comm-central/rev/af303b1b2f3e
Part 3. Port Bug 1284004 [Improve remote attachment handling, Part 1] to SeaMonkey. r=IanN
https://hg.mozilla.org/comm-central/rev/e884168fb695
Part 4. Port Bug 1411732 [prevent file name tricks for external http attachments] to SeaMonkey. r=IanN
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: