I drove somebody crazy this morning by sending him this image found chez Volker. My correspondent uses Lotus Notes and didn’t see the image. I saw by his reply though, that he had actually received it, so I started digging a little. I sent myself a similar message, following the steps as I’d done them before. In Mail.app I composed a new message and addressed it to my Lotus Notes account. Upon opening the document in Notes, I see nada. Zilch. Zip. Nothing. Niente. Nichts. What is going on? The Notes view shows a message without the attachment indicator with a size of 140K, so that looks alright. The missing attachment indicator signalizes that the image is inline, which also appears to be correct, so why can’t I see the image when i open the document? Well, let me see what Lotus Domino Web Access, a.k.a. iNotes does: Voila! There it is, so what is the problem? Accessing my Notes mail file via IMAP, I see that the attachment looks so:

o-xT07SCuVSk.jpg    [image/jpeg, base64, 179K]

What has happened? Mail.app sent the message with a content-type of image/jpeg as the file extension suggests. Let me extract the file and check it

$ file o-xT07SCuVSk.jpg
o-xT07SCuVSk.jpg: PNG image data, 500 x 778, 8-bit/color RGB, non-interlaced

Whoops!?! That file contains a PNG data stream, and not a JPEG image. The Lotus client apparently checks the MIME content-type, but since it cannot decode the file as a JPEG stream, it just does nothing. I’d say iNotes didn’t do anything to it at all, but just sent the whole thing down the pipe to the browser, which in the case of Firefox at least, was clever enough to do something with it, i.e. render the PNG image. Interesting. The culprit here, IMHO is Mail.App which simply used the filename to determine the content type. The same holds true for Thunderbird and for one or two other programs I’ve tested. Sloppy programming. On all sides. E-mail programs should check the file’s content before setting any-old MIME content-type on send, and clients should verify content-types before attempting to display content. Update: more pain.

Mail, DomiNotes, Security, and MacOSX :: 31 Aug 2007 :: e-mail