Table of Contents

Method PlaceArrival

Namespace
MailFathom.Domain.Folders
Assembly
MailFathom.Domain.dll

PlaceArrival(MailFolderAlias, MailFolderSpecialUse?, string?, Func<LocalMailFolderId>)

Decides where a message arriving from a source folder goes.

public LocalMailFolderArrival PlaceArrival(MailFolderAlias sourceAlias, MailFolderSpecialUse? sourceRole, string? sourceFolderName, Func<LocalMailFolderId> mintId)

Parameters

sourceAlias MailFolderAlias

The source folder's alias.

sourceRole MailFolderSpecialUse?

The role the source folder plays, or null where it plays none.

sourceFolderName string

The source folder's own name, which a folder created for it takes where it can.

mintId Func<LocalMailFolderId>

Mints the identity of a folder this creates.

Returns

LocalMailFolderArrival

The folder the message goes into, and the folder created for it if any.

Remarks

The source inbox, drafts, sent, junk, and trash go to the local folders playing those roles. Any other source folder corresponds to the local folder created for it the first time a message arrives from it, whatever that folder has been renamed or moved to since; where that folder has been deleted, arrivals go to the inbox. A folder created for a source takes the source's name, then its alias, and where neither can be a top-level name the message goes to the inbox rather than the arrival being refused.

Exceptions

ArgumentNullException

Thrown when mintId is null.

InvalidOperationException

Thrown when the tree lacks a protected folder, which MissingProtectedFolders(Func<LocalMailFolderId>) supplies.