Page 1 of 1

Image in mail does not appear with SM

Posted: 2005-06-25 14:04

Even if "Voir la version HTML par défaut" (see the HTML version by default) is on Yes and "Afficher les images en pièces jointes" (dispaly attached pictures) is on Yes, when a mail containing pics in his body is sent, there is no way to see it.

Firefox display his icone meaning he understand it is a pic, but he could not find it.

When I do "display pic", I get this message :
You don't have permission to access /sm/src/alt="" on this server
and the source code of the web page for the pic is :
<br />
<img src= alt="" /><br />
meaning there is no path for the pic and no alt message.

Is there a solution???

Thank you!

Posted: 2005-06-25 15:42
by cmurphy54
There is a bug tracker for this over at SM's site: ... tid=100311

And a comment:
It can depend on a few things. You don't mention anything
about your setup, such as PHP, browser, SM version, etc. It
can also depend on the email itself, for example if the
email reports the files as not being images then there isn't
much we can really do about it.

If you're using firefox, you might want to check out... ... fox+images

You can extend the suggestion to add image/gif and
image/jpeg as well.
Check out the link from the comment as it states that only png images are displayed inlined by default and tells you how to display others. Not sure that is your issue, but it's worth a shot.

Posted: 2005-06-25 16:46
by ssevennm
In addition to the fact that that you have to have image/jpeg and image/gif in the HTTP_ACCEPT request header there is also a problem with <IMG src='cid:'> tags in SquirrelMail do to the Content-ID tags not getting sent from hMailServer. I've reported this here:

You can fix the first problem in by editing the SquirrelMail redirect.php:

Code: Select all

function attachment_common_parse() {


    $str = str_replace( ', ' , ',' , $str );
    $types = explode(',', $str);

// make sure we have the 2 most common image types as
// a quick workaround for Safari and Firefox...
$types[] = 'image/gif';
$types[] = 'image/jpeg';



Posted: 2005-06-27 02:21
Hi Ssevennm

I tried your code, adding :
// make sure we have the 2 most common image types as
// a quick workaround for Safari and Firefox...
$types[] = 'image/gif';
$types[] = 'image/jpeg';
just after
$str = str_replace( ', ' , ',' , $str );
$types = explode(',', $str);
Maybe it was not what I was supposed to do, but it doesn't work...

I read you article about this in beta discussion, but I haven't understood anything, I was not even able to find what part of the code it was...

I read that Martin and you want to work on it. If I can help, just tell me. I know a bit of PHP / MySQL, and I can, at least, test your code... :oops:

Thank you


Posted: 2005-06-27 03:32
by ssevennm
Just to be clear, the two lines I added address the following issue: SquirrelMail not showing images when the preference setting to do so is turned on and the message is viewed in plain text. If a message comes in as HTML mail and/or the option of view HTML mail by default is enabled, that is a different problem that I've reported to Martin. Hope that clears up any confusion.

Posted: 2005-06-27 13:43
Heu, Yes, a little bit.

To sum up, it can't work for the moment with Firefox nor IE.

Anyway, if I can help, just ask me

Posted: 2005-06-27 21:39
by cmurphy54
You can try out the new v4 build referenced here: ... 2101#12101

and see if that fixes your issue.

Posted: 2005-06-27 23:14
Ssevennm, Martin and cmurphy54 THANK YOU!!!!!!!!!!!!! Everything works perfectly now!!!!!!!!!! :lol: :P

For people having the same problem and looking for a solution, just download hMailServer 4.0-B118 or higher.

I was running hMailServer 4.0-B117, I only had to download the new version on ... ld-118.exe , double click, Yes, I agree, hMailServer is the best, and the images appear!!!

Without reinstalling PHPWebAdmin or SquirrelMail.

BTW, I have nearly finished the translation of PHPWebAdmin in French and correct some bug (like sometime you must write ' and sometimes \'). If you are French Spocken and you want to test it, do not hesitate to send me a private message!!!

few minutes latter... I continue testing some stuff, and when I answer to a message containing images, the pics disappear... I guess it is because with SM, we can't write mail in HTML, am I right ? I look into the options to see if there a "write mail in HTML format" option, but I didn't find it. Is there a solution ?

I know, I suck!! :wink:

Posted: 2005-06-28 01:27
by ssevennm
There is a plug-in that supposedly lets you write HTML mail with IE.

But I wouldn't know since I don't use IE. :roll:

Posted: 2005-06-28 14:16
It works pretty well, I had to put as comment from line 649 to line 651 of the functions.php of the pluggin as it generates erro.

But when I include images in the body, I got the message [IMAGE REMOVED]

I guess it is an option story, but I haven't found which one yet...

Posted: 2005-06-28 16:18
by ssevennm
If what you're seeing is an image that says "Unsafe Image Removed" (or something similar), then that is because SquirrelMail will only show images in HTML Mail if the image is included in the message. That is, the image has to be like this:

Code: Select all

<IMG src="cid:foo">
This was one of the reasons I was reporting this bug in the first place.

Images that are not included in the image (whose src is a url to an external server) are considered "unsafe" images.

You can use another plug-in called Unsafe Image Rules to allow users to define rules for which messages showing these external images are allowed or they can turn off the blocking of these images all together. Most mail clients have a feature to supress HTML images that are not included in the body of the messages, for example in Apple's, the preference setting "Display remote images in HTML messages".

For whatever reason (security would be my guess), SquirrelMail developers decided not to show these images, but you can still install the plugin.

Unless I'm totally confused on what you're asking, then this certainly doesn't sound like a hMailServer problem (though I've been wrong before).

Two last things you can check to help you determine where the problem is, if a problem there be:

The first is a plugin called "message_details" which allows you to view the entire raw source of the message. The other, depending on your comfort level with IMAP commands, is called "info" which allows you to send raw IMAP commands to the server (which is essentially the same as using telnet to connect to the server and issue commands).

Hope you find something useful here.

Posted: 2005-06-28 18:41
I am sure the problem come from SM and not HMS because when I use thunderbird, everything works well.
And what I tried to explain is not about unsafe image (thank's to you I know what it means exactly) but images really include in mail body or smiley.

Since I installed more or less well the html mail plugin, I am able to create mail in html format.

The pics appear in the mail when I write it, but the receiver only receive [IMAGE REMOVED] or nothing where the images where supposed to be.