Lotus Notes client: inline mime images duplucated as attachments

843 views Asked by At

I'm creating a mime message on a Domino server, but getting unstable results depending on itemizing server.

Details: I'm creating a memo with inline images, source files stored in server filesystem. Images inserted to memo as follows:

'container is a parent mime entity, where images will be stored

    For i = 0 To Ubound(images)
        If Dir$(images(i).FileName) = "" Then Error 15001, ERR_FILE_NOT_FOUND

        Set stream = session.CreateStream
        stream.Open images(i).FileName, "binary"
        Set child = container.CreateChildEntity
        child.SetContentFromBytes stream, images(i).ContentType, ENC_NONE
        child.EncodeContent ENC_BASE64

        fileName = "i" + CStr(i) + "." + ExtractFileExtension(images(i).FileName)

        Set header = child.GetNthHeader("Content-ID", 1)
        If header Is Nothing Then Set header = child.CreateHeader("Content-ID")
        header.SetHeaderVal "<" + fileName + ">"

        Set header = child.GetNthHeader("Content-Type", 1)
        If header Is Nothing Then Set header = child.CreateHeader("Content-Type")
        header.SetHeaderValAndParams images(i).ContentType + {; name="} + fileName + {"}

        Set header = child.CreateHeader("Content-Disposition")
        header.SetHeaderValAndParams {inline; filename="} + fileName + {"}

        stream.Close
    Next

Here is the result header:

Headers: "Content-Transfer-Encoding: binary
Content-Type: image/jpeg;
     name="i0.jpg"
Content-Disposition: inline;
     filename="i0.jpg"
Content-ID: <i0.jpg>

"
Body: "i0.jpg"

It works as a charm in any mail client except Lotus. Depending on server where memo was created Lotus can show inline image and attachment, or inline image only (see attached pics).

Rendered OK

rendered OK

Poor Rendering

poor rendering

Ls code is exactly the same, the memos is exactly the same (ok, except server names, unids, time values), but memos displayed differently, Content-Disposition header ignored.

After extensive investigation I found one small difference in $FILE fields for mime attachment see pic:

see pic

When the "host" property is "2304" then rendering is ok, when it set to "MSDOS/OS2" then inline image duplicated as attachment.

So, the question is how can I set this attachment field HOST parameter? Or is there any way to make LN client to conform Content-Disposition header?

0

There are 0 answers