<info> <desc>Searching messages.</desc> Max Vorobuov vmax0770@gmail.com Andre Klapper ak-47@gmx.net Novell, Inc </info>
Searching in a Single Message

To find text in the displayed message, select <guiseq><gui>Edit</gui><gui>Find in Message…</gui></guiseq> from the main menu.

Searching Across Messages

Quick Search

In the mail view, you can quickly search for messages by defining conditions.

<steps> <item>

Click on the search icon to expand the drop-down list.

</item> <item>

Select the search condition from the list.

Some searches might be slow on remote mail accounts (e.g. IMAP+). If you select a search condition like <gui>Body contains</gui> or <gui>Message contains</gui> and <app>Evolution</app> is in online mode and the folder(s) you are about to search in are not already copied locally for offline usage, Evolution automatically runs the search on the mail server side if the server advertises support for server-side searches. When doing a search on search criteria already locally available (e.g. recipients or subject of messages), the search will be run locally.

</item> <item>

Select the scope from the drop-down list right to the text box.

For the <gui>Current Account</gui> scope, the term "account" refers to top-level nodes in the mail folder list, like "On this computer" and remote mail accounts.

</item> <item>

Enter the text you want to search for and press <key>Enter</key>.

</item> <item>

<app>Evolution</app> displays the search results.

</item> </steps>

If you start directly from the fourth step, text will be searched in mail's subjects and addresses and scope will be "Current folder".

If you search for messages that are not in the same folder rather often you might want to create a search folder instead; see Using Search Folders for more detail.

If you want to set several search conditions, you should use an Advanced search, which is described below.

Free Form Expression

One of the search conditions is a <gui>Free Form Expression</gui>, which allows defining complex conditions. As the first step, the given Free Form Expression is divided into words. If the word doesn't have any (known) tag prefix, then the value is checked whether it is in headers To, CC or Subject. In case of a white-space or any other special character is needed, then enclose the word into double quotes. To get a double quote double it inside quoted text; example: `cite ""here""` is parsed as one word `cite "here"`. For example, `f:John Smith` filters messages for the From containing `John` and the To, CC or Subject containing `Smith`, while `f:"John Smith"` filters messages for a sender `John Smith`.

The syntax of the tags is `<tag>[-<options>]:value`. The tags are:

Tag | Abbreviation | Meaning
from | f | From header should match (*)
to | t | To header should match (*)
cc | c | CC header should match (*)
recips | r | To or CC headers should match (*)
subject | s | Subject header should match (*)
list |  | Mailing list header should match (*)
header | h | given header should match (*) the syntax is: `h:headerName=value` while the equal sign is used only as a delimiter, not as a match rule
exists | e | whether given header exists
tag |  | given user tag is set on a message
flag |  | whether certain flag is set; known special values are: `Answered` - the message is marked as replied `Deleted` - the message is marked as deleted `Draft` - the message is marked as draft `Flagged` - the message is marked as important `Seen` - the message is marked as seen (not unread) `Attachment` - the message has an attachment Any other value is checked for its non-emptiness.
label | l | whether certain label is set on the message
size | sz | whether message size, in KB, is equal to the given value Two options are recognized, `<` to get messages with smaller size, and `>` to get messages with bigger size than the given. Example: `size->:1024` filters messages which are more than 1MB large.
score | sc | compares `score` tag on the message against given value; default compare is equal, but, similar to `size` a `<` and `>` options can be used
body | b | checks message body for an existence of the given word; default compare options is for `contains`, but a regular expression can be used if the option is one of the `regex`, `re` or `r`.
sent |  | message's Sent date should match (**)
received | rcv | message's Received date should match (**)
attachment | a | message has (if the value is not any of `no`, `false`, `0`) an attachment. Similar to `flag:attachment` tag.
location | m | Checks message location. The location value (URL) can be found in the folder <gui>Properties</gui>. Example: `location:"On This Computer/Inbox"`
mid |  | Compares message ID.

(*) Header comparisons can have a matching type option. The default is to check for a `contains`. The available options are:

Option | Abbreviation | Meaning
contains | c | matches with contains
has-words | w | matches if contains whole word
matches | m | value's exact match
starts-with | sw | header value starts with the given value
ends-with | ew | header value ends with the given value
soundex | se | header value sounds similar to given value
regex | r | the given value is a regular expression
full-regex | fr | another type of a regular expression

(**) Dates can be written relatively (positive number means `in the last X days`), while negative goes into the future. For example, to get messages received in the last 10 days use: `recv:10`. An exact date can be used as well, the format can be either `YYYY-MM-DD` (the preferred one), then ISO 8601 format or a date/date-time locale specific format. If the date/time parse fails, then the condition is skipped. The date compares can have extra options too, it's `<`, `=` or `>`, where the `>` is the default compare option.

There are three special tags, which require special notation. They are:

<list> <item>

`not:(....)`

</item> <item>

`and:(....)`

</item> <item>

`or:(....)`

</item> </list>

which allows to create specialized expressions. The default (the most outer) conjunction is `and`. To change it to `or` enclose the whole filter into `or:(....)`. For example: `f:Bugzilla t:John` filters all messages which contains `Bugzilla` in the From and `John` in the To, while `or:(f:Bugzilla t:John)` filters messages from Bugzilla or addressed to John.

Free Form Expression examples

A list of some free form expressions follows:

Expression | Meaning
`f:John` | Messages from `John`
`s-has-words:"green blue"` | Messages, which contain both `green` and `blue` words in the Subject
`r-ew:example.com` | Recipients' address (To/Cc headers) ends with `example.com`
`h-starts-with:Cc=Alice` | The `Cc` starts with word `Alice`
`e:X-Secret-Header` | An `X-Secret-Header` exists in the message
`l:work` | Label `work` is set on the message
`sz-<:10` | Message size is less than 10KB
`sz->:100` | Message size is more than 100KB
`b:important` | The body contains a word `important`
`sent:7` | Messages sent in the last 7 days
`rcv-=:2020-02-02` | Messages received on the February 2nd, 2020
`a:1` | Messages with attachment
`a:0` | Messages without attachments
`and:(or:(r:Alice r:Bob) not:(r:Smith))` | Messages whose recipient is `Alice` or `Bob`, but not `Smith`
`f:Bob rcv->:2020-01-01 rcv-<:2020-12-31` | Messages from `Bob`, received during the year 2020
`not:(flag:Seen) f:Bob rcv->:2020-01-01 rcv-<:2020-12-31` | Unread messages from `Bob`, received during the year 2020
`flag:Seen a:1 sz->:1024 f:Bob rcv:31` | Read messages with attachment larger than 1MB from `Bob`, received during the past 31 days
`m:"On This Computer/Inbox"` | Messages stored in the `On This Computer/Inbox` folder
`location-no:"On This Computer/Inbox"` | Messages stored in all but the `On This Computer/Inbox` folder