Help Desk

Email Rules

Routing inbound email by sender, domain, subject or AI prompt — handing off, tagging, forwarding, ignoring, marking as spam and using Reply-To as the customer before the bot 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 be answered by a bot.

Email rules act on inbound mail before it becomes a normal conversation. Each rule matches on the sender, the subject, or an AI prompt and applies one action.

Settings are under Settings → Help Desk → Email Rules. This page configures email routing only. Manage web-chat blocks from 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 subject 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. Existing single-subject rules still use contains matching.

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 bot. Business scope is safest when subjects belong to a particular brand; organization scope applies the list to every brand in that organization.

Through MCP, use type: "subject" and put the newline-separated list in value, with action: "tag" and your tag on one rule, and action: "handoff" on the other. JSON exports and imports preserve the list in value. Use test_email_rules to verify a translated or personalized reply and an unrelated subject before enabling the rules.

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. These rules apply to email only. 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 bot reply. Matches are saved with the received email so processing retries reuse the decision.

Sender, domain, and subject ignore/forward rules run first. Among AI matches, ignore takes precedence over forwarding; handoff, spam, and tags can apply together. If multiple AI forwarding rules match, the oldest rule wins.


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 relay 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 results list scrolls independently, so large rule sets do not keep expanding the dialog.

When several rules match

Rules do not use a configurable priority or a universal "first match wins" order. Deterministic ignore and forwarding checks run before AI rules. Among AI matches, ignore takes precedence over forwarding; spam/handoff suppress automated handling, and matching tags combine unless an ignore or forward action stops intake. Multiple matching AI forwards use the oldest rule by creation time, then ID as a stable tie-breaker. Updating a rule does not move it earlier or later.

Managing and testing rules through MCP

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, but not global platform rules. Organization-scoped changes affect every business in that organization. Write tools require a writable MCP connection; rate-limit exemption changes are restricted to Octocom admins.

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; rate-limit exemption restoration requires Octocom admin access.

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. AI usage is recorded internally. No email actions are executed, and provider costs or latency are not returned.

This is a rule-only preview, not a full inbound-email simulation: rate limits, automatic spam detection, 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.

What a rule can do

ActionEffect
Hand offThe conversation is created open and already handed off. The bot never answers it.
Mark as spamThe conversation is created closed, handed off and tagged as spam. It stays searchable but never enters a queue.
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.

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. It is the only action that 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.

To test it, choose Test email and fill in the Reply-To. Add the inbox if the rule is limited to one. Through MCP, use create_email_rule with action: "useReplyTo" and, optionally, emailConfigId to limit it to one inbox.


How several rules interact

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

  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.
  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 before subject.


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 auto-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 — right for things like a legal address or a shared supplier that are the same everywhere.

Rules match on the sender and subject only, so they apply to every inbox of the business in scope. The exception is Use Reply-To as the customer, which a business rule can limit to one inbox.


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.

On this page