Premium feature

Email rules & webhooks

Decide what happens to each email the moment it reaches your alias: block it, send it to another inbox, label its subject, or tell your own apps about it with a signed webhook. No code needed for rules; webhooks are there when you want to automate.

How a rule works

Every rule has two parts. When describes the emails it applies to, and Then says what to do with them. You build rules on the Rules page of your dashboard, give them a name, switch them on or off, and move them up or down to set their order.

When

Up to 5 conditions, matched all or any. Each condition checks one field:

  • Sender — the address the email came from
  • Subject — the subject line
  • Alias — which of your aliases received it

with contains, equals, starts with or ends with. Matching ignores upper and lower case.

Then

Up to 4 actions:

  • Block it — the email isn't delivered and appears in your inbox log as blocked by a rule
  • Forward to another inbox — your account email or any inbox you've verified
  • Add to the start of the subject — a label of up to 40 characters, like [Receipt]
  • Send a webhook — up to 2 per rule, to any public https URL

A rule that blocks can't also forward or relabel the email.

Examples you can copy

Six ready-made ideas, written exactly as you'd build them in the dashboard.

Silence a sender who won't stop

A shop keeps mailing you after you unsubscribed. Block everything from its domain, on every alias.

When
  • Sender ends with @offers.example-shop.com
Then
  • Block it

Label receipts and invoices

Make bills easy to spot and filter in your inbox, whichever alias they arrive on.

Whenmatch any
  • Subject contains receipt
  • Subject contains invoice
Then
  • Add “[Receipt]” to the start of the subject

Send work aliases to your work inbox

Keep work sign-ups out of your personal inbox by naming those aliases work-something.

When
  • Alias starts with work-
Then
  • Forward to another inbox: you@company.com (a verified inbox)

Get an alert when your bank writes

Push important mail to your phone or chat through an automation tool.

When
  • Sender equals alerts@yourbank.com
Then
  • Send a webhook to your Zapier, Make or n8n webhook URL

Tag job applications

Combine conditions: only mail to your jobs alias that comes from a recruiting platform.

Whenmatch all
  • Alias equals jobs@yourdomain.com
  • Sender ends with @linkedin.com
Then
  • Add “[Jobs]” to the start of the subject
  • Send a webhook to log it in your tracker

Watch a leaked alias

Keep receiving mail on an alias you suspect was sold, while every message is logged by your own app.

When
  • Alias equals shop@yourdomain.com
Then
  • Send a webhook to your endpoint

When several rules match

  • Rules run from the top of your list to the bottom, and you can reorder them at any time.
  • Every rule that matches counts as applied and sends its webhooks, so several rules can notify different apps about the same email.
  • For blocking, forwarding and the subject label, the first matching rule wins. Put specific rules above general ones.
  • Rules run after your blocked-senders list. Mail from a sender you've already blocked never reaches your rules.
  • Each rule shows how often it has been applied, and the result of its last webhook call.

Webhooks

When a rule with a webhook matches, we send an HTTPS POST with a small JSON summary of the email to your URL. It works with your own server and with automation tools that accept webhooks, such as Zapier, Make and n8n. The email body and attachments are never included.

Payload
{
  "event": "email.received",
  "rule": { "id": "6f0c…", "name": "Bank alerts" },
  "alias": "bank@yourdomain.com",
  "from": "alerts@yourbank.com",
  "subject": "Your statement is ready",
  "blocked": false,
  "log_id": "9b2e…",
  "received_at": "2026-11-14T09:30:00Z"
}
Request headers
POST /your/path HTTP/1.1
Content-Type: application/json
User-Agent: EmailAlias-Webhook/1.0
X-EmailAlias-Event: email.received
X-EmailAlias-Timestamp: 1794648600
X-EmailAlias-Signature: sha256=5d41c0…
event

email.received for real email, test for the Send test webhook button

alias / from / subject

the alias that received the email, the sender address and the subject

blocked

true when one of your rules blocked the email

log_id

the entry in your inbox log, so you can match the event to the email

Verify the signature

Every rule has its own signing secret, shown with Show signing secret on the rule. The X-EmailAlias-Signature header is sha256= followed by the HMAC-SHA256 of the timestamp, a dot and the raw request body, using that secret. Check it, reject old timestamps, and you know the request came from us and wasn't replayed. If a secret leaks, choose New secret to replace it.

Node.js (Express)
import crypto from "node:crypto";
import express from "express";

const app = express();
const SECRET = process.env.EMAILALIAS_WEBHOOK_SECRET; // from "Show signing secret"

// Use the raw body: the signature covers the exact bytes we sent.
app.post("/emailalias", express.raw({ type: "application/json" }), (req, res) => {
  const ts = req.get("X-EmailAlias-Timestamp") || "";
  const sig = req.get("X-EmailAlias-Signature") || "";
  const expected = "sha256=" + crypto.createHmac("sha256", SECRET)
    .update(ts + ".").update(req.body).digest("hex");

  const valid = sig.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
  const fresh = Math.abs(Date.now() / 1000 - Number(ts)) < 300;
  if (!valid || !fresh) return res.sendStatus(401);

  const event = JSON.parse(req.body);
  console.log(event.alias, event.from, event.subject);
  res.sendStatus(200); // reply quickly: we wait 5 seconds at most
});

app.listen(3000);
Python (Flask)
import hashlib, hmac, os, time
from flask import Flask, abort, request

app = Flask(__name__)
SECRET = os.environ["EMAILALIAS_WEBHOOK_SECRET"].encode()  # from "Show signing secret"

@app.post("/emailalias")
def emailalias():
    ts = request.headers.get("X-EmailAlias-Timestamp", "")
    sig = request.headers.get("X-EmailAlias-Signature", "")
    body = request.get_data()  # the exact bytes we sent
    expected = "sha256=" + hmac.new(SECRET, ts.encode() + b"." + body, hashlib.sha256).hexdigest()

    fresh = ts.isdigit() and abs(time.time() - int(ts)) < 300
    if not hmac.compare_digest(sig, expected) or not fresh:
        abort(401)

    event = request.get_json()
    print(event["alias"], event["from"], event["subject"])
    return "", 200  # reply quickly: we wait 5 seconds at most

Limits and safety

20 rules per account

Each with up to 5 conditions and 4 actions, including up to 2 webhooks.

300 webhook calls an hour

Per account. Rules keep blocking, forwarding and labelling beyond that.

One attempt, 5-second timeout

Reply with a 2xx quickly and do slow work afterwards. Failed calls aren't retried.

Public https only

Port 443, verified TLS, no redirects, and the host must resolve to public addresses.

Test before you rely on it

Send test webhook posts a sample event and shows your endpoint's response.

Nothing sensitive in the payload

No body, no attachments, and no address of your own inbox.

Questions

Which plan includes rules and webhooks?+

Rules and webhooks are part of EmailAlias Premium. You can create up to 20 rules per account.

Do webhooks include the email body or attachments?+

No. A webhook carries only the alias, the sender address, the subject, the time, whether a rule blocked the email, and IDs for the rule and the inbox log entry. The body and attachments are never sent.

Do rules apply to all of my aliases?+

Yes. Rules run on every incoming email for your account. To limit a rule to certain aliases, add an Alias condition such as Alias equals shop@yourdomain.com or Alias starts with work-.

Can I use regular expressions?+

No. Conditions use contains, equals, starts with and ends with, and they ignore upper and lower case. Combine up to five conditions with Match all or Match any to cover most cases.

What happens if my webhook endpoint is down?+

Each event is sent once, with a 5-second timeout, and is not retried. The rule shows the result of its last webhook call, and the email itself is delivered or blocked as normal. If you can't afford to miss events, queue them on your side or use an automation tool that stores incoming webhooks.

Can a rule forward mail to any address?+

A rule can only forward to your account email or to an inbox you have already verified in EmailAlias, so a rule can't be used to send your mail to someone else.

Put your inbox on autopilot

Rules and webhooks come with Premium, alongside custom domains, PGP encryption and replies from your aliases.

Building something bigger? See the API documentation and EmailAlias for developers.