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
sourceAliasMailFolderAliasThe source folder's alias.
sourceRoleMailFolderSpecialUse?The role the source folder plays, or null where it plays none.
sourceFolderNamestringThe source folder's own name, which a folder created for it takes where it can.
mintIdFunc<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
mintIdis null.- InvalidOperationException
Thrown when the tree lacks a protected folder, which MissingProtectedFolders(Func<LocalMailFolderId>) supplies.