login method

Future<List<Capability>> login(
  1. String name,
  2. String password
)

Logs in the user with the given name and password.

Requires the IMAP service to support AUTH=PLAIN capability.

Implementation

Future<List<Capability>> login(String name, String password) async {
  final cmd = Command(
    'LOGIN "$name" "$password"',
    logText: 'LOGIN "$name" "(password scrambled)"',
    writeTimeout: defaultWriteTimeout,
    responseTimeout: defaultResponseTimeout,
  );
  final parser = CapabilityParser(serverInfo);
  final response = await sendCommand<List<Capability>>(cmd, parser);
  isLoggedIn = true;

  return response;
}