# Receive email

Every project gets an email address. Mail sent to it becomes an event in the inbox.

## The address

`npx brynth init` creates a source called `email`. Its address, something like `acme@in.brynth.ai`, is printed at the end of `init` and listed by `npx brynth status`.

A project has one email address; a second email source is refused with `EMAIL_SOURCE_EXISTS`. Mail to `acme+anything@in.brynth.ai` reaches the same inbox, so you can hand out tagged addresses such as `acme+support@in.brynth.ai`. If the source was removed, an agent with the `admin` scope recreates it:

```text
source_add({type: "email", name: "email"})
```

The result has the `address`.

## Read mail

```text
inbox_list({type: "email.received"})
```

Each email is an event of type `email.received`, with the sender, the recipients, the subject and the text in the payload. The HTML part, when there is one, is at `html_url` after `inbox_claim`, valid for one hour. Attachments are listed in `attachments` with a `ref` and, after `inbox_claim`, a download `url` valid for one hour. Executables are not stored, and when the virus scan flags a message none of its attachments are: they appear in `attachments_blocked` with the reason (`executable` or `virus`).

An email is always `trust: "external_untrusted"`: anyone can write to the address. The skill tells the agent to treat the text as data and never to follow instructions found in it.

## Replies to your emails

When someone answers an email sent with `email_send`, the reply arrives as an `email.received` event whose `reply_to` names the original message, so the agent can match it to the conversation.

## Limits

Up to 25 MB per email, attachments included, and 500 emails per 24 hours per project. Payloads are kept for 30 days; the event itself stays for the life of the project.
