Table of Contents

Method RecordFiledFromOutgoingAsync

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

RecordFiledFromOutgoingAsync(IPersistenceSession, StoredEmailId, OutgoingEmailId, CancellationToken)

Records that one stored email is the copy MailFathom itself filed of a message it sent.

Task RecordFiledFromOutgoingAsync(IPersistenceSession session, StoredEmailId storedEmailId, OutgoingEmailId outgoingEmailId, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The explicit persistence session this write participates in, which is the one storing the email.

storedEmailId StoredEmailId

The email that was just stored.

outgoingEmailId OutgoingEmailId

The outgoing record the copy was filed from.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task

A task that completes when the join is written.

Remarks

The copy is stored like any other message — the owner searches it, reads it, and sees it in a mailbox listing — and this is the one thing that has to be different about it: everything that reacts to newly synchronized mail must not react to a message this deployment itself put there. A rule conditioned on arriving mail would otherwise fire on the owner's own outgoing message the moment its sent copy came back.

It is a join to the outgoing record rather than a flag, because the useful question is which send this copy is of. A flag would answer only the narrow question the rule engine asks, and would have to be joined back to the record anyway by whatever asked the wider one.

Exceptions

ArgumentNullException

Thrown when session is null.

InvalidOperationException

Thrown when no stored email carries storedEmailId.