# EmailStoreReader

Detects and reads supported mailbox-store artifacts without native or third-party parser dependencies.

Class 

`OfficeIMO.Email.Store`

**Namespace**

`OfficeIMO.Email.Store`

**Assembly**

`OfficeIMO.Email`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[EmailStoreReader.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L8)

**Modifiers**

sealed

Detects and reads supported mailbox-store artifacts without native or third-party parser dependencies.

## Inheritance

- object
- EmailStoreReader

Filter members 

Show inherited

## Constructors

`public EmailStoreReader(EmailStoreReaderOptions? options = null)` [#](#constructor-ctor-officeimo-email-store-emailstorereaderoptions)

[EmailStoreReader.cs:8](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L8)

Creates a reader with bounded defaults.

Parameters

**options OfficeIMO.Email.Store.EmailStoreReaderOptions? = null optional**

## Methods

DetectFormat 2 overloads

`public static EmailStoreFormat DetectFormat(string path)` [#](#method-detectformat-string)

[EmailStoreReader.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L14)

Detects a store format from a bounded header.

Parameters

**path string required**

Returns

`EmailStoreFormat`

`public static EmailStoreFormat DetectFormat(Stream stream, string? sourceName = null)` [#](#method-detectformat-io-stream-string)

[EmailStoreReader.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L24)

Detects a store format without changing a seekable stream's position.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

Returns

`EmailStoreFormat`

ExportRecoverableItemsToDirectory 2 overloads

`public EmailStoreSalvageReport ExportRecoverableItemsToDirectory(string sourcePath, string destinationDirectory, EmailStoreSalvageOptions? options = null, CancellationToken cancellationToken = default)` [#](#method-exportrecoverableitemstodirectory-string-string-officeimo-email-store-emailstoresalvageoptions-threading-cancellationtoken)

[EmailStoreReader.cs:103](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L103)

Detects a damaged DBX or OLM file and exports the readable items and their provenance.

Parameters

**sourcePath string required**

Path to the damaged store.

**destinationDirectory string required**

Directory for recovered items and their manifest.

**options OfficeIMO.Email.Store.EmailStoreSalvageOptions? = null optional**

Salvage options. When omitted, uses this reader's source bounds.

**cancellationToken System.Threading.CancellationToken = default optional**

Cancels recovery.

Returns

`EmailStoreSalvageReport` The recovered items, source damage, and export outcomes.

`public EmailStoreSalvageReport ExportRecoverableItemsToDirectory(Stream source, string destinationDirectory, EmailStoreSalvageOptions? options = null, string? sourceName = null, CancellationToken cancellationToken = default)` [#](#method-exportrecoverableitemstodirectory-io-stream-string-officeimo-email-store-emailstoresalvageoptions-string-threading-cancellationtoken)

[EmailStoreReader.cs:121](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L121)

Exports readable items from a damaged DBX or OLM stream and restores the stream position.

Parameters

**source System.IO.Stream required**

Readable, seekable stream that stays open and must remain unchanged during recovery.

**destinationDirectory string required**

Directory for recovered items and their manifest.

**options OfficeIMO.Email.Store.EmailStoreSalvageOptions? = null optional**

Salvage options. When omitted, uses this reader's source bounds.

**sourceName string? = null optional**

Source name. Use a .dbx or .olm extension when the header cannot identify the format.

**cancellationToken System.Threading.CancellationToken = default optional**

Cancels recovery.

Returns

`EmailStoreSalvageReport` The recovered items, source damage, and export outcomes.

Read 2 overloads

`public EmailStoreReadResult Read(string path, CancellationToken cancellationToken = default)` [#](#method-read-string-threading-cancellationtoken)

[EmailStoreReader.cs:73](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L73)

Reads a file while keeping random-access parsing off the large-object heap.

Parameters

**path string required**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`EmailStoreReadResult`

`public EmailStoreReadResult Read(Stream stream, string? sourceName = null, CancellationToken cancellationToken = default)` [#](#method-read-io-stream-string-threading-cancellationtoken)

[EmailStoreReader.cs:83](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.Email/Store/Reading/EmailStoreReader.cs#L83)

Reads a seekable stream and leaves it open.

Parameters

**stream System.IO.Stream required**

**sourceName string? = null optional**

**cancellationToken System.Threading.CancellationToken = default optional**

Returns

`EmailStoreReadResult`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

<!-- PowerForge markdown artifact sha256:0721B631075340CCC954539203795D6DE1DD634947B26BB79E01A2C872AB5732 -->
