Link content gets downloaded and attached to message when mail.compose.attachHttp is true

RESOLVED FIXED in Thunderbird 53.0


Message Compose Window
9 months ago
8 months ago


(Reporter: Jorg K (GMT+2), Assigned: Jorg K (GMT+2))


(Blocks: 1 bug)

Thunderbird 53.0

Thunderbird Tracking Flags

(thunderbird52 fixed, thunderbird53 fixed)



(1 attachment, 2 obsolete attachments)



9 months ago
I have a signature like so:
<a href="">Thunderbird Council</a>
<img moz-do-not-send="true" src="" border="0">

When mail.compose.attachHttp is set to true, the link content gets downloaded and attached.

Can we rename the preference to mail.compose.attachHttpImages and only attach images?


9 months ago
Blocks: 1322155

Comment 1

9 months ago
Created attachment 8817835 [details] [diff] [review]
1322861-attach-only-images.patch (v1)

I think it should be like this.
Assignee: nobody → jorgk
Attachment #8817835 - Flags: review?(mkmelin+mozilla)

Comment 2

9 months ago
The patch also corrects some indentation issues in the vicinity :-(

Comment 3

8 months ago
Created attachment 8818110 [details] [diff] [review]
1322861-attach-only-images.patch (v2)

Oops, this wasn't right. You removed the "shortcut processing" above (why?), so an image with moz-do-not-send="true" set individually would still have been sent with the preference set to true. That's not right. The preference shouldn't override individual settings. I added the shortcut back in. It also saves CPU cycles, since if you already know that we don't want it, why check further?
Attachment #8817835 - Attachment is obsolete: true
Attachment #8817835 - Flags: review?(mkmelin+mozilla)
Attachment #8818110 - Flags: review?(mkmelin+mozilla)

Comment 4

8 months ago
Created attachment 8818126 [details] [diff] [review]
1322861-attach-only-images.patch (v3)

This needed some more cleanup:
- if it's not a DOM *element*, return early.
- if moz-do-not-sent=true, return early.
- fixed error handling for links to match other elements.
- only attach images based on preference mail.compose.attachHttpImages
Attachment #8818110 - Attachment is obsolete: true
Attachment #8818110 - Flags: review?(mkmelin+mozilla)
Attachment #8818126 - Flags: review?(mkmelin+mozilla)

Comment 5

8 months ago
Comment on attachment 8818126 [details] [diff] [review]
1322861-attach-only-images.patch (v3)

Review of attachment 8818126 [details] [diff] [review]:

Wow, yes this needed fixing! r=mkmelin

::: mailnews/mailnews.js
@@ +775,5 @@
>  pref("mail.compose.dontWarnMail2Newsgroup", false);
> +// Attach http image resources to composed messages.
> +pref("mail.compose.attachHttpImages", false);

while we're chanining, maybe make it snake_style instead of camelCase, as that's more common for prefs
Attachment #8818126 - Flags: review?(mkmelin+mozilla) → review+

Comment 6

8 months ago
Landed with a few changes:
   Checking for empty or "false" rather than "true" to make it consistent with other
2) Used mail.compose.attach_http_images as discussed.
Last Resolved: 8 months ago
status-thunderbird52: --- → affected
status-thunderbird53: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 53.0


8 months ago
Attachment #8818126 - Flags: approval-comm-aurora+

Comment 7

8 months ago
Aurora (TB 52):
status-thunderbird52: affected → fixed
You need to log in before you can comment on or make changes to this bug.