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 2 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.
32 # Number of seconds since the Epoch
35 # Thread ID, sans "thread:"
38 # Message ID, sans "id:"
44 # A top-level set of threads (do_show)
45 # Returned by notmuch show without a --part argument
46 thread_set = [thread*]
48 # Top-level messages in a thread (show_messages)
49 thread = [thread_node*]
51 # A message and its replies (show_messages)
53 message|null, # null if not matched and not --entire-thread
54 [thread_node*] # children of message
57 # A message (format_part_sprinter)
59 # (format_message_sprinter)
63 timestamp: unix_time, # date header as unix time
64 date_relative: string, # user-friendly timestamp
68 body?: [part] # omitted if --body=false
71 # A MIME part (format_part_sprinter)
73 id: int|string, # part id (currently DFS part number)
75 encstatus?: encstatus,
76 sigstatus?: sigstatus,
80 # if content-type starts with "multipart/":
82 # if content-type is "message/rfc822":
83 content: [{headers: headers, body: [part]}],
84 # otherwise (leaf parts):
86 content-charset?: string,
87 # A leaf part's body content is optional, but may be included if
88 # it can be correctly encoded as a string. Consumers should use
89 # this in preference to fetching the part content separately.
91 # If a leaf part's body content is not included, the length of
92 # the encoded content (in bytes) may be given instead.
94 # If a leaf part's body content is not included, its transfer encoding
95 # may be given. Using this and the encoded content length, it is
96 # possible for the consumer to estimate the decoded content length.
97 content-transfer-encoding?: string
100 # The headers of a message or part (format_headers_sprinter with reply = FALSE)
111 # Encryption status (format_part_sprinter)
112 encstatus = [{status: "good"|"bad"}]
114 # Signature status (format_part_sigstatus_sprinter)
115 sigstatus = [signature*]
118 # (signature_status_to_string)
119 status: "none"|"good"|"bad"|"error"|"unknown",
120 # if status is "good":
121 fingerprint?: string,
125 # if status is not "good":
127 # if the signature has errors:
131 notmuch search schema
132 ---------------------
135 search_summary = [thread_summary*]
138 search_threads = [threadid*]
141 search_messages = [messageid*]
144 search_files = [string*]
147 search_tags = [string*]
151 timestamp: unix_time,
152 date_relative: string, # user-friendly timestamp
153 matched: int, # number of matched messages
154 total: int, # total messages in thread
155 authors: string, # comma-separated names with | between
156 # matched and unmatched
160 # Two stable query strings identifying exactly the matched and
161 # unmatched messages currently in this thread. The messages
162 # matched by these queries will not change even if more messages
163 # arrive in the thread. If there are no matched or unmatched
164 # messages, the corresponding query will be null (there is no
165 # query that matches nothing). (Added in schema version 2.)
166 query: [string|null, string|null],
173 # The headers of the constructed reply
174 reply-headers: reply_headers,
176 # As in the show format (format_part_sprinter)
180 # Reply headers (format_headers_sprinter with reply = TRUE)