---
title: "Rules for arriving mail"
description: "Say what happens to a message before anybody opens it."
url: "https://openemail.uk/features/automations"
---

Built on top

# Rules for arriving mail written once, run always

Say what happens to a message before anybody opens it.

[Open mail](https://openemail.uk/mail/inbox) [Get Started](https://openemail.uk/signup.md)[Every walkthrough](https://openemail.uk/features/in-practice.md)

Rules

billing@northwind.co Arrived

Invoice 2214 for August Invoices Archive

1 Subject has invoice Stop 24 +1

2 From domain is pinefield.dev 61 +1

3 Has an attachment 9 +1

Rules run as mail arrives. Nothing already in the mailbox moves.

How it works

## Running in three steps.

1. 01
   
   Write the rule
   
   Conditions on the arriving message, then the actions to take.
2. 02
   
   Try it first
   
   Run it over the last thirty days without touching a message.
3. 03
   
   Turn it on
   
   It runs on arrival, and the log says what happened.

What it runs on

## The parts doing the work.

Nothing here is a separate product. Each one is a piece of the mailbox you already have.

Rules you write yourself

Your own conditions, and what should happen to anything that matches them.

deals@spammy.io blocked sender

anyone@spammy.io blocked domain

hr@recruit.co language filter

ci@acme.dev your rule → archive

Webhooks

Tell your endpoint when mail arrives, instead of making you poll.

/threads?query=invoice

{ "threads": 12 }

Same mailbox, whether a person or a program is holding it.

REST API

A documented HTTP API with issuable, scopable, revocable keys.

/threads?query=invoice

{ "threads": 12 }

Same mailbox, whether a person or a program is holding it.

Typed SDKs

A TypeScript client first, then the rest.

/threads?query=invoice

{ "threads": 12 }

Same mailbox, whether a person or a program is holding it.

Labels

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

Invoices Recruiting Newsletters

Templates

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

Intro Invoice Follow-up

Hi Sarah, good to meet you at

Block a sender or a domain

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

deals@spammy.io blocked sender

anyone@spammy.io blocked domain

hr@recruit.co language filter

ci@acme.dev your rule → archive

Nearby

## Other jobs for the same inbox.

Email inside your product

Send, read and organise mail from your own code with a typed client.

await openemail.emails.send({

from: 'receipts@acme.com',

})

id msg\_3e91c7

queued sent delivered

email.opened email.clicked

An address per customer

Give every ticket, record or customer its own address, with nothing to create.

Ticket 8123 ticket-8123@ in.yourapp.com

Ticket 8124 ticket-8124@ in.yourapp.com

To ticket-8123@ in.yourapp.com

From ticket-8123@ in.yourapp.com Same address

Email into your app

Mail arriving at your domain reaches your server as a signed webhook, seconds later.

billing@in.yourapp.com Arrived

POST hooks.acme.dev/mail 200

type email.received

to billing@in.yourapp.com

[Every walkthrough](https://openemail.uk/features/in-practice.md)
