Aspose.Email 19.6 seems to generate a corrupted PST file in some cases


#1

There is a bug in Aspose.Email 19.6. It does not exist in 19.5.

Aspose.Email 19.6 seems to generate a corrupted PST file in some cases. Here is how to reproduce:

var files = Directory.GetFiles(@"c:\messages", "*.msg");

using (var storage2 = PersonalStorage.Create(@"C:\result.pst", FileFormatVersion.Unicode))

{

var folder2 = storage2.RootFolder;

var msgs = files.Take(300).Select(file => MapiMessage.FromStream(new MemoryStream(File.ReadAllBytes(file)))).ToList();

folder2.AddMessages(msgs);

var msgs2 = files.Skip(300).Select(file => MapiMessage.FromStream(new MemoryStream(File.ReadAllBytes(file)))).ToList();

folder2.AddMessages(msgs2);

}

The messages folder contains 509 MSG files. These files are attached. Because it is a big file, please download from: https://www.zevainc.com/download/messages.zip

The bug does not happen if we use AddMessage instead of AddMessages.

The bug does not happen if we use AddMessages a single time. That is if we add the 509 at once.

The bug happens if we add 300 messages and then add the remaining 209 messages.

What is the problem?

The generate PST file has issues. Here is how to see the problem:

Once the result.pst file is generated, add it to outlook as a data file. Then use MFCMAPI (https://github.com/stephenegriffin/mfcmapi) to open the message with subject “RTF/HTML Email with various attachments”. Once you open the message, try to change a property (e.g. PR_SUBJECT) and then save changes. You will get a MAPI_E_OBJECT_DELETED error.


#2

@bahakh,

I have observed the issue shared by you and request you to please first try using latest Aspose.Email for .NET 19.8 on your end. If the issue still persist then please share the feedback with us and we shall investigate that further on our end.


#3

The issue happens also in 19.8. We already tested it.


#4

@bahakh,

I have observed the issue shared by you and an issue with ID EMAILNET-39582 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.