How to use the query language
If the advanced form is not enough to configure complex search conditions, use the query language. Using it, you can:
- Only search in specific message fields. For example, a search for messages from “Alice” with the “Report” attachment:
from:Alice attachment:Report
- Search for messages within a specific date range. For example, a search for messages from 15.06.16 to 10.07.2016:
date-begin:2016-06-15 date-end:2016-07-10
- Search for messages in specific folders or with specific tags. For example, a search in the “From Fluffy” folder:
folder:"Messages from Fluffy"
- Use operators to combine search conditions. For example, to look for messages from Mad Hatter to Alice and messages to Alice containing the word “tea” at the same time, use this formula:
((from:(just.mad.hatter OR Mad Hatter) OR text:tea) AND to:Alice
Message fields
Yandex Mail usually searches in all message fields and in the currently open folder. You can refine the search and specify the message field to search. This will make it possible to search separately in the message text, in senders and recipients, and in attachments, as well as to search messages by date, labels, and folders.
Type several comma-separated fields without spaces to search for the same word in multiple fields. For instance, from,cc,bcc:Mad Hatter
.
Senders and recipients fields
Field |
Description |
Syntax |
Query example |
|
Search for messages with the sender specified. |
|
The system will search for messages that contain "cheshire.katze" in the From field. |
|
Search for messages with the recipient specified. You can search by sender's name ("Alice"), username ("alice.the.girl"), or domain ("yandex.com") |
|
The system will search for messages that contain "Alice" in the To field. |
|
Search by Cc . You can search by sender's name ("Alice"), username ("alice.the.girl"), or domain ("yandex.com") |
|
The system will search for messages that contain "just.mad.hatter" in the Cc field. |
|
Search by Bcc. You can search by sender's name ("Alice"), username ("alice.the.girl"), or domain ("yandex.com") |
|
The system will search for messages that contain "Rabbit" in the Bcc field. |
Text fields
Field |
Description |
Syntax |
Query example |
|
Search for messages with the subject specified. |
|
The system will search for messages that contain "miracle tea" in the Subject field. Note If a subject consists of multiple words, use the quote operator ". |
|
Search in the message body. |
|
The system will search for messages with a body that contains "Masala tea from India". |
Attachment fields
Field |
Description |
Syntax |
Query example |
|
Search for messages with or without attachments. |
|
The system will search for messages with attachments. |
|
Search by attachment name. |
|
The system will search for messages with attachments that contain “photo” in the title. |
Date fields
Field |
Description |
Syntax |
Query example |
|
Search for email for the specified month. |
|
The system will search for messages from April this year. If April still has not come this year, the system will search for messages from last April. |
|
Search for emails for the specified year. |
|
The system searches for email from 2016. |
and
|
Search for messages in the specified date range. You can use these operators separately: |
|
The system will search for messages from 15.06.16 until the current date inclusive.
The system will search for messages from 15.06.16 to 10.07.2016 inclusive. |
|
Search for messages until the specified date exclusive. |
|
The system will search for messages from the mailbox creation date through14.06.16. |
and
|
Search for messages in the specified date range in relation to the current date. |
|
The system will search for messages older than two days.
The system will search for messages older than two days but newer than one week. |
Folder and label fields
Field |
Description |
Syntax |
Query example |
|
Search for messages in a specific folder. |
|
The system will search for messages from the “Messages from Fluffy” folder. |
|
Search for the messages with a specified label. To search for unread messages, specify the “unread” label, or the “read” label to search for read messages. |
|
The system will look for messages that contain the “chinese tea” label. |
Operators
You can use operators to combine conditions in a query, specify search options, and search for messages with an exact quote.
You can use multiple space separated operators in one query. For instance, "Masala from India" subject:tea from:rabbit
.
Operator |
Description |
Syntax |
Query example |
|
Search for messages that contain the exact phrase (search by quote). |
|
The system will search for messages that contain “ten impossible things before breakfast”. |
|
Search for messages that do not contain the specified word. Only the word preceded by the operator is excluded. You can use multiple |
|
The system will search for messages that contain “tea”, but do not contain “pu-erh”.
The system will search for messages with a Subject that contains “tea”, but does not contain “pu-erh”. |
|
Search for messages that contain any word from the query. You can use multiple |
|
The system will search for messages that contain at least one word from the query: “black”, “green”, or “herbal”. |
|
Search for messages that contain all the words from the query. You can use multiple |
|
The system will only search for messages that contain all the words from the query: “white”, “Chinese”, and “tea”. |
|
Grouping words in complex queries. Any operators can be used inside a group included in brackets. |
|
The system will search for messages received before October 11, 2016, that contain "just.mad.hatter" or "Mad Hatter" in the From field, or "tea ceremony" in the body text. |