jmap-kit
    Preparing search index...

    Type Alias EmailObjectSettable

    EmailObject properties that may be set via an Email/set call

    type EmailObjectSettable = {
        attachments: Omit<EmailBodyPart, "subParts">[];
        bcc?: EmailAddress[] | null;
        bodyStructure: EmailBodyPart;
        bodyValues: Record<string, EmailBodyValue>;
        cc?: EmailAddress[] | null;
        from?: EmailAddress[] | null;
        htmlBody: EmailBodyPart[];
        inReplyTo?: string[] | null;
        keywords?: Record<JMAPKeywords, true> | Record<string, true>;
        mailboxIds: Record<Id, true>;
        messageId?: string[] | null;
        receivedAt?: UTCDate;
        references?: string[] | null;
        replyTo?: EmailAddress[] | null;
        sender?: EmailAddress[] | null;
        sentAt?: TZDate | null;
        subject?: string | null;
        textBody: EmailBodyPart[];
        to?: EmailAddress[] | null;
    }
    Index

    Properties

    attachments: Omit<EmailBodyPart, "subParts">[]

    (immutable) A list, traversing depth-first, of all parts in bodyStructure that satisfy either of the following conditions:

    • not of type multipart/* and not included in textBody or htmlBody
    • of type image/, audio/, or video/* and not in both textBody and htmlBody

    None of these parts include subParts, including message/* types. Attached messages may be fetched using the Email/parse method and the blobId.

    Note that a text/html body part HTML may reference image parts in attachments by using cid: links to reference the Content-Id, as defined in RFC 2392, or by referencing the Content-Location.

    bcc?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:Bcc:asAddresses.

    bodyStructure: EmailBodyPart

    (immutable) This is the full MIME structure of the message body, without recursing into message/rfc822 or message/global parts. Note that EmailBodyParts may have subParts if they are of type multipart/*.

    bodyValues: Record<string, EmailBodyValue>

    (immutable) This is a map of partId to an EmailBodyValue object for none, some, or all text/* parts. Which parts are included and whether the value is truncated is determined by various arguments to Email/get and Email/parse.

    cc?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:Cc:asAddresses.

    from?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:From:asAddresses.

    htmlBody: EmailBodyPart[]

    (immutable) A list of text/plain, text/html, image/, audio/, and/or video/* parts to display (sequentially) as the message body, with a preference for text/html when alternative versions are available.

    inReplyTo?: string[] | null

    (immutable) The value is identical to the value of header:In-Reply-To:asMessageIds.

    keywords?: Record<JMAPKeywords, true> | Record<string, true>

    (default: {}) A set of keywords that apply to the Email. The set is represented as an object, with the keys being the keywords. The value for each key in the object MUST be true.

    Keywords are shared with IMAP. The six system keywords from IMAP get special treatment. The following four keywords have their first character changed from \ in IMAP to $ in JMAP and have particular semantic meaning:

    • $draft: The Email is a draft the user is composing.
    • $seen: The Email has been read.
    • $flagged: The Email has been flagged for urgent/special attention.
    • $answered: The Email has been replied to.

    The IMAP \Recent keyword is not exposed via JMAP. The IMAP \Deleted keyword is also not present: IMAP uses a delete+expunge model, which JMAP does not.

    Users may add arbitrary keywords to an Email. For compatibility with IMAP, a keyword is a case-insensitive string of 1–255 characters in the ASCII subset %x21–%x7e (excludes control chars and space), and it MUST NOT include any of these characters:

    ( ) { ] % * "

    Because JSON is case sensitive, servers MUST return keywords in lowercase.

    The IMAP and JMAP Keywords registry as established in RFC 5788 assigns semantic meaning to some other keywords in common use.

    New keywords may be established here in the future. In particular, note:

    • $forwarded: The Email has been forwarded.
    • $phishing: The Email is highly likely to be phishing. Clients SHOULD warn users to take care when viewing this Email and disable links and attachments.
    • $junk: The Email is definitely spam. Clients SHOULD set this flag when users report spam to help train automated spam-detection systems.
    • $notjunk: The Email is definitely not spam. Clients SHOULD set this flag when users indicate an Email is legitimate, to help train automated spam-detection systems.
    mailboxIds: Record<Id, true>

    The set of Mailbox ids this Email belongs to. An Email in the mail store MUST belong to one or more Mailboxes at all times (until it is destroyed). The set is represented as an object, with each key being a Mailbox id. The value for each key in the object MUST be true.

    messageId?: string[] | null

    (immutable) The value is identical to the value of header:Message-ID:asMessageIds. For messages conforming to RFC 5322 this will be an array with a single entry.

    receivedAt?: UTCDate

    (immutable; default: time of creation on server) The date the Email was received by the message store. This is the internal date in IMAP RFC 3501.

    references?: string[] | null

    (immutable) The value is identical to the value of header:References:asMessageIds.

    replyTo?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:Reply-To:asAddresses.

    sender?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:Sender:asAddresses.

    sentAt?: TZDate | null

    (immutable; default on creation: current server time) The value is identical to the value of header:Date:asDate.

    subject?: string | null

    (immutable) The value is identical to the value of header:Subject:asText.

    textBody: EmailBodyPart[]

    (immutable) A list of text/plain, text/html, image/, audio/, and/or video/* parts to display (sequentially) as the message body, with a preference for text/plain when alternative versions are available.

    to?: EmailAddress[] | null

    (immutable) The value is identical to the value of header:To:asAddresses.