Table of Contents

OutlookMailStoreReaderOptions Class

Definition

Namespace
Bodu.Formats.Outlook
Assembly
Bodu.Formats.Outlook.Pst.dll
Package
Bodu.Formats.Outlook.Pst 1.3.0
Source
OutlookMailStoreReaderOptions.cs

Controls how an OutlookMailStore reads its PST container and decodes message content.

public sealed class OutlookMailStoreReaderOptions
Inheritance
OutlookMailStoreReaderOptions
Inherited Members
Extension Methods

Constructors

OutlookMailStoreReaderOptions()

public OutlookMailStoreReaderOptions()

Properties

BlockCacheSize

Gets the entry budget of each of the underlying container session's two caches, one of decoded pages and one of decoded block payloads.

public int BlockCacheSize { get; init; }

Property Value

int

The entry budget of each cache; 256 by default. 0 disables caching entirely.

Exceptions

ArgumentOutOfRangeException

The value is negative.

DecompressRtf

Gets a value indicating whether the compressed RTF body (PidTagRtfCompressed) is decompressed when read through the body conveniences.

public bool DecompressRtf { get; init; }

Property Value

bool

true by default; when disabled the RTF body convenience returns null.

MaxDecompressedRtfBytes

Gets the largest decompressed RTF body, in bytes, the reader produces.

public int MaxDecompressedRtfBytes { get; init; }

Property Value

int

The ceiling; 64 MiB by default.

Remarks

A compressed payload whose declared or produced size exceeds the ceiling is rejected with OutlookPstFormatException at every validation level.

Exceptions

ArgumentOutOfRangeException

The value is zero or negative.

MaxEmbeddedMessageDepth

Gets the deepest embedded-message nesting the reader opens: a folder-level message is depth zero, a message opened from one of its attachments is depth one, and so on.

public int MaxEmbeddedMessageDepth { get; init; }

Property Value

int

The nesting limit; 16 by default.

Remarks

Opening an embedded message past the limit throws OutlookPstFormatException at every validation level, so a crafted subnode graph cannot drive a recursive consumer off its stack.

Exceptions

ArgumentOutOfRangeException

The value is zero or negative.

MaxInlineAttachmentBytes

Gets the largest by-value attachment payload, in bytes, that is decoded into the attachment's Properties; a larger PidTagAttachDataBinary is left in the store and served only through OpenContentStream().

public int MaxInlineAttachmentBytes { get; init; }

Property Value

int

The inline payload limit; 1 MiB by default.

Remarks

Above the limit the property is still present in the collection, with a null value, so Contains(MapiPropertyTag) and Method are unaffected; GetBinary(ushort) returns null and the content streams from the container without being materialized. This is an inline-decoding threshold, not a validation rule: it does not vary with ValidationLevel.

Exceptions

ArgumentOutOfRangeException

The value is zero or negative.

MaxNodeDataLength

Gets the largest node payload, in bytes, the underlying container materializes in memory - the ceiling on any single property value, attachment payload, or table the store decodes at once.

public long MaxNodeDataLength { get; init; }

Property Value

long

The materialization limit; 256 MiB by default (see MaxNodeDataLength).

Exceptions

ArgumentOutOfRangeException

The value is zero or negative.

OmitUnresolvableValues

Gets a value indicating whether a property value whose reference into the container does not resolve is omitted from its object rather than failing the read.

public bool OmitUnresolvableValues { get; init; }

Property Value

bool

true to omit such a value and keep decoding the rest of the object; false, the default, to raise PstFileFormatException.

Remarks

A value's reference does not resolve when it names a heap item or a subnode the container does not hold, or when a fixed-width value is shorter than its type. By default each is container corruption that fails the folder, message, attachment or recipient list it belongs to, at every validation level. With this option the value is left out and the rest of the object stays readable, so a damaged message still yields its subject, sender, dates and bodies: the option is for recovering mail from a damaged store. It sets OmitUnresolvableValues on the container.

The option is independent of ValidationLevel and covers individual values only; a fault in a heap, table or subnode tree still fails the read. Each omitted value is reported to ValueOmittedCallback. An omitted attachment data property leaves a by-value attachment without its payload, so OpenContentStream() raises OutlookPstFormatException for it, as for any by-value attachment without data.

ValidationLevel

Gets how strictly the container's structures and checksums are validated.

public PstValidationLevel ValidationLevel { get; init; }

Property Value

PstValidationLevel

The validation level; Compatible by default.

ValueOmittedCallback

Gets the callback the reader invokes for each property value it omits from an object it decodes.

public Action<OutlookOmittedValue>? ValueOmittedCallback { get; init; }

Property Value

Action<OutlookOmittedValue>

The callback, or null, the default, to report nothing.

Remarks

The reader omits a value whose reference does not resolve when OmitUnresolvableValues is set, and a value it cannot decode as its MAPI type under Compatible and Minimal; Reason says which. The callback covers the store's, folders', messages' and attachments' properties, recipient rows, and the name-to-id map.

The reader decodes each object once, on first access to its properties or recipients, and invokes the callback synchronously from that access, on the calling thread. An exception the callback throws propagates to that caller and leaves the object undecoded.

Applies to

ProductVersions
.NET8, 10