Text or html message and attachments problem

0 votes
asked Aug 8, 2019 by 3P (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:
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64


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
answered Aug 8, 2019 by Lukas Pokorny (123,850 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.

commented Aug 8, 2019 by 3P (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.
commented Aug 8, 2019 by Lukas Pokorny (123,850 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.
commented Aug 8, 2019 by 3P (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?
commented Aug 8, 2019 by 3P (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.
commented Aug 8, 2019 by Lukas Pokorny (123,850 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.
commented Aug 9, 2019 by 3P (300 points)
I have sent e-mail causing problems to support@rebex.net.
commented Aug 9, 2019 by Lukas Pokorny (123,850 points)
Thanks! We have received the email and will look into it today.
commented Aug 12, 2019 by Lukas Pokorny (123,850 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.
commented Aug 21, 2019 by Greg573 (150 points)
Hi Lukas,
I'm having the same issue. Has the patch been released yet?
commented Aug 21, 2019 by Lukas Pokorny (123,850 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