Table of Contents

Method StoreFiledEmailAsync

Namespace
MailFathom.Application.Synchronization
Assembly
MailFathom.Application.dll

StoreFiledEmailAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, AppendedMailFlags, OutgoingEmailId?, CancellationToken)

Stores a message MailFathom filed itself into a held account's local folder, with no occurrence on any server.

Task<StoredEmailId?> StoreFiledEmailAsync(IPersistenceSession session, MailAccountId account, MailFolderResolutionId binding, ExtractedEmailMetadata? extractedMetadata, long sizeOctets, AppendedMailFlags flags, OutgoingEmailId? filedFrom, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The explicit persistence session this write participates in.

account MailAccountId

The account the message is filed for.

binding MailFolderResolutionId

The folder binding of the source folder playing the role the message is filed under.

extractedMetadata ExtractedEmailMetadata

What was read out of the message's MIME, or null when nothing could be.

sizeOctets long

How large the message is.

flags AppendedMailFlags

The flags the message is filed with.

filedFrom OutgoingEmailId?

The outgoing record a sent copy is filed from, or null for a draft.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<StoredEmailId?>

The new stored email's identity, or null where binding names a folder binding that is no longer stored.

Remarks

A binding that is gone is answered rather than raised, because it was read before the transaction and the drain removes exactly those source folders: the caller files nothing and says so, and the state the message was a copy of still commits.

The row is written as a synchronized one is — the search document and the conversation are placed in the same session — so a draft or a sent message is found and threaded exactly as the copy a server would have returned.

A stored message still names a folder binding, and a filed one names the binding of the source folder playing its role: that is where the source keeps the same kind of message, and what a provider's own copy of a sent message is later drained from.