Inbox rules
Inbox rules filter new inbound email on the server. They run even when your email app is closed, so a mailbox can sort, mark, star, or send a webhook the moment mail arrives.
Last updated
Where to manage rules
In the dashboard, open Mailboxes, choose a mailbox, and select Inbox rules in the side panel. The page shows the mailbox address, its rules, and the folders a rule can move mail to.
From the inbox, select Inbox rules below your folders. To start a rule from an email, open the three-dot menu on the email and select Create a rule from this message. The new rule matches the plus tag the email was sent to, such as you+news@example.com, or else its sender.
Owners and admins manage the rules of every mailbox they read. A member manages a mailbox's rules only when nobody else has access to it. Rules apply to everyone who reads the mailbox, so on a shared mailbox an admin changes them.
You can also describe a rule to the AI assistant, for example "whenever Stripe emails billing, move it to the Billing folder and mark it read". The AI assistant shows you the exact rule and saves it only after you confirm. Name an existing rule and it can enable, disable, or delete it. To rewrite a rule's conditions, use this page or the API.
To manage rules from code, use the mailboxes API. Call GET /v1/mailboxes/:id/rules first to read the current rules and folder IDs, then replace the whole rule set with PUT /v1/mailboxes/:id/rules.
Bring rules from Outlook
Outlook rules don't move with your email. On the Inbox rules page, choose Bring rules from Outlook:
- Find your rules. In Outlook on your computer, open File > Manage Rules & Alerts. In Outlook on the web, open Settings > Mail > Rules.
- Paste each rule's description, or write it in your own words, one per line.
- Choose Ask the assistant. A new chat with the AI assistant opens with your rules filled in. Send it, and the assistant proposes the matching Shipmail rules one at a time. Each one is saved only after you confirm it.
Shipmail rules check the sender, the recipient, the +tag in the address and the subject. Imported rules move, mark read, star or send a webhook. The import skips rules that forward, delete or reply, or that check the message body, attachments, importance, size, categories or dates. Add forwarding rules yourself with the Forward to action below, and set up auto-replies in the mailbox settings. The assistant tells you which rules it skips. A list longer than one request (about 3,200 characters) goes in two parts. Outlook's rule export file (.rwz) can't be uploaded: its format isn't published.
How rules run
- A rule belongs to one mailbox and runs on every new inbound message for it.
- Rules run from top to bottom, skipping disabled ones. To change the order, drag a rule by its handle, or use Move rule up and Move rule down in its menu.
- Choose all when every condition must match, or any when one is enough.
- Nest condition groups when a rule needs to mix all and any.
- When a rule with Stop after this rule matches, the rules below it don't run, and AI assistant automations leave the message's folder, read, and star state alone. The message stays where the rule filed it.
- Use Stop after this rule for exceptions. To file all mail from
example.comexcept one sender, put a rule for that sender first with Stop after this rule on, then the broaderexample.comrule below it.
Run rules on mail already in the inbox
Rules only see new mail. To sort mail already in the inbox, open the mailbox's rules and choose Run on inbox. Your enabled rules run once, in order, on the newest 1,000 messages in the inbox.
- Matching messages are moved, marked read, or starred, just as on delivery.
- Webhook and forward actions don't fire. They only fire for new mail.
- Mail already in the inbox has no delivery envelope, so recipient conditions match the addresses in its To header.
Conditions
Text and address matching is case-insensitive.
| Condition | Matches |
|---|---|
| from_is | Sender email exactly matches an address. |
| from_contains | Sender email contains text, such as a domain. |
| recipient_is | Envelope recipient exactly matches an address. |
| recipient_contains | Envelope recipient contains text, such as a domain or part of an address. |
| plus_tag_is | The plus tag in an address like support+vip@example.com matches a value. |
| subject_contains | Subject contains text. |
| has_attachment | The message includes an attachment. |
| list_unsubscribe_exists | The message has a List-Unsubscribe header. |
Actions
- Move to. Move the message to Inbox, Archive, Junk, Trash, or a custom folder.
- Mark as read. Add the seen flag to the message.
- Star. Add the flagged flag to the message.
- Send webhook. Send a
mailbox.rule_matchedevent to every active endpoint subscribed to it. - Forward to. Send a copy to one of the mailbox's forwarding addresses. The message also stays in the mailbox.
Forward mail that matches a rule
To send only some mail to another address, such as invoices from billing@vendor.com to your accountant, add the address as a forwarding destination, then pick it in a rule.
- Open the mailbox, choose Forwarding, enter the address and tick Only for inbox rules. Such an address gets nothing by itself: only rules that forward to it send it mail.
- The address receives a confirmation email. Forwarding starts once it confirms.
- Add a rule with the conditions you need, and choose the address in Forward to. You can save the rule while the address is still pending.
A forwarded copy works like any forwarding: it comes from the mailbox address with the original sender's name, replies go to the original sender, and spam is never forwarded. A destination counts toward the three forwarding addresses each mailbox can have. Each new forwarding rule emails the organization owner. In the API, the action is { "type": "forward", "forwarding_id": "fwd_..." }, and a destination only rules use is created with "rules_only": true.
Example rule
This rule catches mail sent to support+vip@example.com, moves it to a custom folder, stars it, sends a webhook, and stops the rules below it.
{
"id": "4f5a9d74-b0f1-49a7-bbfb-1f2af841f5b2",
"name": "VIP support",
"enabled": true,
"position": 0,
"match_mode": "all",
"stop": true,
"conditions": [
{ "type": "plus_tag_is", "value": "vip" },
{ "type": "recipient_is", "value": "support+vip@example.com" }
],
"actions": [
{ "type": "move", "target": { "kind": "custom", "folder_id": "fld_123" } },
{ "type": "star" },
{ "type": "send_webhook" }
]
}Limits
- Each mailbox can have up to 50 rules.
- Each rule can have up to 10 condition leaves and 5 actions.
- Condition groups can nest up to 3 levels deep.
- Rule names and rule IDs must be unique within a mailbox.
- A rule can have only one move action and one forward action.
Notes
- Inbox rules don't reject mail, and they forward only to confirmed forwarding addresses of the mailbox. The webhook action only reaches active endpoints subscribed to
mailbox.rule_matched. Use mailbox forwarding to copy all mail, or mail from one sender, without a rule, or use Sieve when you need to write your own server-side filter scripts. - You can't delete a custom folder or a forwarding address that a rule uses until you update the rule.
- An API update replaces the whole rules array. To change one rule from code, read the current rules first.