When processing “.emlx” files, some files appear to have multiple copies of attachments. When attachments appear more than once, only the last instances seems to be valid.
If I open the same file in a mail program, it only shows one copy of each attachment.
My questions are
1. Is this a known problem?
2. Is there a recommended work-around?
3. Is skipping all but the last copy of an attachment safe?
I’m attaching a sample program that demonstrates the problem along with sample .emlx files.
I’m also struggling with .emlx files that come from Apple’s mail program in Lion and Mt Lion. A number of these files have a secondary extension on them. For example,
These are “.emlx” files and the aspose.email library can open it, but all is not right. Files of this form are accompanied by one or more secondary files with names in the form:
Where “N” is an attachment number.
According to my reading of various comments on the web and Apple’s naming of the file in the Finder, the “.emlxpart” files are attachments. I find that the “.partial.emlx” file is missing one attachment for each of the “.emlxpart” files that appear. When I try to open the attachment Attachment.getContentStream(), I get a stream, but no bytes are available.
The same sample program demonstrates the problems with these kinds of files.
Summary of Attachments
1. MailProcessingTest.java (An application that has you choose a mail file to open. Once open, the application prints some header information along with the names of all attachments and the body of the eMail. It ends by saving each attachment to disk in its own file.)
2. Duplicate Attachments Folder (Three .emlx files which have the problem.)
3. Partial EMLX Folder (Three .partial.emlx files with their emlxpart pieces.)