Method RelocateAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
RelocateAsync(EmailOccurrenceId, RemoteFolderPath, IMailboxMutationJournal, CancellationToken)
Moves one email out of this session's folder and into another folder of the same account.
Task<RemoteEmailPlacement> RelocateAsync(EmailOccurrenceId occurrenceId, RemoteFolderPath destinationPath, IMailboxMutationJournal journal, CancellationToken cancellationToken)
Parameters
occurrenceIdEmailOccurrenceIdThe occurrence to move, which must belong to this session's account, folder, and UIDVALIDITY.
destinationPathRemoteFolderPathThe remote path of the folder to move it into.
journalIMailboxMutationJournalThe durable record of this relocation, which the session announces each stage to and resumes from.
cancellationTokenCancellationTokenCancels the relocation.
Returns
- Task<RemoteEmailPlacement>
Where the destination folder put the email, when the server named it.
Remarks
The remote \Seen flag of the email is not part of this operation and is left exactly as the server holds
it, on either protocol path. Filing a message is not a statement that anyone read it.
Exceptions
- ArgumentException
Thrown when
occurrenceIddoes not belong to this session.- ArgumentNullException
Thrown when
journalis null.- MailboxMutationUnsupportedException
Thrown when the server advertises neither
MOVEnor theUIDPLUSthe fallback needs to remove only the moved message.- MailboxDestinationFolderMissingException
Thrown when the server holds no folder at
destinationPath, which is settled rather than deferred.- MailboxUnavailableException
Thrown when the mail server did not serve the relocation within its configured resilience budget.
- MailboxFolderRecreatedException
Thrown when a recovered connection reselected the folder with a different UIDVALIDITY.