listMailboxes method

Future<List<Mailbox>> listMailboxes({
  1. String path = '""',
  2. bool recursive = false,
  3. List<String>? mailboxPatterns,
  4. List<String>? selectionOptions,
  5. List<ReturnOption>? returnOptions,
})

Lists all mailboxes in the given path.

The path default to "", meaning the currently selected mailbox, if there is none selected, then the root is used.

When recursive is true, then all sub-mailboxes are also listed.

When specified, mailboxPatterns overrides the recursive options and provides a list of mailbox patterns to include.

The selectionOptions allows extended options to be supplied to the command.

The returnOptions lists the extra results that should be returned by the extended list enabled servers.

The LIST command will set the serverInfo.pathSeparator as a side-effect.

Implementation

Future<List<Mailbox>> listMailboxes(
        {String path = '""',
        bool recursive = false,
        List<String>? mailboxPatterns,
        List<String>? selectionOptions,
        List<ReturnOption>? returnOptions}) =>
    listMailboxesByReferenceAndName(path, recursive ? '*' : '%',
        mailboxPatterns, selectionOptions, returnOptions);