uidFetchMessagesByCriteria method

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

Fetches messages by the specified criteria.

This call is more flexible than uidFetchMessages. fetchIdsAndCriteria the requested message UIDs and specification of the requested elements, e.g. '1232:1234 (ENVELOPE)'. Specify a responseTimeout when a response is expected within the given time.

Implementation

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

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