Closed Bug 1370076 Opened 8 years ago Closed 6 years ago

"mail.compose.attach_http_images" doesn't work in automatic responses from the templates

Categories

(Thunderbird :: Message Reader UI, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: mark.weber, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Build ID: 20170518000419 Steps to reproduce: I wanted to send automatic responses from my templates. So I created a filter which sent these responses automatically to every incoming mail. Well, I have a http-image in my mail signature, so I want to include this with the setting "mail.compose.attach_http_images" in every mail. Actual results: When I paste a html image (<img src="...">) in the signature of the mail that should be send automatically, the image is not sent as an attachment, but in the source I can see, that the URL is written in every automatically sent mail. When I open the template and send to send it manually, it works. So "mail.compose.attach_http_images" doesn't work in automatically sent mails from the templates. Expected results: I want to attach every http image in my mails. The image should be included as an <cid-id> instead of a <img src>.
Can you please inspect the message source of the template. What is the value of the moz-do-not-send attribute?
(In reply to Jorg K (GMT+2) from comment #1) > Can you please inspect the message source of the template. What is the value > of the moz-do-not-send attribute? I have moz-do-not-send attribute. It is only the <img src="...">. When I tried to take moz-do-not-send="false" but when I write this, the recipient of the automatic response got something like this at the begin of the mail and the image was not anywhere: --------------CA6C9DF86C6DE54E8B2B00AFContent-Type: image/jpeg; name="mail-signature.jpg" Content-Transfer-Encoding: base64Content-ID: Content-Disposition: inline; filename="mail-signature.jpg" /9j/4AAQSkZJRgABAQEASABIAAD/4QD2RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEa AAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAeAAAAcgEyAAIAAAAU AAAAkIdpAAQAAAABAAAApAAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIENT NSBNYWNpbnRvc2gAMjAxNoiafd8OU78879861OjEyOjMxIDEzOjU5OjM2AP/h EedodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cm ... So I decided to write only the http img-src without a moz-do-not-send attribute. I don't know if that is important, but I created the signature in the field for signatures in the account settings.
(In reply to Jorg K (GMT+2) from comment #1) > Can you please inspect the message source of the template. What is the value > of the moz-do-not-send attribute? I must change my last answer. The text that I mentioned in my last comment is shown instead of the image. At first there is a sentence like: This is a multi-part message in MIME format.--------------CA6C9DF86C6DE54E8B2B00AFContent-Type: text/html; charset=utf-8Content-Transfer-Encoding: 8bit
Please try a signature like this === Company<br> <img src="http://www.jorgk.com/images/ausflag.png" moz-do-not-send="false"> === then create a new message and save it as a template. Then use that template for the auto-reply. In this case you don't need mail.compose.attach_http_images.
(In reply to Jorg K (GMT+2) from comment #4) > Please try a signature like this > === > Company<br> > <img src="http://www.jorgk.com/images/ausflag.png" > moz-do-not-send="false"> > === > then create a new message and save it as a template. Then use that template > for the auto-reply. > > In this case you don't need mail.compose.attach_http_images. Actually I had tested something like this. But with the solution above mentioned. The recipient receives 'This is a multi-part message in MIME format.--------------CA6C9DF86C6DE54E8B2B00AFContent-Type: text/html; charset=utf-8Content-Transfer-Encoding: 8bit' at the beginning of the message and instead of the image --------------CA6C9DF86C6DE54E8B2B00AFContent-Type: image/jpeg; name="mail-signature.jpg" Content-Transfer-Encoding: base64Content-ID: Content-Disposition: inline; filename="mail-signature.jpg" /9j/4AAQSkZJRgABAQEASABIAAD/4QD2RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEa AAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAAAeAAAAcgEyAAIAAAAU AAAAkIdpAAQAAAABAAAApAAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIENT NSBNYWNpbnRvc2gAMjAxNoiafd8OU78879861OjEyOjMxIDEzOjU5OjM2AP/h EedodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cm ... Have YOU already tried it? I tried it on version 52.1.
(In reply to Jorg K (GMT+2) from comment #4) > Please try a signature like this > === > Company<br> > <img src="http://www.jorgk.com/images/ausflag.png" > moz-do-not-send="false"> > === > then create a new message and save it as a template. Then use that template > for the auto-reply. > > In this case you don't need mail.compose.attach_http_images. I have just tried it again and it is still the same. It does not work. The recipient still got the same like I mentioned.
Yes, I've tried it an I can confirm the bug. If mail.compose.attach_http_images is set to try and a template contains an image without moz-do-not-send attribute, then the image is not included in the auto-reply. Also there is a second bug, auto-replies are sent with a broken MIME structure as shown in comment #2, comment # and comment #5. Sorry, hard to believe but true when you try it :-(
(In reply to Jorg K (GMT+2) from comment #7) > Yes, I've tried it an I can confirm the bug. If > mail.compose.attach_http_images is set to try and a template contains an > image without moz-do-not-send attribute, then the image is not included in > the auto-reply. > > Also there is a second bug, auto-replies are sent with a broken MIME > structure as shown in comment #2, comment # and comment #5. Sorry, hard to > believe but true when you try it :-( And what should I do now? Will this bugs be improved?
Yes, we'll eventually fix the bugs. Looking at the first problem, the mail.compose.attach_http_images being ignored for auto-replies, that's due to the changes we made in TB 52 to the way embedded images are handled. Before http-images were always attached, now they are only attached when mail.compose.attach_http_images is set. Sadly, there are two code paths for manually sending and for auto-reply and by the looks of it (I haven't had time to investigate further), the mail.compose.attach_http_images is apparently not processed for auto-replies. The second problem that when using a template that already contains an image with a CID: reference, the result is bad as you've pointed out various times now, is already not working in TB 45, I've just tried it. In fact, it was reported in bug 647210 in 2011. So all I can suggest right now, make the signature without the moz-do-not-send and live with the fact that in auto-replies the image doesn't get sent.
See Also: → 647210
Actually, looking into this a little more: TB 45 is just as bad. There is no option mail.compose.attach_http_images and when your template contains <img src="http://www.jorgk.com/images/ausflag.png"> that picture won't be attached either. So in that regard TB 52 is no worse than TB 45.
(In reply to Jorg K (GMT+2) from comment #10) > Actually, looking into this a little more: TB 45 is just as bad. There is no > option mail.compose.attach_http_images and when your template contains <img > src="http://www.jorgk.com/images/ausflag.png"> that picture won't be > attached either. > > So in that regard TB 52 is no worse than TB 45. But in TB 45 the template was saved with the attached image as a cid attribute. So the templates which were created in TB 45 don't contain the <img src> with the http URL, but the cid image (attached). I think, the problem is that the images aren't attached in the templates.
No. In both TB 45 and TB 52 you can save the template with the image included as referenced via a CID: reference. If you do, you run into bug 647210 (from 2011, so TB 3.x (yes, three dot something)), so the sent message actually looks like what you described in comment #5 (and in bug 647210 comment #0). So TB 45 and TB 52 behave pretty much the same. The auto-reply doesn't attach the image, and if you manage to include the image in the template, you send rubbish. The technical detail for the rubbish is that the template is not loaded into the compose window with it's MIME structure respected, instead it is "streamed" and shipped out regardless of the MIME parts, embedded images, etc. I've documented this in bug 647210 comment #5. So conclusion: Auto-reply only works with simple templates, at best an images from a http: URL which won't be attached. If you really want to push the point, insert the image from a file: (or paste a bitmap), that will convert it to a data: URL. Then uncheck the box "Attach image" (in Image Properties), then save the template. That will work in the auto-reply since it will embed the image directly in the message, no reference at all used. Try it.
(In reply to Jorg K (GMT+2) from comment #12) > No. In both TB 45 and TB 52 you can save the template with the image > included as referenced via a CID: reference. > > If you do, you run into bug 647210 (from 2011, so TB 3.x (yes, three dot > something)), so the sent message actually looks like what you described in > comment #5 (and in bug 647210 comment #0). > > So TB 45 and TB 52 behave pretty much the same. The auto-reply doesn't > attach the image, and if you manage to include the image in the template, > you send rubbish. > > The technical detail for the rubbish is that the template is not loaded into > the compose window with it's MIME structure respected, instead it is > "streamed" and shipped out regardless of the MIME parts, embedded images, > etc. I've documented this in bug 647210 comment #5. > > So conclusion: Auto-reply only works with simple templates, at best an > images from a http: URL which won't be attached. > > If you really want to push the point, insert the image from a file: (or > paste a bitmap), that will convert it to a data: URL. Then uncheck the box > "Attach image" (in Image Properties), then save the template. That will work > in the auto-reply since it will embed the image directly in the message, no > reference at all used. Try it. It doesn't work. It is unpossible to attach an image to auto-replies in general. Even if I can see a data:-URL or cid in the template, the image isn't sent. The recipient receives a broken MIME structure.
I don't think you did this right. My template contains: <html> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1252"> </head> <body text="#000000" bgcolor="#FFFFFF"> <p><tt>This is an image.</tt></p> <p><tt><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAGCAIAAAB4jOjWAAAAHUlEQVQImWNwdC2CIweXYqyIYQAV2bkW27mSqwgAHmBFjUOcRnYAAAAASUVORK5CYII=" alt="" moz-do-not-send="true" width="12" height="6"></tt></p> </body> </html> This gets send correctly as auto-reply. I tested it. It's important that you need to un-check the "Attach the image to the message" so the image is directly embedded in the HTML and not attached as CID: If you don't believe me, I can attach the resulting received auto-reply.

Closing ticket due to inactivity, comment 14 seems to resolve the issue within the scope of the bug.

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Component: Untriaged → Message Reader UI
Resolution: --- → INACTIVE
Resolution: INACTIVE → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.