Table of Contents

Method CopyAsync

Namespace
MailFathom.Application.Mail.Mutations
Assembly
MailFathom.Application.dll

CopyAsync(EmailOccurrenceId, RemoteFolderPath, IMailboxMutationJournal, CancellationToken)

Puts a second live occurrence of one email into another folder of the same account.

Task<RemoteEmailPlacement> CopyAsync(EmailOccurrenceId occurrenceId, RemoteFolderPath destinationPath, IMailboxMutationJournal journal, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

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

destinationPath RemoteFolderPath

The remote path of the folder to copy it into.

journal IMailboxMutationJournal

The durable record of this copy, which is announced before the command goes out.

cancellationToken CancellationToken

Cancels the copy.

Returns

Task<RemoteEmailPlacement>

Where the destination folder put the email, when the server named it.

Remarks

A copy issued twice is a second message rather than a repeat of the first, so this operation is never repeated on the caller's behalf. The source occurrence is unchanged, including its remote \Seen flag.

Exceptions

ArgumentException

Thrown when occurrenceId does not belong to this session.

ArgumentNullException

Thrown when journal is null.

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 copy within its configured resilience budget.

MailboxFolderRecreatedException

Thrown when a recovered connection reselected the folder with a different UIDVALIDITY.