Table of Contents

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

occurrenceId EmailOccurrenceId

The occurrence to move, which must belong to this session's account, folder, and UIDVALIDITY.

destinationPath RemoteFolderPath

The remote path of the folder to move it into.

journal IMailboxMutationJournal

The durable record of this relocation, which the session announces each stage to and resumes from.

cancellationToken CancellationToken

Cancels 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 occurrenceId does not belong to this session.

ArgumentNullException

Thrown when journal is null.

MailboxMutationUnsupportedException

Thrown when the server advertises neither MOVE nor the UIDPLUS the 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.