uidExpunge method

Future<Mailbox?> uidExpunge(
  1. MessageSequence sequence
)

Expunges (deletes) any messages that are in the specified sequence AND marked as deleted.

The UID EXPUNGE command permanently removes all messages that have the \Deleted flag set AND that in the the defined UID-range from the currently selected mailbox. Before returning an OK to the client, an untagged EXPUNGE response is sent for each message that is removed.

The UID EXPUNGE command is only available for servers that expose the UIDPLUS capability.

Implementation

Future<Mailbox?> uidExpunge(MessageSequence sequence) {
  final buffer = StringBuffer()..write('UID EXPUNGE ');
  sequence.render(buffer);
  final cmd = Command(
    buffer.toString(),
    writeTimeout: defaultWriteTimeout,
    responseTimeout: defaultResponseTimeout,
  );
  return sendCommand<Mailbox?>(cmd, NoopParser(this, _selectedMailbox));
}