A customer has a PST that contains an email with an attached msg file. This msg file contains a loop in its structure. Opening it with MapiMessage.load([path]) causes an OutOfMemoryError. The heap dump looks like Aspose creates an array with millions of entries. The entries appear to be MAPI properties. The properties seem to be created in an infinite loop. Even 15 GB of heap wasn’t enough.
Opening the msg with Apache POIs POIFSFileSystem fails as well and the error message reports a loop in the block structure. Both Outlook and MFCMapi report the msg file as corrupt.
I’ve created a test msg file that shows the same problem. We saw this OOM in Aspose.Email for Java 26.1 and earlier versions.
Our current workaround is to first try opening the msg with POIFSFileSystem. It would be nice if Aspose could implement a similar block loop check.
corrupt-loop.zip (299.7 KB)
@spfaff
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): EMAILNET-41731
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.