Searching mail¶
Search is the spine of Antiphon: every listing is a notmuch
query. The sidebar's built-in views (all, inbox, unread,
flagged), your saved searches, and the
bulk actions all run through the
same engine, so one query language covers everything and every
answer comes from the local index, instantly and offline.
The prompt¶
/ opens the search prompt; type a query and Enter
runs it, Esc abandons it. A blank query (or a single *)
lists everything in scope.
A search never leaves the current scope: the unified view
searches every account, a scoped view searches its account
alone. Switch scope with gt / gT, g1..g9 or gu, and
the same query answers differently. Antiphon wraps your query
so it cannot escape the scope; a query with unbalanced quotes
or parentheses is rejected with an error rather than run with
a different meaning.
Words and phrases¶
Bare words match the body, the subject and the sender and recipient headers, and every word must match:
invoice unpaid
A quoted phrase matches those words in that order:
subject:"quarterly report"
English words are stemmed (detail finds details and
detailed); a capitalised word is searched exactly, so Alba
does not find albacore. A trailing * completes a word:
wild* matches wildcard and wildcat.
Prefixes¶
A prefix pins a term to one part of the message:
| Prefix | Matches |
|---|---|
from: |
the sender's name or address |
to: |
any recipient: To, Cc or Bcc |
subject: |
words or a quoted phrase in the subject |
body: |
words in the body alone |
tag: |
a notmuch tag: unread, flagged, ones your rules add |
folder: |
a maildir folder, account name first (see below) |
path: |
a store directory; path:work/** is the whole account |
date: |
a date or date range (see below) |
attachment: |
an attachment's file name or extension |
mimetype: |
a MIME part's content type |
id: |
a Message-ID, without the angle brackets |
thread: |
a notmuch thread id |
Folder paths are as the store knows them: lowercase,
/-separated, with the account name first. folder:personal
is the personal account's inbox (its root maildir), and
folder:personal/lists/aerc one of its subfolders.
from:alba tag:unread
attachment:pdf subject:invoice
folder:work/receipts date:2026-06
Dates¶
date: takes a single expression or a .. range, either end
open:
date:2026-06 the whole of June
date:2026-01..2026-06 January through June
date:2026-06.. since June
date:..yesterday up to the end of yesterday
Relative expressions work too (date:yesterday,
date:monday, date:last_week); write any spaces as
underscores inside a range.
Combining terms¶
Terms combine with and, or and not, and parentheses
group them; plain adjacency means and:
tag:unread and (from:alba or from:finn)
subject:invoice not folder:personal/receipts
Regular expressions¶
from:, subject:, tag:, path:, folder: and mid:
also take a regular expression between slashes:
from:/@example[.](com|net)$/
subject:/^\[PATCH/
This needs a notmuch built against a Xapian with field processors (Xapian 1.4 or later), which is true of current distribution packages.
Saved searches¶
A query you run daily earns a sidebar entry:
[[saved_searches]]
name = "invoices"
query = "tag:invoices or subject:invoice"
Saved searches live in config.toml (see
configuration) and
run inside whatever scope is active when you open them.
Acting on a whole search¶
A search result is also a unit you can act on: the
:trash-all, :archive-all, :move-all and :delete-all
commands apply to every message the current query matches,
behind a confirmation that shows the exact count. See
bulk actions.