createMailbox method
Future<void>
createMailbox({
- required String folderPath,
- required MailboxType type,
- int? maxMessages,
- int? retentionDays,
- int? retentionCount,
Create a new mailbox
Implementation
Future<void> createMailbox({
required String folderPath,
required MailboxType type,
int? maxMessages,
int? retentionDays,
int? retentionCount,
}) async {
_logger.fine('Creating mailbox: $folderPath (type: ${type.name})');
final address = MailboxAddress(
ownerId: host.id,
folderPath: folderPath,
type: type,
);
final request = CreateMailboxRequest(
address: address,
maxMessages: maxMessages,
retentionDays: retentionDays,
retentionCount: retentionCount,
);
final response = await _sendRequest(request);
if (!response.success) {
throw MailboxManagementError(
response.errorMessage ?? 'Failed to create mailbox',
);
}
_logger.info('Created mailbox: ${address.fullPath}');
}