Table of Contents

Class LocalMailFiler

Namespace
MailFathom.Application.Mail.Delivery.Filing
Assembly
MailFathom.Application.dll

Files a draft or a sent copy into the local folder of an account whose mailbox MailFathom holds alone.

public sealed class LocalMailFiler
Inheritance
LocalMailFiler
Inherited Members

Remarks

It is the held account's counterpart of MailboxCopyAppender, and the reason it exists is the same one that makes appending wrong there: the source is drained, so a copy appended to it would be drained straight back and would make filing wait on IMAP. What is written instead is a stored message in the local folder playing the role, in the transaction that settles the draft revision or the delivery the message is a copy of — so there is no moment at which one is committed and the other is not, and nothing to resume between them.

No IMAP command is issued by anything here, and nothing here decides whether an account is held on the strength of what it read before the transaction: FileAsync(IPersistenceSession, LocalMailCopy, OutgoingEmailId?, CancellationToken) reads the account's phase again inside it and files nothing where the account has stopped being held.

Constructors

LocalMailFiler(ILocalMailFolderStore, IEmailMetadataRepository, IEmailContentStore, IEmailMimeReader, IMailFolderMappingReader, IMailFolderResolutionStore, IOutgoingMailFilingPolicyReader, IOutgoingMailFilingStore, ClientSignals, TimeProvider)

Initializes the filer from the stores a filed message is written through.

Methods

Announce(FiledLocalEmail)

Tells the account's clients what a committed filing changed.

AnnounceErased(MailAccountId, MailFolderAlias, StoredEmailId)

Tells the account's clients that a committed transaction erased a filed message.

EraseAsync(IPersistenceSession, MailAccountId, StoredEmailId, CancellationToken)

Erases a message filed earlier, inside the transaction that replaces or gives up what it showed.

FileAsync(IPersistenceSession, LocalMailCopy, OutgoingEmailId?, CancellationToken)

Files a prepared copy into the local folder playing its role, inside the transaction it belongs to.

HoldsAsync(MailAccountId, CancellationToken)

Reports whether MailFathom holds the account's mailbox alone, which is when its copies are filed here.

PrepareAsync(MailAccountId, OutgoingMailFiling, ReadOnlyMemory<byte>, CancellationToken)

Reads and places a message for filing, before the transaction that files it.

PrepareDraftAsync(MailDraftRecord, CancellationToken)

Prepares the local copy of a draft revision written before its account's copy could be filed.

PrepareSentCopyAsync(OutgoingEmailRecord, CancellationToken)

Prepares the sent copy of a delivered message, where its account is held and files one.

RecordSentCopyUnfiledAsync(OutgoingEmailId)

Records that a prepared sent copy was not filed, because the transaction found nowhere to put it.