edgeport - v1.0.3
    Preparing search index...

    Function connect

    • Connects to an IMAP server and logs in, returning a ready session.

      Opens the transport (implicit TLS or STARTTLS), runs LOGIN, and hands back an ImapSession. A failed login surfaces as AuthError; any other protocol-level rejection surfaces as ProtocolError.

      Parameters

      Returns Promise<ImapSession>

      The authenticated session.

      If the server rejects the credentials.

      If the connection cannot be established.

      If the server speaks the protocol incorrectly.

      1.0.0

      import { connect } from 'edgeport/imap';

      await using session = await connect({
      hostname: 'imap.example.com',
      auth: { username: 'me', password: 'secret' }
      });
      await session.select('INBOX');
      const uids = await session.search({ unseen: true });
      const messages = await session.fetch(uids, { flags: true, body: true });