# Sortbay Inbox Triage Rules > Test inbox rules on real mail: which labels, assignee, status and due date each message gets. Runs deterministic triage rules — conditions on sender, recipients, subject, text, attachment names or source, actions that add labels, assign, set a status or a due date — over e-mails from an .eml/.mbox file and explains for every message which rule matched and what it set. The same evaluator sorts new mail in the Sortbay shared inbox. Part of usefulweb.site (https://usefulweb.site/). Part of [Sortbay](https://sortbay.usefulweb.site/) (ownerApp: sortbay). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://sortbaytriagerules.usefulweb.site/ (interactive tool at https://sortbaytriagerules.usefulweb.site/tool) - JSON API: POST https://sortbaytriagerules.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://sortbaytriagerules.usefulweb.site/api/v1/tool) - OpenAPI: https://sortbaytriagerules.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://sortbaytriagerules.usefulweb.site/mcp - tool `sortbay_triage_rules` ## Inputs - source (textarea): E-mail source (.eml text) or mbox - Paste the full source of a message (headers, a blank line, then the body) — in most mail programs “Show original” or “View source”. Several messages: paste an mbox (each starts with a “From ” line). - file (file): E-mail file (.eml or .mbox, optional) - Up to 10 MB. Used instead of the pasted text when given. Export single mails as .eml or a folder as .mbox from your mail program. - rules (textarea): Rules (JSON list) - Each rule: name, match (all | any), conditions [{ field, op, value }], actions { labels, assignee, status (open | waiting | done), dueInDays, stop }. Fields: from, to, subject, body, text, attachment, source. Comparisons: contains, not_contains, equals, starts_with, ends_with, domain_is, any_word, is_empty, has_attachment. - today (text): Today (YYYY-MM-DD, base for due dates of undated mail) ## Method - A rule matches when all (match: all) or any (match: any) of its conditions hold. Comparisons ignore case and accents; there are no user regular expressions, so a rule can never hang the evaluator. - Rules run in order. Labels of every matching rule are collected; assignee, status and due date come from the FIRST matching rule that sets them; a matching rule with stop ends the evaluation for that message. - Due dates are the message date (UTC day) plus dueInDays; messages without a date use “today”. “text” means subject and body together; “to” covers To and Cc; domain_is also matches subdomains.