listSubscribedMailboxes method
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 sub-mailboxes 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,
}) {
// list all folders in that path
final cmd = Command(
'LSUB ${_encodeMailboxPath(path)} ${recursive ? '*' : '%'}',
writeTimeout: defaultWriteTimeout,
responseTimeout: defaultResponseTimeout,
);
final parser = ListParser(serverInfo, isLsubParser: true);
return sendCommand<List<Mailbox>>(cmd, parser);
}