| 1 |
AERC-SEARCH(1) |
| 2 |
|
| 3 |
# NAME |
| 4 |
|
| 5 |
aerc-search - search and filter patterns and options for *aerc*(1) |
| 6 |
|
| 7 |
# SYNTAX |
| 8 |
|
| 9 |
This syntax is common to all backends. |
| 10 |
|
| 11 |
*:filter* [*-rubave*] [*-x* _<flag>_] [*-X* _<flag>_] [*-H* _<header>:[<value>]_] [*-f* _<from>_] [*-t* _<to>_] [*-c* _<cc>_] [*-d* _<start[..end]>_] [_<terms>_...]++ |
| 12 |
*:search* [*-rubave*] [*-x* _<flag>_] [*-X* _<flag>_] [*-H* _<header>:[<value>]_] [*-f* _<from>_] [*-t* _<to>_] [*-c* _<cc>_] [*-d* _<start[..end]>_] [_<terms>_...] |
| 13 |
Searches the current folder for messages matching the given set of |
| 14 |
conditions. |
| 15 |
|
| 16 |
*:filter* restricts the displayed messages to only the search results. |
| 17 |
|
| 18 |
Each space separated term of _<terms>_, if provided, is searched |
| 19 |
case-insensitively among subject lines unless *-b* or *-a* are |
| 20 |
provided. |
| 21 |
|
| 22 |
*-r*: Search for read messages |
| 23 |
|
| 24 |
*-u*: Search for unread messages |
| 25 |
|
| 26 |
*-x* _<flag>_, *-X* _<flag>_: Restrict search to messages with or without _<flag>_ |
| 27 |
Use *-x* to search for messages with the flag set. |
| 28 |
Use *-X* to search for messages without the flag set. |
| 29 |
|
| 30 |
Possible values are: |
| 31 |
_seen_ |
| 32 |
Read messages |
| 33 |
_answered_ |
| 34 |
Replied messages |
| 35 |
_forwarded_ |
| 36 |
Forwarded messages |
| 37 |
_flagged_ |
| 38 |
Flagged messages |
| 39 |
_draft_ |
| 40 |
Draft messages |
| 41 |
|
| 42 |
*-H* _<header>:[<value>]_: |
| 43 |
Search in the headers of the messages for a specific _<header>_ that matches _<value>_, |
| 44 |
_<value>_ can be omitted to only search for a _<header>_. |
| 45 |
If either the _<header>_ or the _<value>_ contain a space then the whole argument needs |
| 46 |
to be escaped with quotes, note: spaces around _<value>_ are trimmed. |
| 47 |
|
| 48 |
*-b*: Search in the body of the messages |
| 49 |
|
| 50 |
*-a*: Search in the entire text of the messages |
| 51 |
|
| 52 |
*-v*: Exclude messages which match this search |
| 53 |
|
| 54 |
*-e*: Instruct the backend to use a custom search extension |
| 55 |
(such as X-GM-EXT-1 if available). Search terms are expected |
| 56 |
in _<terms>_; other flags will be ignored. |
| 57 |
|
| 58 |
*-f* _<from>_: Search for messages from _<from>_ |
| 59 |
|
| 60 |
*-t* _<to>_: Search for messages to _<to>_ |
| 61 |
|
| 62 |
*-c* _<cc>_: Search for messages cc'ed to _<cc>_ |
| 63 |
|
| 64 |
*-d* _<since[..until]>_: |
| 65 |
Search for messages within a particular date range between |
| 66 |
_since_ and _until_, excluding the latter (in mathematical |
| 67 |
notation: search for messages in the [_since_, _until_) |
| 68 |
interval). _until_ can be omitted to only search for _<since>_ |
| 69 |
to present. |
| 70 |
|
| 71 |
Spaces and underscores are allowed in relative dates to improve |
| 72 |
readability. |
| 73 |
|
| 74 |
_YYYY-MM-DD_ |
| 75 |
|
| 76 |
*today*, *yesterday* |
| 77 |
|
| 78 |
*(this|last) (year|month|week)* |
| 79 |
|
| 80 |
*Weekdays*, *Monthnames* |
| 81 |
Can also be abbreviated, so Monday..Tuesday can be written |
| 82 |
as Mon..Tue and February..March as Feb..Mar. |
| 83 |
|
| 84 |
_<N>_ *(y[ear]|m[onth]|w[eek]|d[ay])* |
| 85 |
_<N>_ is a positive integer that represents the number |
| 86 |
of time units in the past. Multiple relative terms |
| 87 |
can be accumulated. The units can also be abbreviated |
| 88 |
by a single letter such that yesterday would |
| 89 |
correspond to _1d_ (equivalent to _1 day_ or _1_day_) |
| 90 |
and _8 days ago_ would be either _1w1d_ or _8d_. |
| 91 |
|
| 92 |
# CUSTOM IMAP EXTENSIONS |
| 93 |
|
| 94 |
The Gmail IMAP extension (X-GM-EXT-1) can be used for searching and filtering. |
| 95 |
To use this custom extension, make sure it is activated (see *aerc-imap*(5)) |
| 96 |
and use the extension *-e* flag in your *:filter* or *:search* commands. |
| 97 |
|
| 98 |
Example: |
| 99 |
|
| 100 |
:filter -e filename:pdf from:bob |
| 101 |
:filter -e has:attachment newer_than:2d |
| 102 |
|
| 103 |
:search -e is:read is:starred |
| 104 |
:search -e list:~rjarry/[email protected] |
| 105 |
|
| 106 |
|
| 107 |
# NOTMUCH |
| 108 |
|
| 109 |
For notmuch, it is possible to avoid using the above flags and only rely on |
| 110 |
notmuch search syntax. |
| 111 |
|
| 112 |
*:filter* _query_...++ |
| 113 |
*:search* _query_... |
| 114 |
You can use the full notmuch query language as described in |
| 115 |
*notmuch-search-terms*(7). |
| 116 |
|
| 117 |
The query will only apply on top of the active folder query. |
| 118 |
|
| 119 |
Example, jump to next unread: |
| 120 |
|
| 121 |
:search tag:unread |
| 122 |
|
| 123 |
# SEE ALSO |
| 124 |
|
| 125 |
*aerc*(1) *aerc-config*(5) |
| 126 |
|
| 127 |
# AUTHORS |
| 128 |
|
| 129 |
Originally created by Drew DeVault and maintained by Robin Jarry who is assisted |
| 130 |
by other open source contributors. For more information about aerc development, |
| 131 |
see _https://sr.ht/~rjarry/aerc/_. |