In case the input for a given DAG node is an email stream, the data for the given email will be in JMAP format with the key being the message id and the value the JMAP object.

You can read more about the JMAP Spec here but as it is not final yet we have listed here all the parameters we currently support for clarity.

Message object

FieldTypeDescription
idStringThe id of the message.
threadIdStringThe id of the thread to which this message belongs. It can be empty if the server doesn’t support threading.
mailboxIdsString[]The ids of the mailboxes the message is in.
inReplyToMessageIdString | nullThe id of the Message this message is a reply to. This is primarily for drafts, but the server MAY support this for received messages as well by looking up the RFC2822 Message-Id referenced in the In-Reply-To header and searching for this message in the user’s mail.
isUnreadBooleanHas the message not yet been read? This corresponds to the opposite of the \Seen system flag in IMAP.
isFlaggedBooleanIs the message flagged? This corresponds to the \Flagged system flag in IMAP.
isAnsweredBooleanHas the message been replied to? This corresponds to the \Answered system flag in IMAP.
isDraftBooleanIs the message a draft? This corresponds to the \Draft system flag in IMAP.
hasAttachmentBooleanDoes the message have any attachments?
headersString[String]A map of header name to (decoded) header value for all headers in the message. For headers that occur multiple times (e.g. Received), the values are concatenated with a single new line (\n) character in between each one.
fromEmailer | nullAn Emailer object containing the name/email from the parsed From header of the email. If the email doesn’t have a From header, this is null.
toEmailer[] | nullAn array of Emailer objects representing the parsed To header of the email, in the same order as they appear in the header. If the email doesn’t have a To header, this is null. If the header exists but does not have any content, the response is an array of zero length.
ccEmailer[] | nullAn array of Emailer objects representing the parsed Cc header of the email, in the same order as they appear in the header. If the email doesn’t have a Cc header, this is null. If the header exists but does not have any content, the response is an array of zero length.
bccEmailer[] | nullAn array of Emailer objects representing the parsed Bcc header of the email. If the email doesn’t have a Bcc header (which will be true for most emails outside of the Sent mailbox), this is null. If the header exists but does not have any content, the response is an array of zero length.
replyToEmailer | nullAn Emailer object containing the name/email from the parsed Reply-To header of the email. If the email doesn’t have a Reply-To header, this is null.
subjectStringThe subject of the message.
dateDateThe date the message was sent (or saved, if the message is a draft).
sizeNumberThe RFC822 size in bytes of the whole message as counted by the server towards the user’s quota.
previewString | nullUp to 256 characters of the beginning of a plain text version of the message body. This is intended to be shown as a preview line on a mailbox listing, and the server may choose to skip quoted sections or salutations to return a more useful preview. The server may decide to skip the preview altogether if it cannot reliably sanitise the email body.
textBodyString | nullThe plain text body part for the message if present and requested in wants of the sifts.json filter.
htmlBodyString | nullThe HTML body part for the message if present and requested in wants of the sifts.json filter.
attachmentsAttachment[] | nullAn array of Attachment objects detailing all the attachments to the message.

We have also added a few extensions to the JMAP specification to make data processing simpler, namely:

FieldTypeDescription
strippedHtmlBodyString | nullThe stripped HTML (the HTML tags are removed) body part for the message if requested in wants of the sifts.json filter.
userEmailerThe Sift user information, i.e.: {email: [email protected]}

Emailer object

FieldTypeDescription
nameStringThe name of the sender/recipient. If a name cannot be extracted for an email, this property is an empty string.
emailStringThe email address of the sender/recipient.

Attachment object

FieldTypeDescription
blobIdStringThe id of the attachment. When combined with the wants and large-storage environment variable this gives you the file to read the contents of the attachment from.
typeStringThe content-type of the attachment.
nameStringThe full file name, e.g. “myworddocument.doc”
sizeNumberThe size, in bytes, of the attachment when fully decoded (i.e. the number of bytes in the file the user would download).
isInlineBooleanTrue if the attachment is referenced by a cid: link from within the HTML body of the message.