Skip to content

Searching ​

sh
mailarc search ARCHIVE 'QUERY' [--sort newest|best] [--limit N] [--conversations] [--facets]

The same search syntax works in the reader app. Search needs the index; build it once with mailarc reindex ARCHIVE. After that, imports and syncs keep it up to date.

Syntax ​

Words without an operator search the subject, text, addresses and attachment names and contents, in German and English: rechnung also finds Rechnungen. Quotes search an exact phrase: "vielen dank".

OperatorFindsExample
from:The sender's name or addressfrom:anna, from:[email protected]
to:A recipient in To, Cc or Bccto:[email protected]
subject:Words in the subjectsubject:invoice
in:Messages in a folderin:Sent, in:"Project X"
label:Messages with a Gmail labellabel:Receipts
has:attachmentMessages with attachments
filename:Attachment namesfilename:pdf
after:, before:Messages from a date on, or before it (UTC)after:2024 before:2025, after:2024-06-15
larger:, smaller:Message sizelarger:5M, smaller:20K
is:flagged, read, unread, spamis:flagged

Combining:

  • Several terms must all match: from:anna invoice.
  • OR, in capitals, matches either: invoice OR rechnung.
  • Parentheses group: from:anna (invoice OR rechnung).
  • A minus excludes: invoice -reminder.
  • OR binds tighter than the implicit AND, as in Gmail: a b OR c means a and (b or c).

Dates take a year, a month or a day: 2024, 2024-06, 2024-06-15. before:2025 ends just before 2025 starts.

Spam stays hidden unless you search is:spam or name its folder with in:.

A mistake in a query, such as an unknown operator or an unmatched quote, is reported with an error code and its position, and the command exits with code 2.

Results ​

  • Results are newest first, or with --sort best most relevant first, 50 at a time. To see more, pass the printed --cursor value to the next search.
  • --conversations shows one row per conversation, with how many of its messages match.
  • --facets adds counts by folder, label, year, month and top senders.

Index maintenance ​

CommandWhen
mailarc reindex ARCHIVEFirst time, or if search reports the index missing or incompatible
mailarc reindex ARCHIVE --catch-upIf search warns that the index is behind the archive
mailarc rethread ARCHIVERarely: after a mailarc update that changes how conversations are grouped

The index can always be rebuilt from the archive. Deleting it loses nothing.