edgeport - v1.0.3
    Preparing search index...

    Interface ImapSession

    An authenticated IMAP session over a single connection.

    Obtain one from connect. It is an AsyncDisposable, so it can be scoped with await using to guarantee the connection is logged out and closed. Methods issue one tagged command at a time and must not be called concurrently on the same session.

    1.0.0

    interface ImapSession {
        "[asyncDispose]"(): PromiseLike<void>;
        close(): Promise<void>;
        fetch(uids: number[], fields: ImapFetchFields): Promise<ImapMessage[]>;
        listMailboxes(): Promise<string[]>;
        search(query: ImapSearch): Promise<number[]>;
        select(mailbox: string): Promise<{ exists: number; uidValidity: number }>;
    }

    Hierarchy

    • AsyncDisposable
      • ImapSession
    Index
    • Returns PromiseLike<void>

    • Logs out and closes the connection.

      Returns Promise<void>

      Resolves once the socket is closed.

    • Lists the available mailbox names via the LIST command.

      Returns Promise<string[]>

      The mailbox names the server reports.

      If the server rejects the command.

    • Searches the selected mailbox via UID SEARCH.

      Parameters

      Returns Promise<number[]>

      The matching message UIDs.

      If the server rejects the search.

    • Selects a mailbox for subsequent searches and fetches via SELECT.

      Parameters

      • mailbox: string

        The mailbox name (e.g. INBOX).

      Returns Promise<{ exists: number; uidValidity: number }>

      The message count and UID validity reported by the server.

      If the mailbox cannot be selected.