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; one marked with '*'
8 can repeat (with a different name). |'s indicate alternates (e.g.,
9 int|string means something can be an int or a string).
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 4 of the structured output format.
23 - First versioned schema release.
24 - Added part.content-length and part.content-transfer-encoding fields.
27 - Added the thread_summary.query field.
30 - Replaced message.filename string with a list of filenames.
31 - Added part.content-disposition field.
34 - replace signature error integer bitmask with a set of flags for
36 - (notmuch 0.29) added message.crypto to identify overall message
42 # Number of seconds since the Epoch
45 # Thread ID, sans "thread:"
48 # Message ID, sans "id:"
51 # E-mail header name, sans trailing colon, like "Subject" or "In-Reply-To"
57 # A top-level set of threads (do_show)
58 # Returned by notmuch show without a --part argument
59 thread_set = [thread*]
61 # Top-level messages in a thread (show_messages)
62 thread = [thread_node*]
64 # A message and its replies (show_messages)
66 message|null, # null if not matched and not --entire-thread
67 [thread_node*] # children of message
70 # A message (format_part_sprinter)
72 # (format_message_sprinter)
76 timestamp: unix_time, # date header as unix time
77 date_relative: string, # user-friendly timestamp
82 body?: [part] # omitted if --body=false
85 # when showing the message, was any or all of it decrypted?
86 msgdecstatus: "full"|"partial"
88 # The overall cryptographic state of the message as a whole:
92 # was the set of signatures described under encrypted cover?
94 # which of the headers is covered by sigstatus?
95 headers: [header_name*]
99 # map encrypted headers that differed from the outside headers.
100 # the value of each item in the map is what that field showed externally
101 # (maybe null if it was not present in the external headers).
102 header-mask: { header_name*: string|null }
106 # A MIME part (format_part_sprinter)
108 id: int|string, # part id (currently DFS part number)
110 encstatus?: encstatus,
111 sigstatus?: sigstatus,
113 content-type: string,
114 content-disposition?: string,
116 # if content-type starts with "multipart/":
118 # if content-type is "message/rfc822":
119 content: [{headers: headers, body: [part]}],
120 # otherwise (leaf parts):
122 content-charset?: string,
123 # A leaf part's body content is optional, but may be included if
124 # it can be correctly encoded as a string. Consumers should use
125 # this in preference to fetching the part content separately.
127 # If a leaf part's body content is not included, the length of
128 # the encoded content (in bytes) may be given instead.
129 content-length?: int,
130 # If a leaf part's body content is not included, its transfer encoding
131 # may be given. Using this and the encoded content length, it is
132 # possible for the consumer to estimate the decoded content length.
133 content-transfer-encoding?: string
136 # The headers of a message or part (format_headers_sprinter with reply = FALSE)
147 # Encryption status (format_part_sprinter)
148 encstatus = [{status: "good"|"bad"}]
150 # Signature status (format_part_sigstatus_sprinter)
151 sigstatus = [signature*]
154 # (signature_status_to_string)
155 status: "good"|"bad"|"error"|"unknown",
156 # if status is "good":
157 fingerprint?: string,
161 # if status is not "good":
171 alg-unsupported?: bool,
179 notmuch search schema
180 ---------------------
183 search_summary = [thread_summary*]
186 search_threads = [threadid*]
189 search_messages = [messageid*]
192 search_files = [string*]
195 search_tags = [string*]
199 timestamp: unix_time,
200 date_relative: string, # user-friendly timestamp
201 matched: int, # number of matched messages
202 total: int, # total messages in thread
203 authors: string, # comma-separated names with | between
204 # matched and unmatched
208 # Two stable query strings identifying exactly the matched and
209 # unmatched messages currently in this thread. The messages
210 # matched by these queries will not change even if more messages
211 # arrive in the thread. If there are no matched or unmatched
212 # messages, the corresponding query will be null (there is no
213 # query that matches nothing). (Added in schema version 2.)
214 query: [string|null, string|null],
221 # The headers of the constructed reply
222 reply-headers: reply_headers,
224 # As in the show format (format_part_sprinter)
228 # Reply headers (format_headers_sprinter with reply = TRUE)