Table of Contents

Method ReadFoldersAsync

Namespace
MailFathom.Application.Mail.Export
Assembly
MailFathom.Application.dll

ReadFoldersAsync(MailAccountId, string?, CancellationToken)

Names every folder of the scope that holds nothing, so the archive still carries an empty Maildir for it.

Task<IReadOnlyList<MailboxExportFolder>> ReadFoldersAsync(MailAccountId account, string? folderPath, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account whose folders are read.

folderPath string

One folder's path to read alone, or null for the whole mailbox.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<MailboxExportFolder>>

Every folder of the scope, whether or not it holds mail.

Remarks

An empty folder is part of a mailbox's shape, and a person restoring the archive onto a server expects the folder they made to still be there. It is read separately from the walk because the walk is ordered by message and a folder with no message would never appear in it.

Exceptions

ArgumentException

Thrown when account names nothing.