Email for Your SaaS Product: Connect Customer Mailboxes or Host Inboxes?
"Handle the email" hides a big choice: work inside the customer's mailbox or give their agent its own. Here is how to pick, and how to set up the hosted path.
By Toan Nhu

A customer signs up for your product on Monday. By Wednesday they want it to "handle the email." That one sentence hides a big architecture choice, and most teams make it by accident in the first sprint.
Either your product signs in to the customer's existing mailbox and works inside it, or your product gives the customer (or the customer's agent) a mailbox of its own. Both are valid. They lead to very different security reviews, support tickets and cost curves, so it pays to choose on purpose.
The question behind "handle the email"
Before you look at any provider, write down what the email feature actually does. Most SaaS email features fall into one of three jobs:
- Work on the customer's own mail. Summarize their inbox, triage it, draft replies they will send as themselves.
- Run a new job in its own name. A support desk, a sales assistant, a scheduling agent, a bot that collects invoices. The customer wants the work done, not their personal inbox touched.
- Just catch inbound messages. Receive replies to a form, parse an attachment, trigger a workflow. Nobody needs a full mailbox.
The first job points to connecting existing accounts. The second points to hosted inboxes. The third may need neither. Mixing them up is where projects go sideways.
Why the default choice often goes wrong
The usual default is "connect their Gmail or Outlook," because the customer already has it. It feels like the least work. In practice it brings three problems that show up later:
- Consent and review overhead. Reading and sending mail on someone's behalf needs broad OAuth scopes. Google treats full mailbox access as a restricted scope that can require an app verification and security assessment before you can serve many users. Microsoft tenants often need an admin to approve the app.
- Blast radius. Your product now holds a token that can read years of private mail, including mail that has nothing to do with your feature. One bug or one prompt injection reaches all of it.
- Muddy identity. Everything your automation sends looks like the human sent it. When a customer asks "did I write that?", the log cannot answer cleanly. Our explainer on OIDC for AI agents covers why agent identity and accountability matter.
None of this means connecting is wrong. It means you should only pay that cost when the feature truly needs the customer's existing mail.
Option 1: connect the customer's existing mailbox
Choose this when the value is the history. An assistant that summarizes a founder's inbox has nothing to work with in an empty mailbox.
What you take on:
- An OAuth flow per provider, token refresh, and handling revoked or expired grants.
- Scope minimization: ask for read-only first, add send only when the user turns that feature on.
- A clear rule for when the agent may send as the human. A safe default is drafts only, with the human pressing send.
- Data handling commitments for mail you never needed but can technically read.
If you go this way, our Gmail and Outlook safety check for AI agents is a good list to run before launch.
Option 2: host an inbox for each customer or agent
Choose this when the job is new work done in the product's or agent's own name. Support, outreach, receipts, sign-ups and vendor follow-ups all fit.
What changes:
- No access to the customer's private mail. The agent only sees what is sent to its own address.
- Clean identity. The address itself says who acted, for example billing-agent@mail.customer.com.
- You own the lifecycle. You create the inbox at signup, scope its credentials, and retire it when the customer leaves.
The trade-off is that the customer's existing threads are not there. If they want some of that history, auto-forwarding a filtered subset into the agent's inbox is a middle path that keeps the personal mailbox untouched.
Option 3: inbound parsing only
If your feature only needs to receive a message and pass it to code, a full inbox may be overkill. A webhook that fires when mail arrives can be enough. Move up to a real inbox once you need replies in the same thread, search over past mail, drafts, or a human reviewing what goes out. Our guide to email webhooks for AI agents covers that pattern.
A quick decision table
| Your feature | Start with |
|---|---|
Summarize or triage the user's own mail | Connect existing mailbox, read-only first |
Agent does a new job and replies to people | Hosted inbox per agent |
Many customers, each with their own agents | Hosted inboxes grouped per customer |
Only receive and parse inbound mail | Inbound webhook, upgrade later |
How Mermail fits the hosted model
Mermail is built for option 2. It gives each AI agent its own mailbox and keeps that mailbox separate from anyone's personal Gmail or Outlook. The pieces that matter for a SaaS product:
- Workspaces as the customer boundary. A Mermail workspace groups mailboxes, members, custom domains, billing, storage and usage. The docs recommend one workspace per team or customer deployment, which maps neatly to tenants. See Workspaces.
- Workspace-scoped API keys. Each key is bound to one workspace, and a request that names another workspace is refused. That gives you a hard line between customers. See Authentication.
- Mailboxes by API, safely repeatable. Creating a mailbox accepts an Idempotency-Key header, so a retried signup does not create a duplicate inbox.
- Customer domains. On paid plans, each workspace can connect one custom domain, ideally a dedicated subdomain such as mail.customer.com, and its mailboxes move to it. See Custom domains.
- Human-in-the-loop drafts. The built-in reply triager saves replies as drafts for review instead of sending them.
- MCP, CLI and API. Your own agents can use the Mermail MCP server with OAuth, or call the REST API directly.
Two things to know up front. Mermail does not offer a language SDK; you call the REST API (the docs playground generates snippets in several languages) or use MCP and the CLI. And workspaces themselves are created in the Mermail console, not through the API, so plan tenant onboarding around that.
Set it up in five steps
- Classify the feature. Use the table above. If it is "work on the user's own mail," stop here and design the OAuth path instead.
- Decide the tenant boundary. One workspace per customer deployment is the simplest model to reason about for billing, storage and access.
- Create a workspace-scoped API key for each workspace in Settings, API Keys, and store it in your secrets manager next to that tenant's record.
- Create a mailbox per agent when the customer turns the feature on. Send an Idempotency-Key with the request so retries are safe, and save the returned mailbox id with the agent.
- Keep sends behind review at first. Let the agent draft, have a person approve, and loosen it only after you have watched real traffic. Add a custom domain once the customer wants mail to come from their brand.
You can try this today in the Mermail console. For the wider pattern of creating inboxes in code, read create an email inbox per AI agent by API.
FAQ
Can I offer both models in one product?
Yes, and many products should. Use a connected mailbox for features that read the user's own mail, and a hosted inbox for agents that act in their own name. Keep the two credentials and code paths separate.
Will customers accept mail from a new address?
Mail from a dedicated subdomain on the customer's own domain usually reads as legitimate, because it is. Set up SPF, DKIM and DMARC for that subdomain first. Our SPF, DKIM and DMARC rollout guide walks through it.
Does a hosted inbox mean the agent sends without approval?
No. With Mermail, the reply triager saves drafts for a person to review. Sending on its own is a choice you make per workflow.
What happens if a human replies from their normal email client?
If mail is forwarded into Mermail from your original provider (Gmail, Outlook, iCloud Mail and others), a human reply in the original mailbox is a takeover, and Mermail permanently stops AI processing for that whole thread. A hosted Mermail inbox has no original provider, so that takeover does not apply; the built-in reply triager saves drafts for a person to review instead.


