I am using JavaMail API to get attachments and some of them are in form of winmail.dat.
As stated in get email attatchment for POP 3 received as winmail.dat or How do I handle Microsoft 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 only get the MAPIProperties
, but no attachment files, when I debug the constructed Message instance, the attachment array is empty and we have only some attributes and MAPIProperties
and 0 attachments.
But when we fetch using other tools for example Zimbra, we get the real VCALENDAR
file as an attachment.
BEGIN:VCALENDAR
METHOD:REQUEST
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
Question: How can we extract the VCALENDAR
file from winmail.dat
or is there any way to convert the MAPIProperites
to VCALENDAR
?
For example we have in the output of jtnef:
MAPIProp: type=PT_UNICODE_STRING name=[GUID=00.. id=0x.. value=MyAttendee
but in the real (correct) VCalendar
file:
ATTENDEE;CN=MyAttendee