Working with Zimbra TGZ Files
TGZ is the archive format that Zimbra Collaboration Suite uses to export and back up mailbox data. A .tgz file is a tar archive compressed with gzip: the tar part preserves the mailbox folder structure, and the gzip part compresses it so the backup is small and easy to move between systems. Inside the archive, each mail item is stored as an individual message together with the path of the folder it belongs to, which makes TGZ a convenient format for archiving and migrating Zimbra mailboxes.
Aspose.Email for .NET provides the Aspose.Email.Storage.Zimbra namespace, which lets you read a Zimbra TGZ backup, traverse its items, and export or migrate its content without a Zimbra server. The main type you will use is:
- TgzReader - the mailbox items reader of a Zimbra TGZ storage. It opens a TGZ file from a path or a stream, iterates over the stored items, and exposes the current folder and message through the CurrentDirectory and CurrentMessage properties.
This section covers the following topics:
- Reading Zimbra TGZ Files - open a TGZ backup from a path or a stream, iterate over its items, read the current folder and message, and count the total number of items.
- Exporting and Extracting Zimbra TGZ Content - export the whole mailbox structure to disk synchronously or asynchronously, and save selected messages in EML or MSG format.
- Converting Zimbra TGZ to PST - migrate a Zimbra mailbox to the Outlook PST format while preserving its folder hierarchy.