Handling winmail.dat using java mail api

I use the JavaMail API to receive attachments, and some of them are in the form of winmail.dat .

As indicated in accessing email for POP 3, obtained as winmail.dat or How to handle Microsoft Outlook Outlook winmail. Dat? Any other surprises?

I tried both https://github.com/jukka/jtnef/blob/master/src/net/freeutils/tnef/TNEF.java and also apache: https://poi.apache.org/hmef/

and when I parse the winmail.dat file, I get only MAPIProperties , but not attachment files, when I debug the constructed message instance, the attachment array is empty, and we only have some attributes and MAPIProperties and 0 attachments.

But when we extract other tools, for example Zimbra , we get the real VCALENDAR file as an attachment.

GET STARTED: VCALENDAR

METHOD: REQUEST

CALSCALE: GREGORIAN

GET STARTED: VTIMEZONE

Question: How can we extract the VCALENDAR file from winmail.dat or is there a way to convert MAPIProperites to VCALENDAR ?

For example, in jtnef output:

MAPIProp: type = PT_UNICODE_STRING name = [GUID = 00 .. id = 0x .. value = MyAttendee

but in the real (correct) VCALENDAR file:

ATTENDEE;CN=MyAttendee

+5
source share

Source: https://habr.com/ru/post/1274187/