How to know if a message is deleted

Hi! My question is related to a forensics case.

When I recursively parse each email in each folder of a PST or OST file, I want to know if the email is deleted or not. When I parse all emails (using the code below), I see more items per folder than what is shown in Outlook (same folder). Additionally, I find some message titles and dates that I cannot locate in the actual Microsoft Outlook (local pst file, disconnected account).

Do you have a method/function to collect all messages that are ‘deleted’ or ‘awaiting deletion’?

Thanks,

        foreach (Aspose.Email.Storage.Pst.MessageInfo messageinfo in messageinfoCollection)
        {
            try
            {
                Aspose.Email.Mapi.MapiMessage msg = mPst.ExtractMessage(messageinfo);
                // messageinfo is deleted ?
            }
            catch (Exception ex)
            {
            //exception
            }
       }

Hello @jp.saunierDB ,

Welcome to our community! If you have any issues using the product and need assistance or you just have questions, feel free to ask.

Typically, methods like GetContents or EnumerateMessages only read the messages that are visible in Outlook. These methods don’t “see” soft-deleted items.

If you are obtaining more items in the same folder than what Outlook displays, it might be due to a corrupted PST. In any case, analyzing the original PST file is necessary to determine the exact cause.

For locating soft-deleted items specifically, you can use the PersonalStorage.FindAndExtractSoftDeletedItems method.

We would appreciate feedback.
Thank you.