Skip to content

buildSearchString

buildSearchString(query): string

Defined in: src/provider/mcp/query.ts:24

Compile a SearchQuery to Fastmail’s Gmail-style search DSL.

Session-proven quirks encoded here:

  • -from: takes LITERAL addresses only — domain negation is silently ignored by the server, so callers must re-check keep-lists client-side (caps.serverSideNotFrom === ‘address-only’).
  • after:YYYY-MM-DD is the only date operator that works.
  • Operator values are whitespace-tokenized by the server: an unquoted spaced label (in:Needs action) parses as in:Needs plus the free-text term action — silently wrong scope. Values containing whitespace are therefore double-quoted. text stays unquoted on purpose: it is a bag of free-text terms, not a phrase.

Parts are space-joined in stable order: in, text, from, notFrom…, after, is:unread.

SearchQuery

string