0 votes
by (300 points)

When I look at message in Thunderbird it is plain text. When I view message source I see there is only one content type:
--00088278c736b5c4e9f829eb2391f35f9a8postch_
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

RsO8ciBldWNoDQpHcnVzcyBBbGV4YW5kcmENCg0KVm9uOiBEYW5pZWxhIEltaG9seiA8ZGFuaS5p
...

There is not text/html part.

In the footer it has placeholder for image - [image.png]. In attachments list I see winmail.dat file (According to information in Internet this might be e-mail with attachment from Outlook sent as plain text.)

First question:
When I read the message using Rebex it returns this e-mail as Html one - HasBodyHtml returns true. Why does this happen? If we took the text version of e-mail everything would be correct but we always take Html version if it is present.

Second question:
This HTML body contains inline image - IMG tag with cid:. But the file extracted from winmail.dat doesn't have Content-Disposition: inline setting. We depend on it to pass boolean Inline flag to our custom web app to display e-mails and in this case we don't display inline attachment correctly.

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (144k points)

1) Rebex MailMessage class supports Microsoft's proprietary TNEF format, which encapsulates attachments, HTML and RTF bodies within a single 'winmail.dat' attachment. MailMessage converts this to standard MIME format when loading the message. If HasBodyHtml returns true, it means that the HTML body is actually available (it was loaded from the 'winmail.dat').

2) This might be a bug. We'll look into it. If possible, please send one of the emails demonstrating this to support@rebex.net for analysis (in a ZIP file to prevent mail servers from modifying it.

by (300 points)
1) How can I send such e-mail myself?
2) I'm waiting for permission to send this e-mail. Attachments may contain some private data.
by (144k points)
1. Unfortunately, this is not supported. You can disable TNEF->MIME conversion using MailMessage.Settings.SkipTnefMessageProcessing option, but then you won't be able to access the contents of winmail.dat.
2. We will try to reproduce this ourselves as well. If we succeed, we hopefully won't need any sample emails from you. Otherwise, I'll let you know.
by (300 points)
I've found another email. It is HTML and contains inline image in footer. It has Content-ID but it doesn't contain Content-Disposition at all - I'm looking at source of message.

So maybe this header is not required? Maybe when displaying images inline I should base only on cid:abc references in HTML message body being present?
by (300 points)
1) I meant how can I send such e-mail myself from any mail client not from code? So I know when such e-mails are delivered to me and to maybe generate some test cases.
by (144k points)
1) As far as I know, the only mail client that is still actively developed and might still support TNEF (winmail.dat) is Microsoft Outlook. However, it needs to be configured to use it first. See https://capsulecrm.com/support/microsoft-tnef/ for instructions on disabling TNEF support, but do the opposite (enable "Rich Text Format" instead of disabling it).

2) I think the "Content-Disposition: inline" header should be there, even though most mail clients might not actually require it. We'll check the relevant MIME RFCs to determine the proper behavior.
by (300 points)
I have sent e-mail causing problems to support@rebex.net.
by (144k points)
Thanks! We have received the email and will look into it today.
by (144k points)
I confirm we have been able to reproduce the issue. Fortunately, fixing it should be quite simple. We'll send you a link to a hotfix in a day or two. Thanks for bringing this issue to our attention.
by (150 points)
Hi Lukas,
I'm having the same issue. Has the patch been released yet?
by (144k points)
It has only been provided to 3P so far. I'll send you a link as well.
Once the patch passes our testing, it will become part of the next (2019 R3.2) release.

Update: This has already been published - https://www.rebex.net/total-pack/history.aspx#2019R3.2
...