Parsing the details via DotNet in efficient manner

Hello @MaazHussain,

  1. Yes, Aspose.Email allows searching emails across folders in a PST file.
    You can iterate through folders using MapiQueryBuilder to filter messages based on criteria.

  2. The behavior you observed is not related to Aspose.Email but is likely due to OS or development environment mechanisms.
    It could be some form of caching, such as the operating system’s file system cache, which speeds up subsequent file accesses.

Hi @margarita.samodurova, you have mentioned that we could search across folders, by this do we mean i could give a MailQuery like this RootFolder.EnumerateMessages(query) and i get an consolidated search results of all the subfolders or do we need to manually iterate through each subfolder to get the consolidated search results ?

Hello @Devishree,

You need to iterate through each subfolder to get consolidated search results. RootFolder.EnumerateMessages(query) will only return messages from the specified folder. If you want to search across all subfolders, you need to recursively iterate through each subfolder.

Thank you.

Hi @margarita.samodurova, Do we restrict parsing password protected pst files ?

Hello @Devishree,

Password protection in PST files is essentially an Outlook-specific feature, and the data itself is not encrypted. This allows to extract emails without requiring the password.
You can find more details about working with password-protected PST files on our documentation page.

Hi @margarita.samodurova thanks for the clarification, do we have any method to get list of MessageInfo based on the given list of entity Id ? also can i get list of messages present in the current folder based on the conversation id?

Hello @Devishree,

Aspose.Email does not provide a direct method to retrieve a list of MessageInfo objects based on a given list of entity IDs. However, you can achieve this by iterating over the folder’s message collection and filtering messages based on their IDs.
You can iterate through messages in a folder and filter by entity ID:

FolderInfo folderInfo = pst.RootFolder.GetSubFolder("Inbox");
MessageInfoCollection messages = folderInfo.GetContents();

List<string> entityIds = new List<string> { "id1", "id2" }; // Replace with actual IDs
List<MessageInfo> filteredMessages = messages.Where(m => entityIds.Contains(m.EntryIdString)).ToList();

For retrieving messages in the current folder based on a conversation ID, you can refer to our blog article Group Messages from PST by Conversation Threads using C# .NET. This article explains how to use MAPI properties such as PidTagConversationIndex to identify and group messages into conversations.
Additionally, you can check out the ConversationThread sample app in our GitHub repository. This project provides a practical implementation of grouping messages by conversation.

Hi @margarita.samodurova for folder parsing i need to extract mail related folders alone to achieve this can i rely on the ContainerClass property of the PersonalStorage object ? If no how to achieve this?

Hello @Devishree,

Yes, you can rely on the ContainerClass property of the FolderInfo object. Mail-related folders typically have the ContainerClass set to "IPF.Note". You can use this value to filter out mail folders when parsing the PST.

But i could see empty values for certain folders is this expected?
Image File.png (4.9 KB)

Yes, some folders can have an empty ContainerClass value.

Usually, an empty ContainerClass implies “IPF.Note”, meaning the folder is likely a mail folder. However, for greater reliability, you can extract one item from the folder and check its message class (MapiMessage.MessageClass). If it is “IPM.Note”, then the folder contains mail items.

Hi @margarita.samodurova how do i differentiate inline images and attachment in MapiAttachment, i could notice for a specific file IsInlineImage property always return false even for inline image

Hello @Devishree,

Could you please provide a sample MSG file where an inline image exists, but the IsInline property returns false? This would help us analyze the issue.

Outlook (2).zip (655.3 KB)
Inbox folder has mail with subject HTML body, this mail has around 12 inline images all are sent as attachments

Hi @margarita.samodurova is there any property that represents total number of thread count for a conversation ?

Thank you for providing pst file. We are investigating this issue and will update you on our findings.

No, there isn’t a direct MAPI property that represents the total number of messages (thread count) in a conversation.

okay thanks, TryToGetFolderById() this method in PersonalStorage will this give me folder info even it is a subFolder ?

Hello @Devishree.

Yes, TryToGetFolderById() in PersonalStorage will return folder information even if the folder is a subfolder. This method searches for a folder by its entry ID within the entire PST file hierarchy, not just at the root level.

Hi @margarita.samodurova thanks for the above confirmation, is there any property available in MapiMessages that is equivalent of EntryIdString of MessageInfo ?