TNEF mail containing IPM.Schedule.Meeting.* errors on conversion

arnoldsma-invalidtnef.zip (2.1 MB)

The error on loading such a tnef containing .eml file is:
class com.aspose.email.system.exceptions.InvalidOperationException: This is not a structured storage file.
com.aspose.email.zbcx.(SourceFile:43)
com.aspose.email.zur.a(SourceFile:103)
com.aspose.email.zur.(SourceFile:76)
com.aspose.email.zbgu.a(SourceFile:270)
com.aspose.email.MailMessage.b(SourceFile:5043)

Please note that Outlook will display a “cannot open attachments” with these files - but it does open them for display purposes.

@mbeedell

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as EMAILJAVA-35027. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,
I have been able to reproduce this same “This is not a structured storage file” with a number of other TNEF emails [PS. the company called “Exclaimer” have end-of-life their Email Archive product - and they export their data into TNEF .eml files. This is why the prevalence of tnef related issues has risen.]

I attach another example - but this time with some debug information that I hope will assist in creating a solution. I am not sure if the (binary) attachments to the decoded TNEF emails is actually needed.tnef_walk_for_41251230.zip (143.2 KB)

@mbeedell

We have logged this problem in our issue tracking system as EMAILJAVA-35033. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thank you for resolving those errors.
For EMAILJAVA-35027 - the tnef file now loads, but if I simply save it as a standard .eml file, the output loses the calendar appointment message part. But I see that it is included in the loaded message structure, as shown in this groovy test code:
MailMessage msg = MailMessage.load(msgFile);
msg.alternateViews.each {av -> println “$av.contentId / $av.contentType / $av.headers” }

d0733108-c5cf-4302-a7f8-e10947b87383 / text/plain; charset="utf-8" / com.aspose.email.HeaderCollection@3a47078a
dca84578-cf49-426f-ab38-0715fa1bd036 / text/html; charset="Windows-1252" / com.aspose.email.HeaderCollection@3f6da909
b7c3c30c-8834-47f8-a2a2-dbccc64033a2 / text/calendar; method="REQUEST"; name="meeting.ics"; charset="utf-8" / com.aspose.email.HeaderCollection@18f0efe8

Should I be setting a SaveOption to force the appropriate output? And not just a simple:
(msg.save(emlFile.absolutePath, SaveOptions.getDefaultEml())

Currently the resulting .eml displays in Outlook in plain text without the calendar appointment part plus a couple of the email headers showing at the top of the plain text.

UPDATE: If I scan over the alternateViews, and find both plain text & calendar parts, and then delete the plain text part - then the resulting email saves correctly.
Of course, I would rather avoid this overhead - but at least this workaround is viable.

@mbeedell

We have logged this problem in our issue tracking system as EMAILJAVA-35038. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.