# Receive e-mail

> Point an address or a subdomain at Mail and get every message as JSON.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://mail.docs.sypnia.com/inbound/receive-email/

For agents: Mail inbound: mail inbound add <address or *@subdomain> --to <url|run://fn>; needs MX 10 inbound-smtp.us-east-2.amazonaws.com; use a subdomain if main domain uses Google Workspace/M365; webhook JSON {id, from, to, subject, text, html, inReplyTo (links to sent e-mail), attachments [signed URLs 7 days, optionally kept in Sypnia Files], spam {verdict, virus, spf, dkim, dmarc}}; up to 30 MB; viruses dropped; spam verdicts passed on.

```bash
npx @sypnia/mail inbound add soporte@laespiga.co --to https://laespiga.co/api/inbound
npx @sypnia/mail inbound add '*@reply.laespiga.co' --to run://inbound-replies
```

Receiving needs the domain's (or the subdomain's) `MX` record to point to Mail: `10 inbound-smtp.us-east-2.amazonaws.com`. Use a **subdomain** such as `reply.laespiga.co` if your main domain already receives mail in Google Workspace or Microsoft 365, so nothing changes for your people.

## What your webhook receives

```json
{
  "id": "in_01JD…",
  "from": { "address": "ana@example.com", "name": "Ana" },
  "to": ["soporte@laespiga.co"],
  "subject": "Re: Tu pedido #1042 está listo",
  "text": "¿Puedo recogerlo mañana?",
  "html": "<p>¿Puedo recogerlo mañana?</p>",
  "inReplyTo": "em_01JD…",
  "attachments": [{ "filename": "foto.jpg", "contentType": "image/jpeg", "size": 182330, "url": "https://…signed…" }],
  "spam": { "verdict": "pass", "virus": "pass", "spf": "pass", "dkim": "pass", "dmarc": "pass" }
}
```

`inReplyTo` links a reply to the e-mail you sent, so a support thread can be followed. Attachments are stored and given as signed URLs valid for 7 days; with Sypnia Files they can be kept in a bucket you choose.

## Limits

Messages up to 30 MB. Messages that fail the virus check are dropped and recorded; spam verdicts are given to you to decide.
