deleteMailbox method
Delete a mailbox
Implementation
Future<void> deleteMailbox({
required String folderPath,
required MailboxType type,
}) async {
_logger.fine('Deleting mailbox: $folderPath');
final address = MailboxAddress(
ownerId: host.id,
folderPath: folderPath,
type: type,
);
final request = DeleteMailboxRequest(address: address);
final response = await _sendRequest(request);
if (!response.success) {
throw MailboxManagementError(
response.errorMessage ?? 'Failed to delete mailbox',
);
}
_logger.info('Deleted mailbox: ${address.fullPath}');
}