Lotus Notes client: inline mime images duplucated as attachments












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?










share|improve this question

























  • 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
















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?










share|improve this question

























  • 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














1












1








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?










share|improve this question
















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?







lotus-domino mime lotusscript ibm-domino






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 16:34









kenlukas

1,51241318




1,51241318










asked Nov 15 '18 at 15:48









Alex GataAlex Gata

611




611













  • 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



















  • 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

















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





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







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





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






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323088%2flotus-notes-client-inline-mime-images-duplucated-as-attachments%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53323088%2flotus-notes-client-inline-mime-images-duplucated-as-attachments%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python