[Mimedefang] MIME::Tools bug, Content-Location header

Stella Power snpower at maths.tcd.ie
Mon Feb 27 05:11:09 EST 2006


Hi there,

I've discovered a problem with MIME::Entity, though actually the bug itself
may lie in the Mail::Header module that is used.  I'm not totally sure, so
I'll just describe the problem I'm having.

I'm creating a "multipart/related" MIME message to which I attach multiple
images.  I'm creating the image entity parts like so:
	my $enc_img = MIME::Entity->build(
				'Data' => $img_data,
				'Encoding' => 'base64',
				'Filename' => $1,
				'Type' => $type,
				'Content-Location' => "$img_url"
				);

As you probably know the $img_url has to be the absolute url of the image in
the html file.  

My url is quite long:
http://machine.some.domain.com/~spower/abconline/portlets/historicalChart/historicalChart.png

So when I look at the headers of my MIME message (printed to a file), it
appears like:

Content-Location: http://machine.some.domain.com/~spower/abconline/portlet
	s/historicalChart/historicalChart.png

As you can see the url gets split over two lines.  This causes a problem when
I attempt to open the mhtml file in Word - it fails to display the image.
When i edit the mhtml manually and concatenate those two lines, Word is able
to display the image.  Word in particular is very fussy about the headers in
mhtml files, but I'm afraid I've got no choice but to work with it.  For the
moment, I'm creating short dummy absolute urls for each image i'm attaching.


I hope this helps you find the problem.

Cheers,
Stella



More information about the MIMEDefang mailing list