RAIA™ Specification

3.31 Multi-Tenant Email Architecture — Org Inbound, Forwarding & Reply-From (ADR-302)

Every organisation onboarded to RAIA (Real estate Artificial Intelligence Agent) gets a free alias (orgname@mail.estateaigents.com) on a single RAIA-owned collector mailbox — their enquiry emails are auto-forwarded there, processed by gmail-sync, and surfaced in the Universal Inbox. Customers only ever see the agency's own domain: @rentlondonflat.com, @smithandjones.co.uk — the mail.estateaigents.com address is internal plumbing, never exposed.

← Back to Developer Hub TEXTBOOK SPECIFICATION
3.31 — Multi-Tenant Email Architecture (ADR-302)

Every organisation onboarded to RAIA (Real estate Artificial Intelligence Agent) gets a free alias (orgname@mail.estateaigents.com) on a single RAIA-owned collector mailbox — their enquiry emails are auto-forwarded there, processed by gmail-sync, and surfaced in the Universal Inbox. Customers only ever see the agency's own domain: @rentlondonflat.com, @smithandjones.co.uk — the mail.estateaigents.com address is internal plumbing, never exposed.

✅ Live — ADR-302 Pipe Flip Complete

2026-08-05: ADR-302 pipe flip complete. GMAIL_IMPERSONATE_EMAIL now polls raia-inbound@mail.estateaigents.com. enquiries@rentlondonflat.com forwarding remains active (immortal — never decommission). Parallel run ended. This page is the current authoritative architecture reference.

The definitive reference for ADR-302: one RAIA (Real estate Artificial Intelligence Agent) collector mailbox, per-org free aliases, auto-forwarding from agency addresses, gmail-sync ingest, dedup, Universal Inbox routing, and reply-from via hello@<agencydomain>. Covers address roles, email threading guarantees, the universal 5-step onboarding plan, and known pitfalls.

ADR-302 Zero-Loss Forwarding Reply-From gmail-sync Universal Inbox
1
Collector mailbox — raia-inbound@mail.estateaigents.com
30
Free org aliases per collector (Google Workspace cap)
5 min
gmail-sync poll interval (DWD, one impersonation)
0
Customer-visible mail.estateaigents.com addresses — NEVER exposed

Multitenant Email Architecture — ADR-302 Inbound Flow Tenant Email external sender Landlord Email external sender Inbound Pipe adm@rentlondonflat.com gmail-sync Worker (ADR-302) tbl_conversations RAIA (Real estate Artificial Intelligence Agent) Inbox Universal Inbox UI + AI triage reply-from: hello@rentlondonflat.com

Live State Current Address State (2026-08-05)

This table shows the live status of every email address in the Sovereign Pilot Agency inbound setup after the ADR-302 pipe flip.

Address Role Status
enquiries@rentlondonflat.com Legacy inbound — forwards to collector Immortal — never decommission
raia-inbound@mail.estateaigents.com Collector — sole GMAIL_IMPERSONATE_EMAIL polling target LIVE — flipped 2026-08-05
rentlondonflat@mail.estateaigents.com Org alias on collector Active
accounts@rentlondonflat.com Intercom inbox DO NOT FORWARD
hello@rentlondonflat.com Reply-from (Send As on collector) Pending — Runbook §10 (step A)

Live Diagram Current Live Email Flow (post-flip)

The diagram below shows the email ingest flow as of 2026-08-05. Green = active live flow. Gray = legacy/immortal forwarder (still active, dedup gate handles duplicates).

flowchart LR
    EQ["enquiries@rentlondonflat.com
(immortal forwarder)"]:::green ALIAS["rentlondonflat@mail.estateaigents.com
(org alias on collector)"]:::green COLLECTOR["raia-inbound@mail.estateaigents.com
(sole polling target)"]:::green DEDUP["tbl_email_dedup
RFC 2822 Message-ID gate
drops duplicate forwards"]:::green ORG_RES["tbl_org_inbound_addresses
Delivered-To → organisation_id"]:::green CONV["Supabase
tbl_conversations"]:::green EQ -->|"auto-forward
(copy kept)"| ALIAS ALIAS -->|"alias delivers to"| COLLECTOR COLLECTOR -->|"gmail-sync polls
every 5 min (DWD)"| DEDUP DEDUP -->|"deduped message"| ORG_RES ORG_RES -->|"routed conversation"| CONV classDef green fill:#d1fae5,stroke:#059669,color:#065f46 classDef gray fill:#f9fafb,stroke:#9ca3af,color:#6b7280
Key dedup + routing logic
  • RFC 2822 Message-ID dedup (tbl_email_dedup): enquiries@ forwards to the org alias, which delivers to raia-inbound@. The forwarded copy and any direct-to-collector delivery share the same RFC 2822 Message-ID — the dedup gate drops the duplicate, so only one conversation is created.
  • Org resolution (tbl_org_inbound_addresses): gmail-sync reads the Delivered-To header on each message, looks up the matching address row, and resolves the organisation_id. This is the only place org routing happens — never string-parsed.
  • enquiries@ is immortal: it continues forwarding indefinitely. The dedup gate makes this zero-cost.

Overview What It Is

RAIA (Real estate Artificial Intelligence Agent) operates a single inbound email collector (raia-inbound@mail.estateaigents.com) as a Google Workspace user. Each org onboarded to the platform gets a free alias on that mailbox — e.g. rentlondonflat@mail.estateaigents.com. The agency then configures one or more of their own addresses (e.g. enquiries@rentlondonflat.com) to auto-forward inbound emails directly to their alias. The collector mailbox delivers all traffic; gmail-sync polls via DWD every 5 minutes, routes by the Delivered-To header, deduplicates by RFC 2822 Message-ID, and creates conversations in the Universal Inbox.

Replies go out From: hello@rentlondonflat.com — the agency's brand address — so customers never see a mail.estateaigents.com address. Email threading is preserved via In-Reply-To / References headers, not the From address, so changing From does not break the thread.


Diagram The Complete Email Journey (Full Architecture)

The diagram below traces the complete inbound → processing → reply loop for a landlord email. Green = active ingest flow; amber = reply path; gray dashed = cold archive branch (BigQuery).

Landlord sends email enquiry enquiries@ rentlondonflat.com (copy kept in inbox) auto-forward (copy kept) rentlondonflat@ mail.estateaigents.com collector alias — NEVER exposed gmail-sync DWD poll every 5 min one mailbox, one impersonation tbl_email_dedup Message-ID check (RFC 2822) deduped tbl_conversations one conversation per thread Universal Inbox staff triage & reply BQ Archive cold store (analytics) dashed = cold path Staff replies From: hello@rentlondonflat.com Landlord same thread Landlord replies to hello@ hello@ rentlondonflat.com rentlondonflat@ mail.estateaigents.com loop closes LEGEND Active ingest flow (green) Reply path (amber) BQ cold archive branch (gray dashed) KEY NODES Purple border = internal alias (NEVER expose) Green fill = ingest path nodes Amber fill = reply path nodes

Figure 1: The complete email journey — inbound enquiry through dedup to Universal Inbox (green), staff reply loop (amber), and cold archive branch (gray dashed). The mail.estateaigents.com alias is internal plumbing only — landlords never see it.


Architecture Address Roles

Each agency has a fixed set of address roles. Understanding which address does what is mandatory before touching any forwarding config.

Address Role Customer-visible? Notes
hello@rentlondonflat.com Brand face / reply-from YES The address customers see on all outbound replies. Sovereign Node pilot: Gmail Send As. External agencies: Resend with per-domain DKIM. Also forwards inbound to collector (dark-inbox fix — so landlord replies to hello@ still land in Universal Inbox).
enquiries@rentlondonflat.com
(and other legacy addresses)
Legacy forwarders Legacy Forward directly to the org alias. Live forever — never deleted, no autoresponders. They starve naturally as hello@ is promoted to customers. Do NOT forward enquiries@ to hello@; both forward independently to the collector.
rentlondonflat@mail.estateaigents.com Internal routing alias NEVER Internal plumbing only. Never give this address to customers, staff, or external systems. It is an alias on raia-inbound@mail.estateaigents.com — a Workspace routing handle, like a webhook URL. DB-mapped in tbl_org_inbound_addresses.
accounts@rentlondonflat.com Intercom inbox Separate DO NOT TOUCH. This is Intercom's inbox until formal Intercom exit. No forwarding, no routing changes, no aliases — ever. Hands off until Intercom exit is formally decided.

Threading Does the Email Chain Break?

Does the email chain break when we change the From address?

NO. Email threading is determined by In-Reply-To and References headers — not the From address. When a landlord receives a reply From: hello@rentlondonflat.com and hits reply, their client sets In-Reply-To: <original-message-id>. That reply arrives at hello@ (which forwards to the collector), and gmail-sync matches it to the existing conversation in tbl_conversations by Message-ID chain. The thread stays intact in every mail client.

A landlord replying to either enquiries@ or hello@ produces the same result: both addresses forward to the collector, the dedup gate passes it through, and it lands in the same Universal Inbox conversation.


Policy What We Don't Do

Zero-Loss Policy — Things We Explicitly Refuse To Do
  • No autoresponders on any address — not "we've received your email", not "please contact us at hello@ instead". Autoresponders create loops and fragment threads.
  • No address deletion — legacy addresses (enquiries@, maintenance@, etc.) live forever as dumb forwarders. Free aliases on Google Workspace are free. Dead addresses violate zero-loss.
  • No "please email hello@ instead" campaigns — we never ask customers to update their address books. Legacy addresses starve naturally as hello@ is promoted and becomes the recognised reply address over time. Consolidation happens at the inbox layer (Universal Inbox), not at the address layer.
  • No cliff-edge cutover — every address migration runs a parallel period (poll both old + new for 1–2 weeks) before flipping GMAIL_IMPERSONATE_EMAIL.

Onboarding Universal 5-Step Onboarding Plan

This plan is identical for every org. Sovereign Pilot Agency is simply org #1. Follow verbatim; do not improvise. The full step-by-step Workspace clicks are in the runbook — this page is the architecture reference; the runbook is the execution playbook.

  1. 1
    Alias Creation — RAIA (Real estate Artificial Intelligence Agent) creates the org alias

    In the EstateAigents Google Workspace admin console: open raia-inbound@mail.estateaigents.com → Alternate email addresses → add <orgslug>@mail.estateaigents.com. RAIA (Real estate Artificial Intelligence Agent) assigns the slug (human-readable, unique, DB-enforced). Agency does not pick it — it's a routing handle. Update tbl_org_inbound_addresses. Confirm in the Workspace admin that the alias is active.

  2. 2
    Forwarding Setup — Agency sets up forwarding

    Agency configures their chosen inbound addresses (e.g. enquiries@) to forward to the new org alias. For Gmail Workspace: Settings → Forwarding → Add forwarding address → orgname@mail.estateaigents.com. For Exchange/Outlook agencies: mailbox-level SMTP forwarding only — ForwardingSmtpAddress + DeliverToMailboxAndForward=true. Never client-rule forwarding (see Pitfalls). Include hello@ in the forwarding set to close the dark-inbox.

  3. 3
    Verification Gate — Test UUID must arrive before go-live

    RAIA (Real estate Artificial Intelligence Agent) sends a test email containing a unique UUID to the org alias directly. gmail-sync must pick it up and create a conversation in the Universal Inbox within 10 minutes. Gate: do not proceed to Phase C (live forwarding) until this verification email is confirmed in the Universal Inbox. A missed verification = a broken forwarding rule, a DWD issue, or an unverified alias — resolve before go-live.

  4. 4
    Parallel-Run Cutover — 1–2 week overlap period

    Both old and new ingest paths run simultaneously for 1–2 weeks. The tbl_email_dedup Message-ID gate prevents duplicates from reaching the Universal Inbox. After parallel run, confirm zero gap in conversation continuity, then flip GMAIL_IMPERSONATE_EMAIL to raia-inbound@mail.estateaigents.com. Reference: ADR-302 §9 rows 8–10.

  5. 5
    Reply-From Nomination — Agency nominates their brand address

    Set the agency's brand address as the reply-from. For Sovereign Node pilot: configure hello@rentlondonflat.com as Gmail Send As on the collector mailbox. For external agencies (agency #2+): Resend per-domain DKIM setup — agency adds CNAME records (~10 min), RAIA (Real estate Artificial Intelligence Agent) configures From: hello@<agencydomain> in the send path. Reference: Runbook Phase A + C.

References

ADR-302: 03_technology/architecture/decisions/ADR-302-multitenant-email-orgname-inbound.md
Runbook: 03_technology/architecture/runbooks/RUNBOOK-email-cutover-workspace-steps.md


Strategy RAIA (Real estate Artificial Intelligence Agent) as First-Line Responder

90 days is the evidence of human failure. RAIA (Real estate Artificial Intelligence Agent) eliminates this.

The 90-day ingestion window used at onboarding is a one-time historical import parameter, not an operational archiving policy. The data below is the evidence that human-only triage is broken — and the motivation for building RAIA.

Human Response Time Distribution — Sovereign Node Intercom (24 months, 94,167 conversations)

Source: BigQuery analysis of Sovereign Node Intercom data, 2026-08-06. 94,167 email conversations over 24 months.

Reply window % of all replies Cumulative
Same day27.8%28%
Within 1 day19.7%48%
Within 3 days14.4%62%
Within 7 days14.8%77%
Within 14 days8.6%85%
Within 30 days7.1%92%
Within 60 days4.4%97%
Within 90 days1.8%99%
90+ days1.4%100%
Interpretation — this is a failure ledger, not a performance benchmark

This table does NOT describe acceptable operational performance. It describes the historical failure rate of human-only email triage. A reply taking 90 days is a system failure, not a normal lifecycle event. The 90-day data point is the motivation for building RAIA (Real estate Artificial Intelligence Agent) — not the operational target.

RAIA-First Escalation Ladder

All inbound email is triaged and auto-drafted within minutes. Threads stay hot until RESOLVED — no automatic archiving by age.

  1. 24h
    RAIA (Real estate Artificial Intelligence Agent) flags: "Unanswered — draft reply available"

    RAIA (Real estate Artificial Intelligence Agent) has already auto-drafted a reply. Human sees a clear flag: this thread is waiting. No timer has lapsed — RAIA (Real estate Artificial Intelligence Agent) is prompting action, not recording failure.

  2. 7d
    RAIA (Real estate Artificial Intelligence Agent) escalates to human operator with draft

    Thread escalated. The draft is surfaced prominently. Human must act: send, edit, or explicitly defer.

  3. 14d
    Alert: "This contact has been waiting 2 weeks"

    Escalation intensifies. 14 days unanswered historically represented 8.6% of replies under human-only triage. Under RAIA, this is a failure state — not a normal bucket.

  4. 30d+
    Critical alert: human must explicitly defer or resolve

    A 30-day-unanswered thread requires an explicit human decision. No passive ageing out. The contact is still waiting — RAIA (Real estate Artificial Intelligence Agent) keeps it visible until resolved.

  5. 90d+
    System failure alert — not normal operation

    90+ days unanswered is a system failure, not a lifecycle event. Under human-only triage, 1.4% of all replies landed here. RAIA's target is zero.

Current State vs Target State

  Human-only (current) RAIA-first (target)
First response Hours to days Minutes — RAIA (Real estate Artificial Intelligence Agent) auto-draft
14-day unanswered 15% of all replies happen here Should be 0% — RAIA (Real estate Artificial Intelligence Agent) escalates at 24h
90-day unanswered 1.4% of replies (normal operation) System failure alert — not normal operation
Archive trigger Time-based (90 days) Resolution-based (resolved = archive)
Two distinct uses of "90 days"
  • Historical import on setup: import last 90 days of email when onboarding a new org (one-time, data-backed — justified by the table above: 99% of replies happen within 90 days, so the import captures the live tail of every open conversation).
  • NOT an operational archive trigger: threads are not archived by age, only by resolution status. The 90-day import window is a setup parameter. It has no operational meaning once the org is live.

Pitfalls Known Failure Modes

1
Exchange / Outlook client-rule forwarding

Agency staff occasionally set up forwarding as an Outlook client rule (Rules → Forward). This only works when Outlook is open on a specific machine — forwarding stops when the PC sleeps, restarts, or the user is on holiday. Required pattern: Exchange mailbox-level SMTP forwarding only — Set-Mailbox -ForwardingSmtpAddress <alias> -DeliverToMailboxAndForward $true. This runs server-side 24/7. Never accept client-rule forwarding from an Exchange agency.

2
Disclaimer injection breaking DKIM

Some Exchange/Office 365 tenants have a transport rule that appends a legal disclaimer to every outbound email. When the email is forwarded, the disclaimer modifies the body after the DKIM signature was computed — DKIM verification fails at the receiving end, which may cause spam classification or bounce. Fix: exclude the forwarding address (orgname@mail.estateaigents.com) from the disclaimer transport rule, or use DeliverToMailboxAndForward at the mailbox level so the disclaimer is not applied to the forwarded copy.

3
Dark-inbox — reply-from address must be in the forwarding set

When RAIA (Real estate Artificial Intelligence Agent) sends a reply From: hello@rentlondonflat.com, a landlord who replies goes to hello@. If hello@ is not forwarding to the collector, that reply never reaches the Universal Inbox — the landlord gets no response, staff see nothing. Always include hello@ in the forwarding set. ADR-302 §3 specifies this explicitly: the reply-from address must itself forward to the org alias. Verify at onboarding step 2 and again at step 3 (verification gate test from hello@).

4
Intercom accounts@ guard

accounts@rentlondonflat.com (and equivalent addresses at other agencies) is Intercom's dedicated inbox. Do not forward it, do not alias it, do not add it to the Universal Inbox routing set — until Intercom exit is formally decided and executed. Forwarding accounts@ before Intercom exit will silently split conversations across two systems, creating duplicates that are impossible to reconcile. This guard applies to every org at onboarding.


Next Steps Remaining ADR-302 Runbook Items

The pipe flip (Phase C) is complete. The following items are the remaining ADR-302 implementation steps, in priority order.

  1. 1
    Add hello@rentlondonflat.com as Send As on raia-inbound@ (Runbook §10 / Phase A)

    Configure hello@rentlondonflat.com as a Gmail "Send As" alias on the collector mailbox (raia-inbound@mail.estateaigents.com). Requires verification from hello@. Solves the reply-from brand face for the collector. Reference: RUNBOOK-email-cutover-workspace-steps.md §1 (Phase A).

  2. 2
    Add hello@ to the forwarding set and tbl_org_inbound_addresses

    Once platform replies go out From: hello@rentlondonflat.com, landlord replies will land at hello@. At that point, forward hello@ to the collector and add a row in tbl_org_inbound_addresses. Until then, hello@ is reply-from only — this step closes the dark-inbox (ADR-302 §3).

  3. 3
    Add maintenance@, tenancies@ etc. forwarding one address at a time

    Each additional Sovereign Node address that should be captured in the Universal Inbox must be added individually: (a) add forwarding in the Sovereign Node Workspace, (b) add a corresponding row in tbl_org_inbound_addresses. Order matters — never forward before the DB row exists. accounts@rentlondonflat.com is excluded until Intercom exit.

  4. 4
    Health monitor cron (tbl_org_email_health) — deferred

    Per-org email health monitoring (last-seen timestamp, gap alerts, bounce rate) will be tracked in tbl_org_email_health. Implementation is deferred until the single-org pilot is stable. Do not implement until Step 3 above is complete for at least one additional address.


References Sources & Authoritative Files

Source Type Notes
ADR-302 — Multi-Tenant Email Architecture Architecture Decision Record SSOT for all decisions on this page. Red-team verdict by Anthropic claude-fable-5, accepted 2026-08-05. Supersedes ADR-301 (hello@ as canonical inbound pipe). File: 03_technology/architecture/decisions/ADR-302-multitenant-email-orgname-inbound.md
RUNBOOK — Email Cutover Workspace Steps Operational Runbook Verbatim click-by-click Workspace steps for Phases A (Send As), B (collector setup), C (forwarding), and rollback. File: 03_technology/architecture/runbooks/RUNBOOK-email-cutover-workspace-steps.md
ADR-301 (superseded) Superseded ADR hello@ as canonical inbound pipe — killed by ADR-302. hello@ survives as reply-from only. Do not implement ADR-301 patterns.
gmail-ingestion-plan (deprecated) Deprecated Doc Pre-ADR-302 page documenting hello@-as-pipe and the Dual-LLM ingestion spec. Superseded by this page. Archived at docs/raw/archive/gmail-ingestion-plan-deprecated-2026-08-05.html.