MapiMessage objects extracted from PST files do not contain attachment named properties correctly

We have a pst file that has a single message. This message has an attachment. And this attachment contains a named property.

If we use the FolderInfo.EnumerateMapiMessages or the PersonalStorage.ExtractMessage methods to extract a MapiMessage object, then the resulting object will contain the attachment correctly. But the NamedProperties collection of the attachment will not contain the named property. The property will appear incorrectly in the Properties collection of the attachment object, IsNamed will be true, but there is no way to find the property name. The expected behavior is that we should find it in the NamedProperties collection and we should be able to get its name.

This behavior is implemented correctly if we read a MSG file via MapiMessage.FromFile. If we do this, then we find the named property in the NamedProperties collection with the correct name.

So the problem seems to be only when extracting from PST files.

Hi Baha,


Thank you for posting your inquiry.

We have tried to reproduce the issue at our end with the help of a sample PST file but were not able to get hold of such a Message file that could be used to reproduce the issue at our end. Please share your sample PST file with us for further investigation at our end. We’ll look into it and assist you accordingly.

PST attached.
Here is the code to reproduce:

PersonalStorage personalStorage = PersonalStorage.FromFile(@"C:\test\NamedPropertyTest-Copy.pst");
var personalStorageMessages = personalStorage.RootFolder.EnumerateMessagesEntryId().Select(x => personalStorage.ExtractMessage(x)).ToArray();
var messageWithFileAttachmentFromPersonalStorage = personalStorageMessages[0];
int numberOfNamedProperties = messageWithFileAttachmentFromPersonalStorage.Attachments[0].NamedProperties.Count;

In this case, the number of properties is zero (the value of the numberOfNamedProperties variable). And we attach the sample PST file. We can use MFCMAPI to view the named property of the attachment correctly. Attached is a screenshot.

Hi Baha,


Thank you for providing sample PST file. This issue is re-produced and logged under Id:EMAILNET-38678 for further investigation by the product team. You will be notified once any update is received in this regard.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.