Table of Contents

Class MailRelocationRecorder

Namespace
MailFathom.Application.Mail.Mutations.Authoring
Assembly
MailFathom.Application.dll

Writes down the folder moves a caller asks for, as the mutation records every requester uses.

public sealed class MailRelocationRecorder
Inheritance
MailRelocationRecorder
Inherited Members

Remarks

It is the relocation half of what ADR 0007 permits a caller to author, and it is built exactly as MailFlagChangeRecorder is and for the same reasons: it asks for the grant before it asks about the email, it answers the same question about which mail may be written as about which mail may be read, and it issues no IMAP command at all. The account's own convergence pass carries the record to a completed or a dead-lettered ending, which is what keeps a move crash-safe — the sequence a server without MOVE forces is a copy and a delete, and a record is what stops a crash between the two from losing the message.

The grant is its own, and is not the one that writes flags. A flag misdescribes mail the user can still find; a move puts the mail somewhere else, which is why MailMove is a name a deployment grants separately.

The destination is judged by the same visibility rule as the source. A folder an operator withheld from this caller is no more a destination than it is a source, because filing mail into a folder the caller cannot read would be a way of moving mail out of sight rather than a capability of its own.

The drafts folder is judged by what it holds as well as by who may see it. A draft is a message in the account's drafts folder, so a move into that folder is refused unless the message is already a draft, and a draft is refused a destination with any other role but the trash — the rule a client offers its folders by, held here as well because a client's offer is not a boundary.

Every refusal is a result rather than an exception, because a caller moving several messages at once acts on each answer and carries on with the rest. The one failure that is not about a message is: a caller without the grant gets no answer about any of them, which is the whole request's outcome rather than one item's.

Constructors

MailRelocationRecorder(AccessAuthorization, MailboxScopeResolver, IAuthoredMailboxTargetReader, MailFolderReferenceResolver, MailboxDestinationResolver, IAuthoredDeleteEmailDispositionReader, MailboxChangeSubmission, OptimisticConcurrencyRetryPolicy, MailAccountRunSignal)

Initializes the use case over the grant it asks first, the folder it files into, and the submission it writes through.

Methods

RecordAsync(StoredEmailId, MailFolderAlias, MailboxMutationRequester, CancellationToken)

Writes down one move, against the email and the folder a caller named.