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 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:"
54 # A top-level set of threads (do_show)
55 # Returned by notmuch show without a --part argument
56 thread_set = [thread*]
58 # Top-level messages in a thread (show_messages)
59 thread = [thread_node*]
61 # A message and its replies (show_messages)
63 message|null, # null if not matched and not --entire-thread
64 [thread_node*] # children of message
67 # A message (format_part_sprinter)
69 # (format_message_sprinter)
73 timestamp: unix_time, # date header as unix time
74 date_relative: string, # user-friendly timestamp
79 body?: [part] # omitted if --body=false
82 # when showing the message, was any or all of it decrypted?
83 msgdecstatus: "full"|"partial"
85 # The overall cryptographic state of the message as a whole:
89 # was the set of signatures described under encrypted cover?
97 # A MIME part (format_part_sprinter)
99 id: int|string, # part id (currently DFS part number)
101 encstatus?: encstatus,
102 sigstatus?: sigstatus,
104 content-type: string,
105 content-disposition?: string,
107 # if content-type starts with "multipart/":
109 # if content-type is "message/rfc822":
110 content: [{headers: headers, body: [part]}],
111 # otherwise (leaf parts):
113 content-charset?: string,
114 # A leaf part's body content is optional, but may be included if
115 # it can be correctly encoded as a string. Consumers should use
116 # this in preference to fetching the part content separately.
118 # If a leaf part's body content is not included, the length of
119 # the encoded content (in bytes) may be given instead.
120 content-length?: int,
121 # If a leaf part's body content is not included, its transfer encoding
122 # may be given. Using this and the encoded content length, it is
123 # possible for the consumer to estimate the decoded content length.
124 content-transfer-encoding?: string
127 # The headers of a message or part (format_headers_sprinter with reply = FALSE)
138 # Encryption status (format_part_sprinter)
139 encstatus = [{status: "good"|"bad"}]
141 # Signature status (format_part_sigstatus_sprinter)
142 sigstatus = [signature*]
145 # (signature_status_to_string)
146 status: "good"|"bad"|"error"|"unknown",
147 # if status is "good":
148 fingerprint?: string,
152 # if status is not "good":
162 alg-unsupported?: bool,
170 notmuch search schema
171 ---------------------
174 search_summary = [thread_summary*]
177 search_threads = [threadid*]
180 search_messages = [messageid*]
183 search_files = [string*]
186 search_tags = [string*]
190 timestamp: unix_time,
191 date_relative: string, # user-friendly timestamp
192 matched: int, # number of matched messages
193 total: int, # total messages in thread
194 authors: string, # comma-separated names with | between
195 # matched and unmatched
199 # Two stable query strings identifying exactly the matched and
200 # unmatched messages currently in this thread. The messages
201 # matched by these queries will not change even if more messages
202 # arrive in the thread. If there are no matched or unmatched
203 # messages, the corresponding query will be null (there is no
204 # query that matches nothing). (Added in schema version 2.)
205 query: [string|null, string|null],
212 # The headers of the constructed reply
213 reply-headers: reply_headers,
215 # As in the show format (format_part_sprinter)
219 # Reply headers (format_headers_sprinter with reply = TRUE)