Email filters and rules

Filters do the boring sorting for you: newsletters into one folder, receipts into another, notifications marked as read. In Ayamail you build them in webmail, and many of them run on the mail server itself, so the sorting is done before any app opens your mail.

Written by Ayamail editorial team · Updated 30 October 2026

Short answer

Open Mail settings in Ayamail webmail and choose Mail filters, then Add filter. Give the filter a name, add one or more conditions such as From contains or Subject contains, pick an action such as Move to folder, Archive or Mark as read, and select Save filter. Filters run from top to bottom.

Make your first filter

  1. Open the list

    In webmail, open Mail settings and select Mail filters. If you have none yet, it says You have no mail filters yet.

  2. Add a filter

    Select Add filter and type a name you will recognise later, such as Newsletters.

  3. Set conditions

    Under Conditions, fill in one or more of From contains, To contains, Subject contains and Body contains. Choose Match all if every condition must fit, or Match any if one is enough.

  4. Choose actions

    Under Actions, pick what should happen: Mark as read, Add star, Archive, Move to trash, Mark as spam or Move to folder with a folder name.

  5. Save

    Check that Active filter is on and select Save filter. Use Move up and Move down to put the most specific filters first.

Where filters run

Ayamail stores your filters in your account. Ayamail also writes a copy of them to the mail server as a Sieve script. Sieve is the standard language for server-side mail filters, and it runs the moment a message arrives, even when every app and device is closed.

Every filter in Mail settings runs on the server, with Match all or Match any and all the actions: Mark as read, Add star, Archive, Move to trash, Mark as spam and Move to folder. So a filter also works while you only read mail in Outlook or on an iPhone. If the server copy could not be updated when you saved, Ayamail tells you, and it sends the filters again the next time you open webmail.

Filters you create inside Outlook, Apple Mail or Thunderbird are separate. They only run in that app, while it is open, and Ayamail does not see them.

Blocked and trusted senders

Next to Mail filters, Mail settings has two simpler lists that also reach the server:

  • Trusted senders always land in the inbox. They are checked first, before blocks and filters.
  • Blocked senders are moved straight to the junk folder and never reach your inbox.
  • Your filters run after these two lists, in the order you set.

When a filter does not do what you expect

A filter works in webmail but not on the phone

What to do: Filters in Mail settings run on the mail server. If Ayamail said the server could not be updated, open webmail once and it sends them again. Rules made under Filters and rules in webmail or Labels and filters in the app are different: they are saved only on that device and run only while Ayamail is open there.

The wrong filter wins

What to do: Filters that archive, move to trash, mark as spam or move to a folder stop the ones below them. Move the most specific filter up with Move up.

Mail from someone keeps landing in the inbox despite a filter

What to do: Check whether the sender is on your Trusted senders list. Trusted senders are delivered to the inbox before filters run.

A filter seems to do nothing

What to do: Check that Active filter is switched on and that the text in the condition really appears in the sender, recipient, subject or body. Shorter text matches more mail.

Questions and answers

Do filters work when my computer is off?
Yes. Filters in Mail settings run on the mail server. Only rules saved under Filters and rules in webmail or Labels and filters in the app need Ayamail to be open on that device.
Do filters apply to mail I already have?
Filters act on new mail as it arrives. Existing mail stays where it is; move it by hand or with a search in webmail.
Can I write my own Sieve script?
Not at the moment. You build filters with the form in Mail settings, and Ayamail writes the Sieve script for you.
What is the difference between blocking and a filter?
Blocking is a quick list: everything from that sender goes to junk. A filter can combine several conditions and do other things, such as archiving or moving to a folder.

Sources

  1. RFC 5228: Sieve, an email filtering language (Checked 30 October 2026)
  • Out-of-office reply

    Turn on an automatic reply for holidays or leave: where to find it, how the dates work, what to write and why it keeps working with every app closed.

  • Outlook

    Set up Ayamail in new Outlook, classic Outlook or Outlook for Mac with IMAP and SMTP: the menu path for each version and help when it will not connect.

  • Thunderbird

    Add Ayamail to Thunderbird on Windows, Mac or Linux: the fields in manual setup, the server table, and what Thunderbird's error messages mean.

  • Close an old account

    Close an old email address without losing bank logins or photos: what to copy, how long to forward, and what Google, Microsoft and Yahoo do.