# Inbound email

> Receive email at any address on a subdomain of your verified domain, get an email.received webhook, and fetch the full message with the API.

Inbound email lets your application receive messages, not only send them. You point an MX record for a subdomain such as `inbound.acme.com` at Emailit, and every message sent to any address on that subdomain is stored in your workspace and announced with a webhook. Use it for reply handling, support inboxes, parsing documents out of emails, or forwarding mail to a team.

## How it works

1. **You publish one MX record.** The record for `inbound.<your domain>` points to `inbound.emailitmail.com` with priority 10. The MX records on your root domain stay with your mailbox provider, so your normal mail keeps working.
2. **Someone emails an address on that subdomain.** Every local part is accepted, for example `support@inbound.acme.com` or `reply+4821@inbound.acme.com`. There are no mailboxes to create.
3. **Emailit accepts and stores the message.** It's saved as an email with type `inbound` and status `received`, and costs 1 credit.
4. **Emailit creates an `email.received` event.** Webhooks subscribed to it receive a small payload with the email ID, `from`, `to`, `subject` and `created_at`. The body and attachments aren't in the webhook.
5. **Your app fetches the content.** Call [Retrieve an email](/docs/api-reference/emails/get/) with the ID to get the parsed text and HTML body, headers and attachments, or [Retrieve raw MIME](/docs/api-reference/emails/raw/) for the original message.
6. **Optionally, an automation acts on it.** The **Email received** trigger in [Automations](/docs/automations/) can forward the message or start other steps.

Received messages also appear in the dashboard under **Email API → Emails** on the **Incoming** tab, where you can open each one to see its headers, content and attachments.

## What you can do

  - [Set up inbound](/docs/inbound/set-up/): Publish the MX record, choose the subdomain and send a test message.
  - [Process with webhooks](/docs/inbound/process-with-webhooks/): Verify the webhook, fetch the message and handle attachments in Node.js, Python or PHP.
  - [Forward with automations](/docs/inbound/forward-with-automations/): Forward every received email, or only some, to another address without code.
  - [Inbound quickstart](/docs/quickstart/inbound/): Receive your first email in a few minutes.

## Limits and behavior

| Item | Behavior |
| --- | --- |
| Domain | The domain must be a verified sending domain in your workspace (SPF, DKIM and return path records OK). |
| Addresses | Any address at `<inbound subdomain>.<your domain>`. The default subdomain is `inbound`; you can change it with the API. Addresses on the root domain aren't accepted. |
| Message size | Up to 40 MB per message, the same limit as SMTP sending. |
| Cost | 1 credit per received message. If the workspace has no credits, Emailit answers `452 Insufficient credits to receive inbound email` and the sending server retries later. |
| Webhook payload | `email.received` carries only the ID and envelope fields. Fetch the body, headers and attachments with the API. |
| Spam filtering | Emailit doesn't score or filter inbound messages for spam. Apply your own checks before acting on content. |
| Analytics | Inbound messages aren't counted in [Analytics](/docs/analytics/), which covers outgoing email. |

There's no routing interface for inbound mail: no per-address mailboxes, rules or catch-all settings in the dashboard. Route messages in your own code by reading the `to` address in the webhook, or use the [Forward received email](/docs/inbound/forward-with-automations/) automation to send everything, or a filtered subset, to another inbox.

## Retention

Inbound messages follow your workspace's [data retention](/docs/data-retention/). Message contents (body, headers and attachments) are kept for a shorter time than the message record, so fetch and store what you need when the webhook arrives. After contents are purged, the API returns the email without its body or attachments.

| | Pay as you go | Pro | Business | Custom |
| --- | --- | --- | --- | --- |
| Message contents kept | 7 days | 30 days | 30 days | Flexible |
| Message activity kept | 30 days | 365 days | 365 days | Flexible |

## Next steps

  - [Set up inbound](/docs/inbound/set-up/)
  - [Webhook event types](/docs/webhooks/event-types/)

---
Source: https://emailit.com/docs/inbound/
