Invalid TNEF Message

0 votes
asked Sep 27, 2019 by 3P (300 points)

When I try to download message using Imap.GetMailMessage(int sequenceNumber) I get "Invalid TNEF message" error.

Rebex.Mail.MailException: Invalid TNEF message. ---> System.ArgumentException: Media type is not valid.
Parameter name: mediaType
   at Rebex.Mime.Headers.ContentType..ctor(String mediaType)
   at Rebex.Mime.MimeEntity.rjfp(Stream qx, String qy, String qz, ContentTransferEncoding ra)
   at Rebex.Mail.Attachment.aoyn(Stream aij, String aik, String ail, Boolean aim)
   at uvpc.fnus(Stream arz)

In thunderbird this e-mail is displayed correctly. It contains winmail.dat attachment. In message source I see it like this:

Content-Disposition: attachment; filename="winmail.dat"
Content-Transfer-Encoding: base64
Content-Type: application/ms-tnef; name="winmail.dat"

Is this a bug in Rebex?

Applies to: Rebex Secure Mail
commented Oct 2, 2019 by 3P (300 points)
Can I expect any support?
commented Oct 8, 2019 by 3P (300 points)
Can you help me with this case?
commented Oct 16, 2019 by Lukas Pokorny (123,890 points)
Sorry for not replying earlier. We were not aware of your questions due to a configuration issue with one of our servers. This has now been fixed and it should not happen again. (And if it does, please notify us via e-mail if you don't get an answer within two business days.)

1 Answer

0 votes
answered Oct 16, 2019 by Lukas Pokorny (123,890 points)

The error is not related to winmail.dat's content type, but rather to a content type of one of the attachments that are inside the winmail.dat (TNEF) message in one of its PR_ATTACH_MIME_TAG properties. It is most likely invalid (which would make this not a bug), but we can easily work around it by using the 'application/octet-stream' media type instead. We'll include this workaround in our next release. Thanks for letting us know about this!

commented Oct 18, 2019 by 3P (300 points)
Is there a way to track new versions and what's included? I'm waiting for other fixes/changes too.
commented Oct 18, 2019 by Lukas Matyska (59,450 points)
You can be notified via email about new versions. Just register at

You can also follow us on or

You can subscribe to our

The information about fixes/changes are always available at
commented Dec 5, 2019 by Lukas Pokorny (123,890 points)
The workaround has added in 2019 R4 release: