Open Bug 151031 Opened 22 years ago Updated 2 years ago

embedded/inline images don't display due to quotes in mime Content-Base="URL" and Content-Location="URL"

Categories

(MailNews Core :: MIME, defect)

x86
Windows 2000
defect

Tracking

(Not tracked)

People

(Reporter: wfeick-mozilla, Unassigned)

Details

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530
BuildID:    2002053012

I have a script that mails out a web page as a multi-part html file with
attached gifs. The gifs are all thumbnails to other pages, so I set Content-Base
and Content-Location in the header so the relative links in the web page will
work (one is needed for users who use netscape/mozilla and the other is for
those that use IE).

This worked fine, until I switched from netscape to mozilla. The embedded gifs
don't display correctly when either Content-Base or Content-Location is set,
however the links work.

If I remove both Content-Base and Content-Location, the images display correctly
but the links don't work.




Reproducible: Always
Steps to Reproduce:
I'm attaching the mail message with Content-Base and Content-Location included.
I've been sending it to myself as follows.

    /usr/lib/sendmail waf < msg_file
Confirming on 2002070203
Status: UNCONFIRMED → NEW
Ever confirmed: true
QA Contact: trix → yulian
QA Contact: yulian → stephend
hmm... this is really weird. Outlook Express shows the images inline. You can
save the images and view them in Mozilla so the images aren't corrupt. I'm not
really sure what's wrong.
And I'm not sure how to debug this.
Summary: gifs embedded in mail don't display → embedded images in mail don't display
I'm not familiar with the mozilla code, but I would guess there's a routine
somewhere that fetches the image, and it's getting confused about where to get
the image from. You should be able to set a breakpoint in that routine and test
this hypothesis.
perhaps this is a dupe of bug 61815 ?
not a dupe

but if you change:
Content-Base: "http://www.brunz.org/~waf/media/gallery/"
Content-Location: "http://www.brunz.org/~waf/media/gallery/"

into:

Content-Base: http://www.brunz.org/~waf/media/gallery/
Content-Location: http://www.brunz.org/~waf/media/gallery/

it works!

must be a bug in the Content-Base or Content-Location stuff. Will try to poke
around but I could need some help in trying to get closer.
Yeah its the quotes in the Content-Base that's causes the problems.

Looking at the code it seems like Mozilla is already stripping the " from the
Content-Base URL.

If you have:
Content-Base: "http://www.brunz.org/~waf/media/gallery/"

what happens is properly the following:
the Content-Base is retrieved from:
http://lxr.mozilla.org/mozilla/source/mailnews/mime/src/mimethtm.cpp#113

and then a <BASE tag is inserted into the displayed mailmessage at:
http://lxr.mozilla.org/mozilla/source/mailnews/mime/src/mimethtm.cpp#132

but the quotes should be removed at:
http://lxr.mozilla.org/mozilla/source/mailnews/mime/src/mimethtm.cpp#136

so I'm not sure what happens.

I wish there where a way to display internal HTML that Mozilla uses the show the
mailmessage. Is there?
Summary: embedded images in mail don't display → embedded images in mail don't display due to quotes " into Content-Base
Ok found the problem. Via the DOM Inspector I was able to see the internal HTML
for the two messages. One that worked (without quotes) and one that didn't (with
quotes):

The HTML for the one that worked was:
<IMG _base_href="http://www.brunz.org/~waf/media/gallery/"
src="imap://gemal@imap.gemal.dk:143/fetch%3EUID%3E.INBOX.spam%3E11978?part=1.2&amp;filename=pic01.jpg"/>

The HTML for the one that didn't work was:
<IMG _base_href="http://www.brunz.org/~waf/media/gallery/"
src="cid:part1.09040402.02020908@routescience.com"/>

why the imap:// doesn't get inserted in the second mail with the quotes I dont
know yet.
Henrik, from your last mail, it seems your use IMAP on the server. Have you
tried using POP to see if the problem is also there?
Tried POP and same issue
Product: MailNews → Core
Assignee: mscott → nobody
Component: MailNews: Attachments → MailNews: MIME
QA Contact: stephend
QA Contact: mime
Product: Core → MailNews Core
Wada, fyi - another reason why inline images might fail
Summary: embedded images in mail don't display due to quotes " into Content-Base → embedded/inline images in mail don't display due to quotes in mime Content-Base="URL" and Content-Location="URL"
Summary: embedded/inline images in mail don't display due to quotes in mime Content-Base="URL" and Content-Location="URL" → embedded/inline images don't display due to quotes in mime Content-Base="URL" and Content-Location="URL"
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: