Inbox Management

Sort inbound email before your agent sees it

When a new thread arrives, rules evaluate in priority order and route it to folders or archive it. Your agent reads from the folders that matter instead of triaging a flat inbox.

How rules work

Each rule has a condition and an action. When a new inbound thread is created, the engine runs through your rules in position order. By default, stop_processing is true, so the first matching rule wins. Set it to false on a rule and evaluation continues — multiple rules can apply to the same thread.

Rules only fire on new threads, not replies to existing ones. A reply to a thread that was already sorted stays in its folder. And if a rule fails (bad folder ID, database hiccup), the thread is still created — rule evaluation never blocks message processing.

Conditions and actions

Match on

Three condition types: sender_domain, sender_email, and subject. Four operators: equals, contains, ends_with, and matches_pattern (SQL LIKE-style wildcards: % and _). All matching is case-insensitive.

Then do

Two action types: move_to_folder routes the thread into a named folder. auto_archive sets archived_at on the thread immediately. A thread can land in multiple folders if multiple rules match.

Folders

Folders are per-mailbox. Give them a name, an optional color, and a position for ordering. Threads can belong to multiple folders at once. Deleting a folder removes the associations but leaves the threads untouched.

Add or remove threads in bulk (up to 100 per call). List threads in a folder with pagination. Adding the same thread twice is idempotent.

Create a folder and a rule

# Create a folder
$ curl -X POST https://mailbox.molted.email/v1/folders \
    -H "Authorization: Bearer mm_live_..." \
    -d '{"mailboxId":"d290f1ee-...","name":"VIP Customers","color":"#22c55e"}'

{ "id": "a7c3e8f1-4b2d-4e9a-b5f6-8d1c0e3a7b9f", "name": "VIP Customers", "color": "#22c55e" }

# Create a rule that routes enterprise senders to that folder
$ molted rules create --mailbox d290f1ee-... \
    --name "Enterprise inbound" \
    --condition-type sender_domain \
    --condition-operator ends_with \
    --condition-value bigcorp.com \
    --action-type move_to_folder \
    --action-value a7c3e8f1-4b2d-4e9a-b5f6-8d1c0e3a7b9f

{ "id": "b4d2a1c8-...", "name": "Enterprise inbound", "enabled": true, "stopProcessing": true }

Archive noise, set priority

Auto-archive threads from noreply addresses. Reorder rules to control which fires first — lower position wins.

# Auto-archive noreply senders
$ molted rules create --mailbox d290f1ee-... \
    --name "Archive noreply" \
    --condition-type sender_email \
    --condition-operator contains \
    --condition-value noreply \
    --action-type auto_archive

# Set priority — lower position = higher priority
$ molted rules reorder --mailbox d290f1ee-... \
    --rule-ids b4d2a1c8-...,c5e3b2d9-...,f6a4c3e0-...

A tidy inbox is a faster agent

Rules sort inbound threads the moment they arrive. Your agent skips the noise and reads from the folders that matter. Set up rules once and forget about them.