move method

Future<GenericImapResult> move(
  1. MessageSequence sequence, {
  2. Mailbox? targetMailbox,
  3. String? targetMailboxPath,
})

Moves the specified message(s) from the specified sequence from the currently selected mailbox to the target mailbox.

You must either specify the targetMailbox or the targetMailboxPath, if none is given, move will fail. Compare selectMailbox, selectMailboxByPath or selectInbox for selecting a mailbox first. Compare uidMove for moving messages based on their UID The move command is only available for servers that advertise the MOVE capability.

Implementation

Future<GenericImapResult> move(MessageSequence sequence,
    {Mailbox? targetMailbox, String? targetMailboxPath}) {
  if (targetMailbox == null && targetMailboxPath == null) {
    throw StateError(
        'move() error: Neither targetMailbox nor targetMailboxPath defined.');
  }
  return _copyOrMove('MOVE', sequence,
      targetMailbox: targetMailbox, targetMailboxPath: targetMailboxPath);
}