Table of Contents

Interface IMailFolderDeclarationWriter

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

Writes what an account declares about its own folders: which ones it reads, and where each of them is.

public interface IMailFolderDeclarationWriter

Remarks

A mirrored account's folders are declarations rather than rows, so an act on one is a change to what the account says about itself. IMailFolderMappingReader answers what the whole of configuration currently declares, composed from every source; this writes the one layer a person may change, which is the account's own record. What an operator wrote in their own file is theirs and is refused here, which is NotDeclaredByTheAccount.

A declaration is written only once the mail server has carried out the act it describes. That ordering is the whole of the never half an act rule: a refused server leaves nothing written, so no alias is ever left resolving to a folder the server never made, which is the state a mistyped path is supposed to be the only cause of.

The alias is stable across every act. A rename and a move change where the folder is, never what MailFathom calls it, because the alias is what the stored mail, the checkpoints, and the bindings are keyed by — moving it would separate a folder from its own mail to make a tree read more tidily.

Methods

AliasesTheAccountDeclaresAsync(MailAccountId, CancellationToken)

Reads the aliases the account's own record declares, which are the folders this surface may act on.

DeclareAsync(MailAccountId, MailFolderAlias, RemoteFolderPath, MailFolderSpecialUse?, CancellationToken)

Declares one more folder of the account, at a path the mail server now advertises.

FindDeclarationRefusalAsync(MailAccountId, CancellationToken)

Says why the account's own record takes no new folder from this caller, before the mail server is asked to make one.

RepointAsync(MailAccountId, MailFolderAlias, RemoteFolderPath, CancellationToken)

Points a folder the account already declares at the path it has been renamed or moved to.

WithdrawAsync(MailAccountId, MailFolderAlias, CancellationToken)

Withdraws a folder from what the account declares, which takes it out of everything MailFathom reads.