1 This file describes the schemata used for notmuch's structured output
2 format (currently JSON and S-Expressions).
4 []'s indicate lists. List items can be marked with a '?', meaning
5 they are optional; or a '*', meaning there can be zero or more of that
6 item. {}'s indicate an object that maps from field identifiers to
7 values. An object field marked '?' is optional. |'s indicate
8 alternates (e.g., int|string means something can be an int or a
11 For S-Expression output, lists are printed delimited by () instead of
12 []. Objects are printed as p-lists, i.e. lists where the keys and values
13 are interleaved. Keys are printed as keywords (symbols preceded by a
14 colon), e.g. (:id "123" :time 54321 :from "foobar"). Null is printed as
15 nil, true as t and false as nil.
17 This is version 1 of the structured output format.
22 # Number of seconds since the Epoch
25 # Thread ID, sans "thread:"
28 # Message ID, sans "id:"
34 # A top-level set of threads (do_show)
35 # Returned by notmuch show without a --part argument
36 thread_set = [thread*]
38 # Top-level messages in a thread (show_messages)
39 thread = [thread_node*]
41 # A message and its replies (show_messages)
43 message|null, # null if not matched and not --entire-thread
44 [thread_node*] # children of message
47 # A message (format_part_sprinter)
49 # (format_message_sprinter)
53 timestamp: unix_time, # date header as unix time
54 date_relative: string, # user-friendly timestamp
58 body?: [part] # omitted if --body=false
61 # A MIME part (format_part_sprinter)
63 id: int|string, # part id (currently DFS part number)
65 encstatus?: encstatus,
66 sigstatus?: sigstatus,
70 # if content-type starts with "multipart/":
72 # if content-type is "message/rfc822":
73 content: [{headers: headers, body: [part]}],
74 # otherwise (leaf parts):
76 content-charset?: string,
77 # A leaf part's body content is optional, but may be included if
78 # it can be correctly encoded as a string. Consumers should use
79 # this in preference to fetching the part content separately.
81 # If a leaf part's body content is not included, the length of
82 # the encoded content (in bytes) may be given instead.
84 # If a leaf part's body content is not included, its transfer encoding
85 # may be given. Using this and the encoded content length, it is
86 # possible for the consumer to estimate the decoded content length.
87 content-transfer-encoding?: string
90 # The headers of a message or part (format_headers_sprinter with reply = FALSE)
101 # Encryption status (format_part_sprinter)
102 encstatus = [{status: "good"|"bad"}]
104 # Signature status (format_part_sigstatus_sprinter)
105 sigstatus = [signature*]
108 # (signature_status_to_string)
109 status: "none"|"good"|"bad"|"error"|"unknown",
110 # if status is "good":
111 fingerprint?: string,
115 # if status is not "good":
117 # if the signature has errors:
121 notmuch search schema
122 ---------------------
128 threads = [threadid*]
131 messages = [messageid*]
141 timestamp: unix_time,
142 date_relative: string, # user-friendly timestamp
143 matched: int, # number of matched messages
144 total: int, # total messages in thread
145 authors: string, # comma-separated names with | between
146 # matched and unmatched
155 # The headers of the constructed reply
156 reply-headers: reply_headers,
158 # As in the show format (format_part_sprinter)
162 # Reply headers (format_headers_sprinter with reply = TRUE)