selectMailboxByPath method
Future<Mailbox>
selectMailboxByPath(
- String path, {
- bool enableCondStore = false,
- QResyncParameters? qresync,
Selects the specified mailbox.
This allows future search and fetch calls.
path the path or name of the mailbox that should be selected.
Set enableCondStore to true if you want to force-enable CONDSTORE.
This is only possible when the CONDSTORE or QRESYNC capability
is supported.
Specify qresync parameter in case the server supports the QRESYNC
capability and you have known values from the last session.
Note that you need to ENABLE QRESYNC first.
Compare enable
Implementation
Future<Mailbox> selectMailboxByPath(
String path, {
bool enableCondStore = false,
QResyncParameters? qresync,
}) async {
if (serverInfo.pathSeparator == null) {
await listMailboxes();
}
final pathSeparator = serverInfo.pathSeparator ?? '/';
final nameSplitIndex = path.lastIndexOf(pathSeparator);
final name =
nameSplitIndex == -1 ? path : path.substring(nameSplitIndex + 1);
final box = Mailbox(
encodedName: name,
encodedPath: path,
pathSeparator: pathSeparator,
flags: [],
);
return selectMailbox(
box,
enableCondStore: enableCondStore,
qresync: qresync,
);
}