# Inbound email

Inbound email turns a Bonga workspace into a receiving mail system: addresses on your domain, routing rules, captured messages and signed webhooks.

## Receiving domains

A receiving domain is a domain whose MX record points at Bonga's inbound mail service. Add it under **Dashboard → Inbound email → Receiving domains** and publish the MX record.

The setup flow has three parts:

1. **Verify ownership** of the domain.
2. **Publish the MX record** Bonga shows, or let Bonga write it when DNS is connected.
3. **Wait for propagation**; Bonga reads the record independently before marking the domain ready.

A domain that is not ready cannot receive. The same rule applies to a domain blocked by platform policy.

![Bonga channels page showing connected email providers and their readiness](/images/docs/bonga-channels-connections.png)

## Addresses and rules

A rule binds an address to an action:

| Match | Example | Use |
| --- | --- | --- |
| `exact` | `support@example.com` | One shared mailbox |
| `prefix` | `team-*@example.com` | Per-team addresses |
| `suffix` | `*@support.example.com` | A dedicated subdomain |
| `catch-all` | `*@example.com` | Everything not matched elsewhere |

Actions:

- **store** — keep the message and show it in the inbox.
- **forward** — send it to verified destination addresses.
- **webhook** — POST a signed event to a workspace endpoint.

One workspace owns an address at a time. A broad rule claims the whole domain, so two workspaces cannot compete for the same address.

## Captured messages

Captured messages include sender, recipients, subject, text, sanitized HTML, authentication results, spam verdict, attachments and threading headers. The message is untrusted data. A reply joins a thread through a signed Reply-To token or standard `In-Reply-To` and `References` headers.

Private attachments and raw MIME are stored in the private file backend and downloaded only through an authorized, audited route. Retention is bounded; expired content is erased before the metadata tombstone is released.

## Forwarding

Forwarding depends on where the rule runs. A Bonga receiving (MTA) forward sends a copy to verified destinations with its own SRS, authentication and loop checks; a forward-only rule keeps **no Bonga inbox copy**. Forwarding an existing conversation from the inbox is a new send and is subject to sending-domain verification.

## Webhooks

A webhook rule creates a signed `message.received` event. The signature covers the raw body with a per-rule secret. Verify it before parsing, and deduplicate with the event ID. See [Webhooks](/docs/webhooks).

## The inbox

Captured mail appears in the shared inbox beside WhatsApp and SMS. A team can assign, reply, note, label and resolve it. An agent can also read and reply under policy. See [Inbox and Messenger](/docs/inbox) and [AI agents](/docs/agents).

## Troubleshooting

| Symptom | Check |
| --- | --- |
| No mail arrives | MX record, domain verification, domain status |
| Mail arrives but no inbox entry | Rule action, capture state, retention |
| Reply does not thread | Reply-To token validity, `In-Reply-To`/`References` |
| Forward fails | Destination verification, sending domain |
| Webhook not delivered | Endpoint URL, event subscription, signature, retries |

## Next

- [Email](/docs/email)
- [Webhooks](/docs/webhooks)
- [API reference](/docs/api-reference)
