Early access

Search operators

Every search operator with its values, an example and whether it filters in the app today.

An operator is a name, a colon and a value, without a space: from:anna. Operator names are not case-sensitive. Quote values that contain spaces: subject:"annual report". The syntax page explains how to combine operators.

Reference

The status column says what the operator does in the app on macOS, iPhone and iPad today.

  • Works: filters as described.
  • Limited: filters, with the restriction noted.
  • Command line only: filters only in the foldmail command line, not in the app.
  • No effect: accepted, but not evaluated. The search runs as if the operator were not there.
  • Error: the search stops with a message.
OperatorValueExampleStatus
from:Name or address of the senderfrom:annaWorks
to:Name or address in Toto:team@example.comWorks
cc:Name or address in Cccc:benWorks
bcc:Name or address in Bccbcc:benLimited: Bcc is not indexed separately, so this searches the To field
subject:Text in the subjectsubject:invoiceWorks
body:Text in the messagebody:contractLimited: the text of received messages is not indexed yet
in:Folder name or pathin:"Archive 2025"No effect; use the Search in: bar on the Mac
account:Account name or addressaccount:WorkCommand line only
from-account:Account name or addressfrom-account:WorkCommand line only; same as account:
from-identity:Identity or aliasfrom-identity:supportNo effect
is:unread, read, flagged, answered, deleted, draftis:unreadWorks; any other value is treated as a tag, so is:Important equals label:Important
label:Tag namelabel:importantWorks; matches the whole tag name, case-insensitive
has:attachmenthas:attachmentError: “This search operator isn’t supported yet. (has:attachment)”. Other values are rejected
size:Comparison, number, unitsize:>10MWorks
before:Date or relative datebefore:2024-06-01Works
after:Date or relative dateafter:7dWorks
list:Mailing list IDlist:swift-evolutionNo effect
file:File extension of an attachmentfile:pdfNo effect

The predefined smart folder With attachment uses has:attachment and currently shows the same error.

Sizes

size: compares the size of the whole message as reported by the server. Use >, >=, <, <= or =; without a comparison the size must match exactly. K, M and G stand for 1,024, 1,048,576 and 1,073,741,824 bytes; without a unit the number is in bytes.

size:>10M
size:<=500K
size:>=1G

Dates

before: and after: accept two forms:

  • A calendar date as YYYY-MM-DD, read as midnight UTC. before:2024-06-01 finds messages before 1 June 2024; after:2024-06-01 finds messages from 1 June 2024 on, including that day.
  • A number and a unit counted back from now: d days, w weeks, m months, y years. after:7d finds the last seven days, before:6m everything older than six months.

Other forms, such as before:2024-06, are not dates and stop the search with a parse error. FOLD compares the date in the message header, or the server’s arrival date if the header has none.

after:2024-01-01 before:2024-04-01
before:1y size:>5M

Excluding

A minus in front of an operator currently works only for status values, such as -is:read. For the other operators it either causes an error or is ignored; the syntax page lists the details.

Operators without effect

A query that consists only of operators without effect, such as in:INBOX or list:announce, matches every message. Keep this in mind for filter rules, where such a condition would act on all mail.

Examples

from:anna subject:budget after:30d
from:newsletter@example.com -is:flagged
(from:anna OR from:ben) is:flagged
label:project-x before:3m