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.
| Operator | Value | Example | Status |
|---|---|---|---|
from: | Name or address of the sender | from:anna | Works |
to: | Name or address in To | to:team@example.com | Works |
cc: | Name or address in Cc | cc:ben | Works |
bcc: | Name or address in Bcc | bcc:ben | Limited: Bcc is not indexed separately, so this searches the To field |
subject: | Text in the subject | subject:invoice | Works |
body: | Text in the message | body:contract | Limited: the text of received messages is not indexed yet |
in: | Folder name or path | in:"Archive 2025" | No effect; use the Search in: bar on the Mac |
account: | Account name or address | account:Work | Command line only |
from-account: | Account name or address | from-account:Work | Command line only; same as account: |
from-identity: | Identity or alias | from-identity:support | No effect |
is: | unread, read, flagged, answered, deleted, draft | is:unread | Works; any other value is treated as a tag, so is:Important equals label:Important |
label: | Tag name | label:important | Works; matches the whole tag name, case-insensitive |
has: | attachment | has:attachment | Error: “This search operator isn’t supported yet. (has:attachment)”. Other values are rejected |
size: | Comparison, number, unit | size:>10M | Works |
before: | Date or relative date | before:2024-06-01 | Works |
after: | Date or relative date | after:7d | Works |
list: | Mailing list ID | list:swift-evolution | No effect |
file: | File extension of an attachment | file:pdf | No 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-01finds messages before 1 June 2024;after:2024-06-01finds messages from 1 June 2024 on, including that day. - A number and a unit counted back from now:
ddays,wweeks,mmonths,yyears.after:7dfinds the last seven days,before:6meverything 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