listSubscribedMailboxes method

Future<List<Mailbox>> listSubscribedMailboxes({
  1. String path = '""',
  2. bool recursive = false,
})

Lists all subscribed mailboxes

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 submailboxes are also listed. The LIST command will set the serverInfo.pathSeparator as a side-effect

Implementation

Future<List<Mailbox>> listSubscribedMailboxes(
    {String path = '""', bool recursive = false}) {
  path = _encodeMailboxPath(path);
  final cmd = Command('LSUB $path ' +
      (recursive ? '*' : '%')); // list all folders in that path
  final parser = ListParser(serverInfo, isLsubParser: true);
  return sendCommand<List<Mailbox>>(cmd, parser);
}