1 This file describes the schemata used for notmuch's structured output
2 format (currently JSON).
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
14 # Number of seconds since the Epoch
17 # Thread ID, sans "thread:"
20 # Message ID, sans "id:"
26 # A top-level set of threads (do_show)
27 # Returned by notmuch show without a --part argument
28 thread_set = [thread*]
30 # Top-level messages in a thread (show_messages)
31 thread = [thread_node*]
33 # A message and its replies (show_messages)
35 message?, # present if --entire-thread or matched
36 [thread_node*] # children of message
39 # A message (show_message)
41 # (format_message_json)
45 timestamp: unix_time, # date header as unix time
46 date_relative: string, # user-friendly timestamp
53 # A MIME part (show_message_body)
55 # format_part_start_json
56 id: int|string, # part id (currently DFS part number)
58 # format_part_encstatus_json
59 encstatus?: encstatus,
61 # format_part_sigstatus_json
62 sigstatus?: sigstatus,
64 # format_part_content_json
67 # if content-type starts with "multipart/":
69 # if content-type is "message/rfc822":
70 content: [{headers: headers, body: [part]}],
71 # otherwise (leaf parts):
73 content-charset?: string,
74 # A leaf part's body content is optional, but may be included if
75 # it can be correctly encoded as a string. Consumers should use
76 # this in preference to fetching the part content separately.
80 # The headers of a message (format_headers_json with raw headers) or
81 # a part (format_headers_message_part_json with pretty-printed headers)
91 # Encryption status (format_part_encstatus_json)
92 encstatus = [{status: "good"|"bad"}]
94 # Signature status (format_part_sigstatus_json)
95 sigstatus = [signature*]
98 # signature_status_to_string
99 status: "none"|"good"|"bad"|"error"|"unknown",
100 # if status is "good":
101 fingerprint?: string,
105 # if status is not "good":
107 # if the signature has errors:
111 notmuch search schema
112 ---------------------
118 threads = [threadid*]
121 messages = [messageid*]
131 timestamp: unix_time,
132 date_relative: string, # user-friendly timestamp
133 matched: int, # number of matched messages
134 total: int, # total messages in thread
135 authors: string, # comma-separated names with | between
136 # matched and unmatched