How to link Exchange and PersonalStorage messages?

hello.
I'm using aspose.mail 1.4

I want to download emails from Exchange using ExchangeClient and save them into my PersonalStorage (pst file)
This works fine.
But when I try to download messages from Exchange next time, there is no way to identify new and already downloaded messages.
Previously I have used MailMessage.MessageId property to compare new and downloaded messages.
(messages stored in local file system with filenames like MessageId.msg).
Now I whant to migrate to PersonalStorage. But, unfortuantly, I haven't found any solution to compare pst messages within Exchange.

Is there any way to get MessageId from pst MapiMessage or some other way to compare pst message and Exchange message?

Hi Max,


Thank for considering Aspose.

I have tested your scenario at my end. Unfortunately I am also unable to propose a solution. I have checked the MessageId and UniqueUri of message on Exchange, it does not match with the EntryId for the same message in PST.

I have logged an investigation and asked the development team for their opinion on this. The ticket Id for your reference is NETWORKNET-33183. As soon as I hear from them, I will let you know here.

Please accept my apologies for your inconvenience.
Hello again.

I have tested pst messages again and found, that
MapiMessage.InternetMessageId is the same as ExchangeMessageInfo.MessageId
But to get it I need to Extract message from pst-file (in case if I have 10 000 - 20 0000 messages in pst this will cause huge perfprmance problems).

If you could implement InternetMessageId property in Aspose.Email.Outlook.Pst.MessageInfo, this will be perfect solution for me. This will allow to compare new and already downloaded messages with minimum costs.
And also, is it possible to add ' receivedDate' to MessageInfo?
MessageInfoCollection msgs = pstFolder.GetContents();

Hi Max,
Thank you for your analysis.


I have closed the investigative ticket logged earlier under Id NETWORKNET-33183 and created a new one to analyze the requirement of adding InternetMessageId and ReceivedDate properties to the Aspose.Email.Outlook.Pst.MessageInfo class. The ticket Id for your reference is NETWORKNET-33186.


We will keep you posted with updates on this.

The issues you have found earlier (filed as NETWORKNET-33186) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Max,


Please check the below code sample to extract InternetMessageId,

C#
using (PersonalStorage pst = PersonalStorage.FromFile(file_path))
{
FolderInfo folder = pst.RootFolder.GetSubFolder(“Inbox”);
foreach (MessageInfo message in folder.EnumerateMessages())
{
MapiProperty internetMessageId = pst.ExtractProperty(
message.EntryId, MapiPropertyTag.PR_INTERNET_MESSAGE_ID_W);
}
}