Creating Plot Twists
    Preparing search index...

    Type Alias ImapMessage

    A fetched message. Fields are populated based on ImapFetchOptions.

    type ImapMessage = {
        uid: number;
        flags: string[];
        date?: Date;
        subject?: string;
        from?: ImapAddress[];
        to?: ImapAddress[];
        cc?: ImapAddress[];
        messageId?: string;
        inReplyTo?: string;
        references?: string[];
        listId?: string;
        listUnsubscribe?: string;
        precedence?: string;
        autoSubmitted?: string;
        returnPath?: string;
        importance?: string;
        xPriority?: string;
        authenticationResults?: string[];
        bodyText?: string;
        bodyHtml?: string;
        size?: number;
        attachments?: {
            partNumber: string;
            fileName: string;
            mimeType: string;
            size: number;
            encoding: string;
            contentId?: string | null;
            inline?: boolean;
        }[];
    }
    Index

    Properties

    uid: number

    Message UID (stable across sessions if uidValidity hasn't changed)

    flags: string[]

    Message flags (e.g. ["\Seen", "\Flagged"])

    date?: Date

    Internal date of the message

    subject?: string

    Subject header

    from?: ImapAddress[]

    From addresses

    To addresses

    CC addresses

    messageId?: string

    Message-ID header

    inReplyTo?: string

    In-Reply-To header (for threading)

    references?: string[]

    References header (for threading)

    listId?: string

    List-Id header (mailing-list identifier), when present.

    listUnsubscribe?: string

    List-Unsubscribe header, when present.

    precedence?: string

    Precedence header (e.g. "bulk", "list", "auto_reply"), when present.

    autoSubmitted?: string

    Auto-Submitted header (e.g. "auto-generated"), when present.

    returnPath?: string

    Return-Path header; "<>" typically marks a bounce/auto sender.

    importance?: string

    Importance header (e.g. "high"), when present.

    xPriority?: string

    X-Priority header (legacy priority signal), when present.

    authenticationResults?: string[]

    Raw Authentication-Results header values, one per hop that added one — a message can carry several as it passes through multiple mail exchangers. Select the value stamped by your own trusted receiving MTA (by authserv-id) before relying on it for anything security-sensitive (e.g. DMARC verification) — never trust an arbitrary/unfiltered entry, which a sender could forge.

    bodyText?: string

    Plain text body (when requested)

    bodyHtml?: string

    HTML body (when requested)

    size?: number

    Message size in bytes

    attachments?: {
        partNumber: string;
        fileName: string;
        mimeType: string;
        size: number;
        encoding: string;
        contentId?: string | null;
        inline?: boolean;
    }[]

    Attachment parts discovered from the message's BODYSTRUCTURE (populated when body is fetched). Each entry describes one MIME part, not its bytes — partNumber is the IMAP part number (e.g. "2" or "2.1") used to fetch that part's content separately, and encoding is the part's own Content-Transfer-Encoding.

    contentId (angle brackets stripped) and inline describe how the part was carried, so a body image the HTML embeds via cid: can be told apart from a genuine attachment. A part sent without an explicit Content-Disposition but with a Content-ID counts as inline — that is how multipart/related images usually arrive.