---
title: "Email rules and filters"
description: "Write your own email rules: conditions on sender, subject, headers, attachments or arrival time, and actions that label, archive, forward or reply."
url: "https://openemail.uk/features/custom-filters"
---

[Filters & blocking](https://openemail.uk/features.md#filters)

# Rules you write yourself Sorted on the way in.

Write conditions and actions on an address’s Rules tab or over the API, and they run on mail arriving at any address on your own domains.

[Open mail](https://openemail.uk/mail/inbox) [Get Started](https://openemail.uk/signup.md)[All features](https://openemail.uk/features.md)

In short

## What is an email rule?

An email rule, or filter, checks each arriving message against conditions you set, such as who sent it, then does what you would otherwise do by hand.

21

fields a condition can test

11

actions a rule can take

100

rules per mailbox

How it works

## Ask about any part of it

Sender, envelope, any header, attachments, size, spam verdict or arrival hour. Require all conditions or any, with NOT on each.

## A numbered list, read top down

Lowest first. “Stop after this rule” ends the pass, and where two rules file a message, the later one wins.

## Try it on mail you already have

Test runs a rule over recent inbox mail, changes nothing, and names each field stored mail cannot answer exactly.

## What a rule can do

As the API names them.

label add a label remove\_label take one off archive leave the inbox mark\_read mark as read star star it spam file as spam trash move to the bin forward send a copy on reply template reply block\_sender block the sender reject refuse outright

What you get

## In the product today

Refusal needs the envelope

A From-header match alone files to Spam instead of bouncing a list.

Every match recorded

Each message keeps the actions applied, the ones refused and why.

Failure still delivers

If the engine cannot answer, the message arrives as it would have.

Good practice

## Getting the most out of it

1. 01
   
   Stop early on purpose
   
   Put narrow rules first with “Stop after this rule” on, so broad ones never see that mail.
2. 02
   
   Dry-run new rules
   
   Save it switched off, run Test, then turn it on.
3. 03
   
   Split, do not nest
   
   (A and B) or C is two rules, and reads better six months later.

Where it stands

## Good to know

Questions

## Asked often

Keep going

## Works well with

Block a sender or a domain

One address, or everything from a domain, stopped before it reaches you.

Labels

Name a label, pick a colour, and filter the list down to it.

Templates

A body written once, versioned, and sent many times: from the composer, from your own code, or by an agent.

Start

## Your domain, your mail.

Point a domain at OpenEmail and read it in a mailbox built around it. The free plan covers one domain.

[Open mail](https://openemail.uk/mail/inbox) [Get Started](https://openemail.uk/signup.md)[Read the reference](https://openemail.uk/docs/knowledge/filters/custom-filters.md)
