Method DeleteAsync
- Namespace
- MailFathom.Application.Mail.Export
- Assembly
- MailFathom.Application.dll
DeleteAsync(MailAccountId, MailboxExportId, CancellationToken)
Deletes a finished export's archive before its retention period ends.
public Task<MailboxExport> DeleteAsync(MailAccountId account, MailboxExportId export, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account the export belongs to.
exportMailboxExportIdThe export's identity.
cancellationTokenCancellationTokenCancels the request.
Returns
- Task<MailboxExport>
The export as it now stands.
Remarks
Deleting an archive that has already expired or been deleted is not an error, because the caller asked for a state the deployment is already in — which is exactly what an operator deleting after a download wants to be able to repeat. An export still being written is cancelled instead, since there is no archive to delete yet.
Exceptions
- PrincipalNotAuthorizedException
Thrown when the caller does not hold the export permission.
- MailboxExportRefusedException
Thrown when the account holds no export under that identity.