C Concierge Documentation
Docs / Channels / Email routing
Channel · 3 of 4

Email routing.

Concierge provides managed email subdomains with smart routing. Each tenant gets one or more subdomains (e.g., acme.cncg.email) provisioned automatically. Inbound emails are matched against configurable routing rules and actions are executed automatically.

Getting Started

  1. Go to Email Routing in the admin panel
  2. Enter a subdomain name (e.g., acme): this creates acme.cncg.email
  3. You'll be redirected to Razorpay to complete payment (₹199/$2 per subdomain per month)
  4. Once payment confirms, MX records are provisioned automatically and your subdomain goes live
  5. Any email to *@acme.cncg.email is now processed by your routing rules
  6. Set up routing rules to forward, relay to Discord, or auto-reply with AI

Billing plans are created automatically based on the number of subdomains and currency. No manual configuration needed.

How It Works

  1. An email arrives at any address on your subdomain (e.g., support@acme.cncg.email)
  2. Cloudflare Email Routing triggers the Worker's email() handler
  3. The recipient domain is extracted and mapped to a tenant via a KV index
  4. The email is parsed (subject, body, attachments)
  5. A loop-detection header (X-EmailProxy-Forwarded) is checked
  6. Routing rules for that subdomain are evaluated in priority order
  7. The highest-priority matching rule's action is executed
  8. If no rule matches, the subdomain's default action is used (defaults to Drop)
  9. The action is logged to the email_messages table and email_metrics counters

Subdomains

Each tenant can have multiple email subdomains. A subdomain represents a catch-all email endpoint under the operator's email zone. Subdomains are managed via the web admin panel.

  • Pricing: ₹199/$2 per subdomain per month (recurring via Razorpay)
  • Provisioning: MX records are created automatically when you add a subdomain
  • Suspension: If payment fails, the subdomain is suspended and MX records are removed
  • Deletion: Removes MX records, cancels subscription, and clears all rules

Each subdomain has a default action that applies when no routing rule matches. The default is Drop (silently discard).

Subdomain Naming Rules

  • 3–63 characters
  • Letters, numbers, and hyphens only
  • Cannot start or end with a hyphen
  • Reserved names (www, mail, admin, api, etc.) are blocked
  • Must be globally unique across all tenants

Routing Rules

Rules are per-domain, evaluated in priority order (highest priority wins). Each rule has:

FieldDescription
nameHuman-readable label
priorityInteger priority (higher = evaluated later, wins over lower)
enabledToggle on/off without deleting
criteriaMatch conditions (see below)
actionWhat to do when the rule matches

Match Criteria (Glob Patterns)

Rules match using glob patterns with * (any sequence) and ? (single character). Matching is case-insensitive. All specified criteria must match (AND logic). Omitted criteria match everything.

CriterionDescriptionExample
from_patternSender email address*@newsletter.com
to_patternRecipient email addresssupport+*@example.com
subject_patternEmail subject line*invoice*
body_patternPlain-text body content*unsubscribe*
has_attachmentWhether the email has attachmentstrue or false

Pattern Examples

  • *: matches everything
  • *@example.com: any address at example.com
  • *@*.example.com: any subdomain of example.com
  • support+*@example.com: plus-addressed support emails
  • *invoice*: subject or body containing "invoice"

Actions

ActionDescription
DropSilently discard the email. Nothing is sent back.
SpamReject the email with an optional message. The sender's MTA receives the rejection.
Forward EmailForward to a destination email address. A reverse-alias is generated for reply routing (see below).
Forward DiscordPost the email content to a Discord channel as an embed. The email is consumed (not forwarded via SMTP).
AI ReplyGenerate an AI draft reply using Workers AI, then post it to a Discord channel for human approval before sending.

Reverse-Alias Reply Routing

When an email is forwarded via the Forward Email action, Concierge generates a unique reverse-alias address on the subdomain (e.g., reply+abc123@acme.cncg.email). This alias is used as the From address in the forwarded email.

When the recipient replies to the forwarded email, their reply goes to the reverse-alias address. Concierge looks up the alias, finds the original sender, and forwards the reply back to them, making the conversation appear seamless.

  1. Email from alice@external.com to support@acme.cncg.email
  2. Concierge forwards to you@personal.com with From: reply+abc123@acme.cncg.email
  3. You reply to reply+abc123@acme.cncg.email
  4. Concierge forwards your reply back to alice@external.com with From: support@acme.cncg.email

AI Reply with Approval

The AI Reply action generates a draft response using Cloudflare Workers AI. The draft is not sent automatically; it is posted to a Discord channel for human approval with Approve and Reject buttons.

  • Approve: sends the AI-generated draft to the original sender
  • Reject: discards the draft
  • You can also click Reply to write a custom response instead of using the draft

The AI Reply action supports an optional system_prompt to customize the AI's behavior for specific types of emails.

Managing Rules

Rules are managed via the web admin panel. Each subdomain has its own rules page with full CRUD.

Use Discord /domains list to view your subdomains and their status.

Outbound Delivery (Email Service)

Concierge forwards to arbitrary recipients, so the sender domain must be onboarded to Cloudflare Email Service. Onboard each email base domain in the dashboard under Email → Email Sending → Onboard Domain; Cloudflare adds SPF/DKIM/DMARC records on a dedicated cf-bounce.<your-domain> subdomain.

Outbound goes through the send_email binding using Email Service's structured API. Forwarded messages carry the parsed subject, text, html, a Reply-To set to the reverse-alias, threading headers (In-Reply-To, References), and the loop-detection header.

Loop Detection

Concierge adds an X-EmailProxy-Forwarded header to forwarded emails. If an inbound email already has this header, it is rejected to prevent forwarding loops.

Metrics

Email actions are tracked in the email_metrics table, aggregated by domain, rule, date, and action type. View them via the /status Discord command or the management panel.