OlmStorage GetPredefinedFolder?

Hello,
Do you find it useful to have GetPredefinedFolder for OlmStorage?
When working with my olm samples, I don’t know which one is the predefined folder for these:

“Deleted Items” and “Trash”
or
“Junk Email” and “Junk E-mail”
or
“Sent” or “Sent Items” or “Sent Mail”

So OlmStorage GetPredefinedFolder will help with that, to map when converting olm to pst.
Thanks :slight_smile:

@australian.dev.nerds

The GetPredefinedFolder method in the OlmStorage class is a valuable tool for identifying standard folders such as “Deleted Items,” “Junk Email,” and “Sent Items” when converting OLM files to PST.

To accurately map these folders, you can utilize the predefined folder types available in the OlmStorage class. Note that the exact folder names may differ based on the Outlook version or localization.

Here’s an example of how to use the GetPredefinedFolder method:

using Aspose.Email.Storage.Olm;

// Load your OLM file
OlmStorage olmStorage = new OlmStorage("path_to_your_file.olm");

// Get predefined folders
var deletedItemsFolder = olmStorage.GetPredefinedFolder(OlmFolderType.DeletedItems);
var junkEmailFolder = olmStorage.GetPredefinedFolder(OlmFolderType.JunkEmail);
var sentItemsFolder = olmStorage.GetPredefinedFolder(OlmFolderType.SentItems);

// Use the folders as needed

For the most accurate results, refer to the documentation for the specific folder types supported in your version of Aspose.Email. This will ensure proper mapping of folders during the conversion process.

1 Like

‘GetPredefinedFolder’ is not a member of ‘Aspose.Email.Storage.Olm.OlmStorage’ :slight_smile:

Sorry, may I ask 3 quick questions related to this topic?

When reading storages, other than pst and ost, which ones support data recovery mode reading? Does olm reader or others support traverse reading?

When using MailStorageConverter.MboxToPst (reader, pst, “Inbox”, opt) it will create the Inbox itself.
When creating a new Pst, what happens if I manually add: PersonalStorage.CreatePredefinedFolder(“Inbox”, StandardIpmFolder.Inbox, True) before calling MboxToPst? Recommended?

When converting olm to pst, one problem is that olm can have multiple accounts, but pst not, am I correct?
How do you overcome this?
Adding all inside olm to the new pst is useless, since we’ll need separate psts for each account?
Am I correct? If so, are you going to split the data from olestorage reader based on each account, if olm is multi account? Do you find it useful?
Thanks :slight_smile:

Thanks for your suggestions. Let me clarify:

  • Unlike PST/OST, the OLM format is much simpler and doesn’t contain metadata that would allow us to classify folders as “Deleted Items,” “Sent Items,” “Junk,” etc. This mapping is most likely managed inside Outlook for Mac itself, not stored in the OLM file.

  • Recovery mode makes sense for PST/OST because they have a block-based storage structure with alloc/free maps, which allows damaged data to be reconstructed. OLM has a linear structure, so there are no “lost” blocks to recover; recovery mode simply doesn’t apply.

  • The converter automatically creates the Inbox if it does not exist. Manually creating it beforehand won’t cause problems, but it is unnecessary.

  • We are not aware of OLM files that contain multiple accounts in practice. If you have a real example, please share it; that would help us better understand whether account-based splitting into separate PSTs is needed.

1 Like

Hello and thanks,
I will provide some sample olm multi accounts for inspection, let me install latest Outlook for Mac and export some mailboxes in a single olm :slight_smile:

Hi,
I’ve found this from the past, not sure how I got it but it works, are you sure it’s not for olm?

Dim MyCallback As New Email.Exceptions.TraversalExceptionsCallback(AddressOf OnTraversalException)

Using MyStorage As New OlmStorage(MyCallback)
  If MyStorage IsNot Nothing AndAlso MyStorage.Load(sourceStream) = True Then
    ...
  End If
End Using

Here:

It’s mentioned.

Thanks :slight_smile:

Yes, this example is for OLM files. The callback is used for handling traversal exceptions when reading the storage.

We don’t call this “Recovery mode.” It’s simply part of the traversal mechanism when working with OLM storage.

1 Like

Sorry for my slow response
Root folder is similar between single and multi account olms, 2 folders and 1 file:
Accounts
Local
Categories.xml

Under:
Local\Address Book\Contacts.xml
and
Local\Calendar\Calendar.xml
These are all in one shared

Categories.xml in the root holds all categories at one place altogether

The main difference is under Accounts folder, here we have a separate folder for each account named with email address, just like the single olm:

Untitled.jpg (44.2 KB)

I’ll try to re-install Mac on VirtualBox/VMWare and export a sample multi olm

Hi, thanks for the details. Looking forward to your sample multi-accounts olm export.