edgeport - v1.0.3
    Preparing search index...

    Function fetchRecent

    • Connects, selects a mailbox, and fetches the most recent messages, then logs out.

      A one-shot convenience over connect: it selects the mailbox (defaulting to INBOX), takes the highest-numbered count messages, fetches their flags and bodies, and closes the connection before returning.

      Parameters

      • opts: ImapConnectOptions & { count: number; mailbox?: string }

        Connection options plus the mailbox and message count.

      Returns Promise<ImapMessage[]>

      Up to count recent messages, oldest first.

      If the server rejects the credentials.

      If the connection cannot be established.

      If the server speaks the protocol incorrectly.

      1.0.0

      import { fetchRecent } from 'edgeport/imap';

      const recent = await fetchRecent({
      hostname: 'imap.example.com',
      auth: { username: 'me', password: 'secret' },
      count: 10
      });