Rules
Creating rules that mark, flag, archive, trash or file mail as it arrives, how rules combine, and running them on mail you already have.
A rule decides once what happens to a kind of mail — newsletters into a folder, messages from a client flagged, notifications marked read — and Nixt Mail carries it out as mail arrives.
What rules can do
A rule has conditions (what to look for) and actions (what to do). It can:
- Mark as read
- Flag it
- Archive it
- Move to trash
- Move to a folder
A rule never sends anything, because nothing in Nixt Mail puts mail on the wire without you pressing Send. For an automatic reply while you are away, see Out of office, which your mail server sends.
Nothing a rule does is permanent: trashed, archived and moved mail can be moved back.
Where rules run
- On arrival. A rule runs when new mail arrives in the inbox of any connected account, before Nixt Mail announces it, while Settings › Sync and offline › Checking for new mail is Push, as it arrives (the default). A message a rule marks read or moves away is not announced by the banner or a notification. A paused account is not connected, so its mail is not checked.
- On mail you already have, when you choose Run on what is downloaded. See Run rules on existing mail.
Rules are kept on this device. A rule applies to every account unless you keep it to one — see Rules for one account. Rules run in Nixt Mail rather than on your mail server, so they act while Nixt Mail is running.
Open Rules
Open Settings › Rules. Under the list, the section explains: Run on mail as it arrives, in this order. The first rule that matches and says to stop ends the list — and none of them can send anything, because nothing in Nixt Mail sends without you.
With no rules yet the list says No rules yet, and under it Mail arrives and stays where it lands.
Create a rule
- Open Settings › Rules.
- Choose Add a rule. The New rule dialog opens.
- Optionally, type a Name. If you leave it empty, the rule is named after its first condition, such as From — newsletter.
- With more than one account, For mail to also appears. Leave it on Every account, or choose one account’s address. See Rules for one account.
- Under When, build the first condition:
- Choose what to look at: From, To or Cc, Subject or Body.
- Choose how to compare: contains, is exactly, starts with or ends with.
- Type what to look for, in the box that reads what to look for.
- To add another condition, choose And another condition. Each extra row is labelled and.
- Under Then, choose one or more actions: Mark as read, Flag it, Archive it, Move to trash, Move to a folder. Selected actions are highlighted; choose one again to deselect it.
- If you chose Move to a folder, type the folder’s name in Folder (for example
Lists). - Under And then, set:
- Stop here — on by default. When this rule matches, later rules are skipped.
- Rule is on — on by default. Turn it off to keep the rule without running it.
- Read the sentence at the bottom of the dialog. It says what the rule will do, such as When from contains “newsletter” → archive it.
- Read the line under it, which tries the rule on the messages in the folder you have open. It says how many of them the rule matches and names a few by subject, such as It matches 3 of the 40 messages in the folder open now, including “Weekly digest”. Change a condition and it updates as you type. See Try a rule before you save it.
- Choose Save.
Save stays greyed out until the rule is complete — its tooltip says Finish the rule first, and the dialog says Not finished — a rule needs something to look for and something to do. A rule is complete when every condition has something to look for, at least one action is chosen, and a folder is named if Move to a folder is chosen.
To remove a condition, choose the × at the end of its row (tooltip Remove this condition). The last condition cannot be removed — its tooltip says A rule needs something to match on — because a rule with no conditions would match nothing.
Choose Cancel to close the dialog without saving.
Conditions in detail
| Look at | What it compares |
|---|---|
| From | The sender’s name and address. |
| To or Cc | Everyone the message was sent to, in To and Cc together. |
| Subject | The subject line. |
| Body | The plain text of the message. |
| Compare | Matches when the field… |
|---|---|
| contains | contains the text anywhere. |
| is exactly | is the text, and nothing else. |
| starts with | begins with the text. |
| ends with | ends with the text. |
- Comparisons ignore capitals, and spaces at the start and end of what you typed.
- Every condition must match for the rule to run. To match one thing or another, make two rules.
- From and To or Cc hold names and addresses together, written like
Alex Morgan <alex@example.com>, with several people separated by commas. To match an address or a domain, use contains —alex@example.comor@example.com— rather than is exactly or ends with, which also have to match the name and brackets. - Body looks at the message’s plain text as far as it has been downloaded. On arrival Nixt Mail downloads it first when a rule needs it. When you run rules on existing mail, only messages you have opened have their text, so a body condition does not match the others.
How rules combine
When a message arrives, Nixt Mail goes through your rules from the top:
- A rule that is off or unfinished is skipped.
- A rule whose conditions all match fires, and its actions are collected.
- If that rule has Stop here on, no later rule is checked.
- If that rule archives, trashes or moves the message, no later rule is checked either — whatever Stop here says — because the message is no longer in the inbox.
Then the collected actions are carried out:
- Flag it and Mark as read happen first.
- Move to trash wins over Archive it and Move to a folder: the message goes to the trash only.
- Move to a folder wins over Archive it.
- If more than one rule names a folder, the first one’s folder is used.
When a folder is missing
Move to a folder looks for a folder whose name (or full path) is exactly what you typed. If there is no such folder — because it was renamed or deleted since you wrote the rule — the message is left where it is. Nixt Mail does not guess at a different folder.
When an account has no archive folder
Archive it on an account with nowhere to archive to marks the message read and leaves it in the inbox. When you run rules on existing mail, that counts as a message that could not be changed.
Manage rules
Each rule in Settings › Rules shows its name, a sentence saying what it does, a switch, and these buttons:
| Control (tooltip) | What it does |
|---|---|
| Switch | Turns the rule on or off where it is, without opening it. A rule that is off is kept and skipped. |
| Up arrow (Run this one earlier) | Moves the rule up the list. Reads Already first on the top rule. |
| Down arrow (Run this one later) | Moves the rule down. Reads Already last on the bottom rule. |
| Pencil (Edit this rule) | Opens the rule in the Edit rule dialog. |
| Trash (Delete this rule) | Deletes the rule. Undo appears in its place. |
Beside a rule’s name:
- unfinished — it will not run — the rule is missing something. Edit it to finish it.
- its account was removed — it will not run — the rule is kept to an account that is no longer in Nixt Mail. Edit it and choose another account under For mail to, or Every account.
A rule kept to one account starts its sentence with the account, such as For you@example.com: When from contains “invoice” → flag it.
Undo a deleted rule
After you delete a rule, the list shows Deleted and the rule’s name where it was, with an Undo button. Choose Undo to put the rule back in the same place in the list, where it runs in the same order as before. Undo stays until you leave Rules or delete another rule.
Order matters: rules higher in the list run first, and a rule with Stop here hides every rule below it from the mail it matches.
Rules for one account
With more than one account, a rule can be kept to the mail of one of them — for example, filing invoices that arrive at your work address without touching your personal mail.
- In the New rule or Edit rule dialog, open For mail to.
- Choose the account’s address. Every account applies the rule to all of them.
- Choose Save.
A rule kept to one account runs only on mail that arrived at that account: as it arrives, and when you choose Run on what is downloaded, including in All inboxes. If you remove that account, the rule stops running rather than applying to every account, and says its account was removed — it will not run until you choose another.
Try a rule before you save it
While you write a rule, the line under the rule’s sentence tries it on the messages in the folder you have open — the same messages Run on what is downloaded would act on:
| It says | What it means |
|---|---|
| It matches 3 of the 40 messages in the folder open now, including … | Three messages would be changed. Up to three are named by subject. |
| It matches none of the 40 messages in the folder open now. | Nothing on screen would be changed. Check the condition for a typo. |
| Open a folder with mail in it to see what this rule would match there. | No messages are loaded to try it on. Close Settings, open a folder, and open the rule again. |
Only messages that have been downloaded are tried, and a Body condition only matches messages you have opened. The rule is not run until you save it.
Run rules on existing mail
Rules on arrival do nothing about mail already in your inbox. To apply them to it:
- Open the account and folder you want to tidy. Let the list load, and choose Load more if you want older messages included.
- Open Settings › Rules.
- Choose Run on what is downloaded.
Nixt Mail applies your rules to the messages loaded in that list. It does not search your whole mailbox on the server. Its tooltip says Applies them to the messages Nixt Mail already has. It will not walk the whole mailbox on the server. The button is greyed out, with the tooltip Write a rule first, until you have a rule that is on and complete.
When it finishes, a snack bar says what happened:
| Message | What it means |
|---|---|
| Nothing to run them on — this folder has not been downloaded yet. | No messages were loaded. Open a folder and let it load. |
| Checked 40 messages. None of them matched a rule. | Every loaded message was checked; none matched. |
| Applied the rules to 6 of 40. | Six messages matched and were changed. |
| Applied the rules to 6 of 40. 1 could not be changed on the server. | One message matched but its change failed, for example because a folder is missing. |
Examples
File newsletters
- When From contains
newsletter - Then Move to a folder, Folder
Lists - And then Stop here
Flag mail from a client
- When From contains
@example.com - Then Flag it
- And then turn off Stop here, so later rules can still file it.
Tidy build notifications
- When From contains
builds@example.org - and Subject starts with
Passed - Then Mark as read, Archive it
Rules and your other settings
- Rules are content, like signatures: Restore defaults, Reset all settings and settings files leave them alone.
- Erase everything on this device deletes them.
- Nixt Mail stores only the words you typed and the actions you chose — no message text.
Something unclear or out of date on this page? Tell us.