1

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?

kenlukas
  • 3,616
  • 9
  • 25
  • 36
Alex Gata
  • 31
  • 1
  • 4
  • What are the differences between the servers? Are they different Domino versions? Are they different operating system versions? – Richard Schwartz Nov 16 '18 at 17:17
  • Could the dependency be related to the mail transfer protocol between the server generating the email and the recipient mail server ? Transferring via SMTP between Domino servers may cause this. – Simon Delicata Nov 16 '18 at 22:56
  • Thanks for questions, 1. Both servers are visibly the same, 9.0.x (I don't remember exact version), all mime encoding options in server document & config document are the same. 2. There is no smtp protocol involved. But, the poorly rendered message transferred to another server (my mail server) via Notes protocol, whether "good" message stays on same server, just transferred from mail.box to my mail file. I'll check this. 3. There is Content-Disposition header, shouldn't Notes client take it into account? As far as I see the final solution is to make LN to obey this header. – Alex Gata Nov 17 '18 at 18:22

0 Answers0