fetchMessagesByCriteria method

Future<FetchImapResult> fetchMessagesByCriteria(
  1. String fetchIdsAndCriteria, {
  2. Duration? responseTimeout,
})

Fetches messages by the specified criteria.

This call is more flexible than fetchMessages. fetchIdsAndCriteria the requested message IDs and specification of the requested elements, e.g. '1:* (ENVELOPE)' or '1:* (FLAGS ENVELOPE) (CHANGEDSINCE 1232232)'. Specify a responseTimeout when a response is expected within the given time.

Implementation

Future<FetchImapResult> fetchMessagesByCriteria(
  String fetchIdsAndCriteria, {
  Duration? responseTimeout,
}) {
  final cmd = Command(
    'FETCH $fetchIdsAndCriteria',
    writeTimeout: defaultWriteTimeout,
    responseTimeout: responseTimeout,
  );
  final parser = FetchParser(isUidFetch: false);

  return sendCommand<FetchImapResult>(cmd, parser);
}