We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Serious bug in reading OST

Hello,
Just installed Office Outlook 2021 and created a new account, then got its OST file and according to here:


The process for reading an OST file with Aspose.Email is exactly the same as for reading a PST file
So my code:

Using MyStorage As Email.Storage.Pst.PersonalStorage = Email.Storage.Pst.PersonalStorage.FromFile(GlobalStorageFile, xxxLoadOptionsxxx)
ReadOST(MyStorage.RootFolder.GetSubFolders)
End Using

Private Sub ReadOST(ByVal InputFolders As Email.Storage.Pst.FolderInfoCollection)
For Each MyFolder As Email.Storage.Pst.FolderInfo In InputFolders
For Each MyMSG As Email.Storage.Pst.MessageInfo In MyFolder.EnumerateMessages
MsgBox(MyMSG.SenderRepresentativeName)
MsgBox(MyMSG.DisplayTo)
MsgBox(MyMSG.Subject)
End Sub

I get strange characters for many of .SenderRepresentativeName / .DisplayTo / .Subject properties!
Some masterpieces returned:
Case 1:

From: 陵䑐莆綸⋥䦪H
Subject: Thank you for interest in Aspose Products

Case 2:

From: ȁ軧놷ﱧ핵㶂믍⪟销쨕錂挊ǀ旯
Subject: How are you getting on with Aspose APIs?

Case 3: (a lovely From string, multiline + .Subject belongs to another message)

From: https://forum.aspose.com/letter_avatar_proxy/v4/letter/t/9de0a6/45.png tahir.manzoor https://forum.aspose.com/u/tahir.manzoor
September 4

@australian.dev.nerds https://forum.aspose.com/u/australian.dev.nerds

To ensure a timely and accu
Subject: Subject: You’ve got a reply from xxx Team

  • Funny is that in case 3, values returned by .SenderRepresentativeName and .Subject of the same MessageInfo do not belong to a single message inside .OST!

** More fun is that if I change my reading code from:
For Each MyMSG As Email.Storage.Pst.MessageInfo In MyFolder.EnumerateMessages
to:
For Each MyMSG As Email.Storage.Pst.MessageInfo In MyFolder.GetContents
now, I’ll get different values for the above properties!

Pretty x’ed up!

*** In case I need to send my .OST file, I don’t see an attachment option!

@australian.dev.nerds

Please get 30 days temporary license and apply it before using your code example. Hope this helps you.

If you still face problem, please attach the following resources here for testing:

  • Your input OST file. Please check the attached image for upload button. upload file.png (7.6 KB)
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hello,
I already got the temporary license and tested it before posting this topic!
OK my project is ready and attached, please find my .OST file in this location:

\WindowsApplication1\bin\Release

Just open the project and run, the .OST file will be loaded!

*** Important note: please verify why in this line:
For Each MyMSG As Email.Storage.Pst.MessageInfo In MyFolder.
using
MyFolder.EnumerateMessages
returns different message info than using:
MyFolder.GetContents
sometimes From field of message A with Subject of message B is reported for a message!

WindowsApplication1.zip (3.9 MB)

@australian.dev.nerds

We have logged this problem in our issue tracking system as EMAILNET-40698. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

A post was split to a new topic: Read messages of OST

@ erickbell which issue? reading OST files or attaching files to the post? :smiley:
If reading OST files, I have to confess that after 20 years of programming, Aspose Email NET is the wonderland of all SDKs I’ve seen in my whole life, among with its documentation and support, backed up by an affordable pricing, anyway I need it to work, I hope at the end, I can proceed to purchase a working SDK.

@australian.dev.nerds

You will be inform via this forum thread once this issue is resolved.

@australian.dev.nerds

The MessageInfo.SenderRepresentativeName property returns an invalid value. This is the one bug we found, and we can confirm that it exists.

Could you please confirm if there are other issues that you are facing for this case?

Following steps were performed to reproduce the bug:

  • Execute your code example. Verified that the wrong values of the MessageInfo.SenderRepresentativeName property are displayed.
  • In order to analyze it more carefully, we created our own example, which writes all the necessary information to the logs files.

Log files and code example are in the CodeSample.zip (5.2 KB)

The code example consists of 3 methods that read messages using EnumerateMessages, GetContents and EnumerateMapiMessages, respectively.
All three methods write the following information to separate log files:

  • Folder Name
  • Message SenderRepresentativeName property
  • Message DisplayTo property
  • Message Subject property

As a result, you can see the following:

  • ReadOstByEnumerateMessagesLog.txt and ReadOstByGetContentsLog.txt are identical. So, the EnumerateMessages and GetContents methods work the same way.
  • ReadOstByEnumerateMessagesLog.txt and ReadOstByEnumerateMapiMessagesLog.txt are different. For each message, the differences are only in the SenderRepresentativeName property (please check changes.diff file in the ZIP file).

We will try to fix the found bug in next version of Aspose.Email. This happened because the OST files format created by Outlook versions later 2013 is different from the PST format and is not documented, unfortunately.

Let’s make it short, please kindly advise:
I’m just going to read the email messages inside pst/ost/olm/mbox/tgz and I still don’t know which method is best to use, GetContents, EnumerateMessages or EnumerateMapiMessages!

If I use ByEnumerateMapiMessages

  1. Is .InternetMessageId the same as EntryId which is unique inside the whole PST/OST?

  2. Is .InternetMessageId a mandatory field so I can be sure it always has data?

  3. As you’ve seen in my sample, I’m reading the storage messages and list them in a combobox, at the second step, when a message is selected and VIEW button is pressed, I’ll need to extract/save that message as stream.
    Simple way is when reading the storages, save each message in a collection so later load it easily, the problem is for huge storage files, not a wise solution!
    I still didn’t find a safe way of doing so…

@australian.dev.nerds

We have logged your concerns in our issue tracking system. We will inform you once there is an update available on it.

@australian.dev.nerds

In this case, the EnumerateMapiMessages method is definitely not suitable for the following reasons:

  • Messages are immediately extracted in full, this increases memory consumption and reduces performance.
  • InternetMessageId is not EntryId! InternetMessageId is an identifier used by message transfer agent and is not intended to identify messages in the local pst storage.

Both GetContents and EnumerateMessages are used for message listing. But the following should be taken into account:

  • Both methods call the same internal methods, the difference is that GetContents returns the entire collection of items, while EnumerateMessages returns one item per iteration. EnumerateMessages allows to reduce memory consumption during listing, if there is no need to keep the whole collection in memory.

You may consider the overloaded GetContents(int, int) method, which allows list message information with pagination, it will be better for huge files.

Thanks for the valuable info, it rolled out many things, really must include in the help files.

  1. Anyhow, when reading Olm.OlmMessageInfo in Storage.Olm.OlmFolder, how to get the olm-storage-wide unique EntryId?

  2. Email.Storage.Pst.MessageInfo does not have From.Email and From.Name plus To(0).Email and To(0).Name
    It uses .SenderRepresentativeName which sometimes is From.Email and sometimes From.Name or combination or empty!
    Also uses.DisplayTo which sometimes is To(0).Email and sometimes To(0).Name or combination or empty!
    Can you please add this to your feature request list?

  3. Possible to add these properties to Email.Storage.Olm.OlmStorage?
    .Store.DisplayName
    .IsUnicode
    .Store.IsPasswordProtected

Thanks, I’m done :slight_smile:

@australian.dev.nerds

We have logged new feature request for this case as EMAILNET-40725 in our issue tracking system. You will be informed once there is an update available on it.