Rules for mail
Tell Mail what to do with new mail by itself — into a folder, to the trash, to spam, Done, or only marked read, starred or pinned — by its senders, recipients, subject, mailbox and files.
A rule tells Mail what to do with a new letter before you see it: put it into a folder, send it to the trash or to spam, mark it Done, or leave it in the Inbox but mark it read, star it or pin it to the top. Rules work at every check of your mail, in every mailbox at once.
Where to find them
- Mail's settings (the gear at the top) → Rules for mail. On top is the white row New rule — closed when the page opens; press it to open the rule's form (Change on a rule and Make one in an empty group open it too; saving or Cancel closes it). Under it are all your rules, grouped by what they do.
- A message's menu (right-click, or press and hold on a phone) → Make a rule… (right under Move to a folder, its icon a folder with a gear) — the same form in a window, already filled with that letter's sender.
Making a rule
The form is made of blocks, each with its title on a coloured strip and a chevron on the right that folds and opens it: Condition (open), And if… and Except if… (folded — they open by themselves when something is put into them), and What to do (in another colour, open). Every field has a ? beside it: hold the pointer over it (or tap it on a phone) to read what the field does.
-
Condition → From — who sends the mail. Start typing: Mail suggests the addresses you have mail from or wrote to, and their whole domain (
*@booking.com — anyone at booking.com) — ↑ ↓ and Enter, or a click. Or type it yourself and press Enter (or a comma); each becomes a chip, and any of them will do. The forms, on the example ofexample.com:anna@example.com— one address;example.com,@example.comor*@example.com— anyone at example.com;*.example.com— example.com and its subdomains (news.example.com,noreply@accounts.example.com);noreply*@example.com— the addresses that start with "noreply".
The subject has a word or a phrase (under From, also in Condition) — words or a phrase, several = any of them; upper / lower case does not matter.
-
And if… — narrows the rule: every condition you fill in must hold at once, inside one field any value will do:
- To (or Cc) — the address the letter came to, with the same masks as From (it suggests your own mailboxes too). Handy for an address like
info@your-domain.comthat forwards to you; - Mail box — only mail of one of your mailboxes (shown when you have two or more);
- with files — only letters with attachments.
- To (or Cc) — the address the letter came to, with the same masks as From (it suggests your own mailboxes too). Handy for an address like
-
Except if… — The subject says: words of the subject that stop the rule (for example: everything from GitHub to Done, except "failed").
-
What to do:
- Where to move it? — Don't move it (the letter stays in the Inbox), To the trash, To spam, then, under a pale Into a folder, your folders, each with its folder sign (as the rail shows them; the list searches as you type);
- the marks, any of them together: Mark it as read, Star, Pin to the top, Mark it as Done (out of the Inbox, still in All mail). So "into Bills and Done" is one rule. With the trash or spam, Done is greyed out — it means nothing there. On a phone the marks are one under another, the whole width.
-
Two ticks under the form apply the rule once, right after saving, to mail that is already here (each has a ? that says exactly what it does):
- Apply to the mail already here (on by default) — the letters you have received: in the Inbox, your folders and Done, in every mailbox, up to the 20 000 newest. The trash, spam and Sent are not touched. It moves or marks them as the rule says (to the trash or spam up to 5 000 at a time; save again for more).
- Apply to the sent mail (off by default) — the same for the letters you sent (Sent, and your letters in folders kept in step with the mail server). Handy with To or the subject — From is your own address there.
Without the ticks the rule works only on new mail. Press Save the rule.
What is needed: at least one condition — the fields with a small yellow dot beside their names (From, the subject's words, To, a mailbox, with files): any one of them is enough. The line Choose at least one condition in the Condition block wears the same dot and turns yellow while none is filled in. And the rule must do something: move the letter, or at least one mark. Everything else is optional; a field the server refused gets a red frame.
The examples written in the empty fields are pale on purpose — they are hints, not text you typed.
Rules join by themselves. When a new rule differs from one you already have only in its senders (the same place, the same marks, the same other conditions), the senders are added to that rule instead of making a second one. "Bank, shop, power company → Bills" stays one rule.
The list of rules
Under the form your rules are grouped. The groups are closed — each shows only its name and how many rules it holds; press it to open. Every time you come to the page, everything is closed again; a search opens the groups it found something in:
| Group | What its rules do |
|---|---|
| Into folders | shown as your folders are — each folder with the rules that fill it |
| To the trash | new mail goes straight to the trash |
| To spam | new mail goes to spam — your black list is here too |
| Done | out of the Inbox, still in All mail |
| Marks only | Don't move it + marks: stays in the Inbox, marked read, starred or pinned (Don't move it + Mark it as Done is in Done) |
Each rule is one line: who, which words, which mailbox; the marks as small icons at the end. On a rule:
- the switch at its start turns it off and on again — a switched-off rule is kept but does nothing;
- a click on its text (or ✎) opens it in the form above to change it;
- ▶ applies it now to the mail you have received (the Inbox, your folders, Done — not the trash, spam or Sent);
- ↑ ↓ change the order — when two rules would move the same letter, the higher one wins (the marks of all of them are added);
- × deletes it.
The search above the groups finds an address, a word or a folder.
Older rules
The rules made before — Always put new mail from … into this folder (in Move to a folder), a folder's rules and the black list (the earlier To spam with options…, To the trash with options…) — are in the same groups. A sender's rule and a black-list line have an icon instead of the switch; Change opens them in the form, and saving turns them into a rule of the new kind (the old line goes).
What happens and when
- Rules work on new mail at every check — in every mailbox, also older mail brought up while scrolling. Mail already there is touched only by Apply now.
- The black list goes first, then your rules in their order.
- Moving to the trash or to spam happens on your mail server too. A folder rule moves the letter on the mail server when the mailbox keeps its folders in step with the mail server; otherwise it is filed here.
- Read and Star are set on the mail server too; Pin and Done live in Mail.
- A letter a rule sorts into a folder, marks read or sends away does not ring as new mail on your phone.
Words are looked for in the subject. Mail fetches a letter's text from your mail server only when you open it, so a new letter is judged by its subject (and Apply now also by the first lines of letters you have opened).
When it does not work
- The rule does nothing — check its switch, and that every condition holds: From and the subject's words and the mailbox must all fit. A rule higher in the list may have taken the letter first — move yours up.
- "… is not an address or a domain" — a mask needs a dot in the domain:
example.com, notexample. - Nothing moved with Apply now — it takes the received mail (the Inbox, your folders, Done) and, with its own tick, the sent mail; never the trash or spam. A letter already in the rule's folder stays where it is (it only gets the marks).
- I don't see the page — an administrator may have switched the sorting rules off in Settings → Mail.
See also: Organising your mail · Swipes · Synchronization with the mail server