Table of Contents

Class MirroredMailFolderEditor

Namespace
MailFathom.Application.Folders
Assembly
MailFathom.Application.dll

Creates, renames, moves, and deletes the folders of an account whose mail server is the truth.

public sealed class MirroredMailFolderEditor
Inheritance
MirroredMailFolderEditor
Inherited Members

Remarks

Each act reaches the account's mail server and is written into what the account declares only once the server has carried it out. That ordering is the whole of the rule that a refusal is never half an act: a server that says no leaves the declarations exactly as they were, so no alias is ever left naming a folder nobody made.

It acts only on folders the account's own record declares. A folder the deployment's own configuration fixed is refused, because what an operator wrote is theirs; a folder playing a role is refused for every act but creation, because the folder an account files by is not one an earlier act may take away. See ADR 0007, axes L, M, and N.

A creation names no folder the record declares, so it is the one act that rule cannot refuse. It is asked about separately and first: where the account's record takes no new folder from the caller — a settings policy holding its list of folders — the creation is refused before the server is reached, because the declaration follows the server's act and a refusal there would leave a folder standing that the account may never declare.

A folder is named here by the alias it is declared under, and the alias never moves. A rename and a move change where the folder is and never what MailFathom calls it, because the stored mail, the checkpoints, and the bindings are all keyed by the alias — moving it would separate a folder from its own mail so that a tree reads more tidily.

Constructors

MirroredMailFolderEditor(IMailFolderMappingReader, IMailFolderDeclarationWriter, IRemoteFolderCreator, IRemoteFolderEditor, IMailTransportSecurityPolicyReader, IAuthoredFolderDeleteDispositionReader, ClientSignals, IJobStore, AccessAuthorization)

Initializes a new instance of the MirroredMailFolderEditor class.

Methods

CreateAsync(MailAccountId, MailFolderAlias?, string?, MailFolderSpecialUse?, CancellationToken)

Creates a folder on the mail server and declares it.

DeleteAsync(MailAccountId, MailFolderAlias, CancellationToken)

Deletes a folder, on the mail server as well where the account's setting says so.

MoveAsync(MailAccountId, MailFolderAlias, MailFolderAlias?, CancellationToken)

Moves a folder, with everything beneath it, and points its declaration at the new path.

ReadAsync(MailAccountId, CancellationToken)

Reads the account's folders and the acts each of them allows.

RenameAsync(MailAccountId, MailFolderAlias, string?, CancellationToken)

Renames a folder on the mail server and points its declaration at the new path.