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
occurrenceIdEmailOccurrenceIdThe occurrence to copy, which must belong to this session's account, folder, and UIDVALIDITY.
destinationPathRemoteFolderPathThe remote path of the folder to copy it into.
journalIMailboxMutationJournalThe durable record of this copy, which is announced before the command goes out.
cancellationTokenCancellationTokenCancels 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
occurrenceIddoes not belong to this session.- ArgumentNullException
Thrown when
journalis 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.