Method StartAsync
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
StartAsync(MailAccountId, string?, CancellationToken)
Records an export and queues the work that writes its archive.
public Task<MailboxExportStart> StartAsync(MailAccountId account, string? folderPath, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account to export.
folderPathstringOne folder's path to export alone, or null for the whole mailbox.
cancellationTokenCancellationTokenCancels the request.
Returns
- Task<MailboxExportStart>
The measurement the decision was taken on, and the export now recorded.
Remarks
An export of the same scope that is already being written is answered with itself rather than started over, which is what makes asking twice the same as asking once. A second scope is refused instead, because an account writes one archive at a time.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold the export permission.
- MailboxExportRefusedException
Thrown when this deployment has nowhere to keep an archive, the export is past a configured bound, or the account is already exporting a different scope.