ChannelsEmail

Email rules

Route incoming email by sender, subject or an AI prompt before the AI agent sees it.

Not every email to your support address is a support request. Suppliers, recruiters, invoices, marketing, legal notices and automated system mail all arrive at the same inbox, and none of them should get an automatic answer.

Email rules act on incoming mail before it becomes a normal conversation. Each rule matches on the sender, the subject or an AI prompt, and applies one action: hand the email to your team, tag it, forward it to another department, drop it or mark it as spam.

Manage them in Settings -> Help Desk -> Email Rules, or ask Copilot or your AI agent:

Ask Copilot or your AI agent

Add an email rule that forwards supplier invoices to accounts@example.com instead of answering them. Test it on a sample invoice email before turning it on.

Rules act on email. Sender and domain Ignore rules also drop matching contact form submissions. To block a web chat visitor, use the conversation sidebar.

What a rule matches on

One condition per rule:

TypeMatches
EmailThe exact sender address. Comma-separate to match any of several addresses in one rule.
DomainThe part after the @. Exact: example.com does not match mail.example.com.
SubjectAny subject line containing your text, case-insensitively.
AI promptThe email subject and body match your written instructions.

Domain values are matched exactly as written, so keep them lowercase.

Subject lists

A Subject rule contains a list of subject phrases. Use Add phrase to add a row and the trash button to remove one. It matches when the incoming subject contains any entry. Matching ignores case, extra whitespace and equivalent Unicode composition; commas, accents, emoji and punctuation remain part of the subject. Reply prefixes such as Re: work naturally because matching uses contains, rather than exact equality.

Want in on our Secret Sale?
3 days until your private offer unlocks
Your personal invitation is ready

Every phrase is literal. Merge tags, wildcards and regular expressions have no special meaning. For personalized subjects, use a stable phrase such as Your personal invitation is ready, leaving out the customer name.

The editor accepts up to 500 unique entries, 2,000 characters per entry and 64,000 characters in total. Empty rows and duplicate entries are ignored when matching. You can paste a spreadsheet column into a row to populate multiple rows; do not comma-separate phrases. The rules table shows the first subject and the list's count, and test results identify the matched entry.

For a campaign that needs both tagging and human handling, create two Subject rules with the same list: one with Add tag, the other with Hand off. Keep their scope and active state aligned. A tag rule alone does not stop the AI agent from answering. Business scope is safest when subjects belong to a particular brand; organization scope applies the list to every brand in that organization.

AI prompt rules

Choose AI prompt and describe when the rule should return true or false. For example:

Return true when the customer asks to cancel an order. Return false for order tracking, delivery estimates, or general product questions.

Then choose the usual action: hand off, ignore, mark as spam, forward or add a tag. Several independent prompts are evaluated together; every confident match applies its configured action. Quoted history is treated as context rather than a new request. Attachments are not evaluated.

If the classifier is unavailable, the email is sent to your team rather than ignored, forwarded, or answered by AI. AI handoffs do not trigger an initial AI reply. Matches are saved with the received email so processing retries reuse the decision.

What a rule can do

ActionEffect
Hand offThe conversation is created open and already handed off. The AI agent never answers it.
Mark as spamThe conversation is created closed, handed off and tagged as spam. It stays searchable and out of queues. A later email in it that matches no spam rule and passes the spam check lifts the label (Ticket states); sender and domain rules match every email from that sender.
IgnoreNothing is created at all. The email is dropped.
ForwardThe email is forwarded to an address you specify, attachments included, and no conversation is created.
Add tagThe conversation is created normally, with your tag applied.
Use Reply-To as the customerThe email is treated as coming from its Reply-To address, for forms that send from a fixed address. Not available for AI prompt rules.

Choosing between them

Hand off is the workhorse. Use it for anything that must reach a person and must not be answered automatically: your legal address, your wholesale contacts, a specific escalated customer, a partner who expects a named human.

Ignore is for mail with no support value at all: automated bounces, monitoring alerts, newsletters you can't unsubscribe from. Be careful: an ignored email leaves no record anywhere.

Forward is for mail that belongs to another department. Invoices to finance, CVs to recruiting, press to marketing. It leaves your support queue entirely without anyone triaging it by hand.

A business forward rule can be limited to one inbox with Only on inbox; it then forwards that inbox's mail only. Forward rules never run on a restricted inbox unless they are limited to it, and only people who can see restricted inboxes can limit a forward rule to one, or change a forward rule already limited to one.

Mark as spam keeps the record while keeping it out of queues, which is the difference between it and Ignore. Prefer it when you might later want to prove an email arrived.

Add tag doesn't change routing at all; it classifies. Tag your wholesale domains, your marketplace notifications, or a specific brand's inbound, and you have a view and a reporting line for free.

Use Reply-To as the customer is for senders that relay a customer rather than being one, described below.

Use Reply-To as the customer

Website contact forms usually send every submission from one fixed address and put the customer in the Reply-To header. Left alone, Octocom treats that fixed address as the customer, so different customers merge into one conversation and replies go to the form. This action makes the Reply-To address the customer instead: each customer gets their own conversation, and replies go to them. See Keep your existing form, by email for the full setup.

  • Condition: use Email, Domain or Subject. If the address also sends mail that should stay as it is, such as order notifications, match on the form's subject instead. AI prompt conditions can't use this action.
  • Only on inbox: a business rule can be limited to one inbox. Only this action and Forward can.
  • When there is no usable Reply-To: if Reply-To is missing or on the same domain as the sender, the email keeps its original sender.
  • Order: sender and subject Ignore and Forward rules run first and see the original sender. Hand off and tag rules run afterwards, so sender-based ones see the customer. Match those on the subject.
  • Rate limits: each customer counts on their own against your inbox's per-sender limit, while the form's own address and domain keep counting against the domain limit.

To test it, choose Test email and fill in the Reply-To. Add the inbox if the rule is limited to one.

Google Groups and other mailing lists

A Google Group that delivers into your support mailbox rewrites the sender to the group's own address whenever the customer's email provider has a strict DMARC policy (Yahoo, AOL and Comcast addresses, for example), and moves the customer into Reply-To. Octocom does not undo that on its own: the headers that mark the rewrite can be written by any sender, so trusting them automatically would let someone pose as one of your customers. Add a Use Reply-To as the customer rule with an Email condition set to the group address (for example disputes@yourdomain.com), limited to the inbox the group delivers to. Rewritten emails from the group then get the customer as their sender again.

Until such a rule exists, those emails keep the group address as their sender. Only add the rule for a group you run yourself, since it trusts whatever Reply-To arrives through that address.

How several rules interact

Rules are evaluated in a fixed order rather than one you set:

  1. Ignore: if one matches, the email is dropped and nothing else runs.
  2. Forward: if one matches, the email is forwarded and nothing else runs.
  3. Hand off: marks the conversation for handoff, then continues.
  4. Mark as spam: applied when the conversation is classified, before the spam filter's AI runs.
  5. Add tag: every matching tag rule applies.

So Ignore beats Forward, and both beat everything else. Hand off, spam and tags stack: one email can be handed off and pick up three tags. Within each action, domain rules are checked before address rules, and address rules before subject rules.

AI prompt rules follow the same logic. Sender, domain and subject Ignore and Forward rules run first. Among AI matches, Ignore takes precedence over Forward, while Hand off, Mark as spam and tags can apply together. If several AI Forward rules match, the oldest rule wins, by creation time; editing a rule doesn't change its place.

What a hand-off rule also does

Marking an address for hand-off has two side effects worth knowing:

  • The email won't be merged into an existing conversation. It always starts a fresh one. That's usually correct (a supplier writing twice about different orders shouldn't become one thread), but it does mean these conversations don't accumulate history the way customer email does. See Email conversation merging.
  • Spam detection is skipped. A person is handling it, so the classifier doesn't run.

Scope

Rules apply to one business by default. When your organization has more than one, an Apply to organization switch extends a rule across all of them. That suits things like a legal address or a shared supplier that are the same everywhere.

Rules match on the email itself, not the address it was sent to, so they apply to every inbox of the business in scope. The exceptions are Forward and Use Reply-To as the customer: a business rule with one of these actions can be limited to one inbox with Only on inbox.

Test before enabling

Choose Test email on the Email Rules page and enter a sender, recipient, subject and plain-text body. The tester shows each rule's match or no-match result, AI match probabilities and threshold, skipped conditions, and the rule-based routing outcome. Add a Reply-To and select an inbox when testing inbox-specific rules.

Use Test condition in the rule editor to try the current condition without saving or enabling it. No emails are sent, conversations created, or tags applied.

The tester checks rules only. Rate limits, the spam filter and existing conversation threads are not part of the result. Test the spam filter on its own page.

A starting set

Most teams end up with something close to this:

  • Hand off: your legal, press and wholesale addresses.
  • Hand off: any partner or supplier who expects a named person.
  • Forward: invoice, receipt and billing subjects, to finance.
  • Ignore: monitoring and automated system senders.
  • Add tag: your marketplace notification domains, so they're filterable.

Add rules as the pattern appears rather than up front. The ones you need are visible in a week of reading your own inbox.

Manage and test rules through MCP

For developers and AI agents. Use list_email_rules, get_email_rule, create_email_rule, update_email_rule and archive_email_rule with a business ID in the selected organization. They support business and inherited organization rules. Organization-scoped changes affect every business in that organization. Write tools require a writable MCP connection.

  • Subject lists: use type: "subject" and put the newline-separated list in value. For the tag-and-hand-off pattern above, create one rule with action: "tag" and your tag, and another with action: "handoff". JSON exports and imports preserve the list in value.
  • Limit to one inbox: pass emailConfigId with action: "forward" or action: "useReplyTo".
  • Archive and restore: archiving removes a rule from matching and ordinary lists while retaining its settings. Find archived IDs with list_archived_configuration_resources using resourceType: "emailRule", then use restore_email_rule with organizationId and resourceId (the rule ID). Restoration resumes its saved active state.

test_email_rules takes businessId and an email object with fromEmail, recipientEmail, subject and message, plus optional replyTo and emailConfigId. By default it evaluates all configured rules together, skipping inactive rules, and returns individual evaluations plus the combined rule-based routing and tags. Add ruleId to test one saved condition, even if inactive, without enabling it; that is a condition test, not a complete routing prediction. No email actions are executed, and provider costs or latency are not returned. Because AI conditions are paid model calls, testing needs the helpdesk:write permission, as the dashboard's rule tester does.

This is a rule-only preview, not a full inbound-email simulation: rate limits, the spam filter (test it with test_spam_filter), existing thread state, attachments and provider-specific relay parsing are not simulated. It tests all eligible conditions even if real intake would stop at an earlier Ignore or Forward rule. AI results can vary between runs. Use it to check a translated or personalized subject and an unrelated one before enabling a rule.

On this page