---
title: SMTP
icon: smtp
description: Set up and run the Reloop outbound SMTP engine locally in Docker.
---
> For the complete documentation index, see [llms-docs.txt](/llms-docs.txt) or the site index [llms.txt](/llms.txt). Full docs corpus: [llms-full-docs.txt](/llms-full-docs.txt). Prefer markdown URLs (append `.md`) for agent consumption. Product skill: [skill.md](/skill.md).


Outbound KumoMTA engine that accepts mail from [mail](/docs/setup/backend/mail) and delivers via SMTP (Mailpit locally).

<Tip>
Run [`bun setup`](/docs/setup) or `bun docker:up` from the monorepo root. SMTP needs free ports `465` / `587`.
</Tip>


## Overview

| Property | Value |
| :--- | :--- |
| **Directory** | `apps/backend/smtp` |
| **Docker service** | `smtp` (container `reloop-smtp`) |
| **SMTP ports** | `465`, `587`, `2025`, `2465`, `2587` |
| **HTTP port** | `8020` |
| **Stack** | KumoMTA · Lua |


## Quick start

```bash
bun docker:up
```

View captured mail at `http://localhost:8025` (Mailpit).


## Configuration

Key variables in `local/docker-compose.yml`:

| Variable | Default |
| :--- | :--- |
| `BASE_URL` | `https://local.reloop.sh` |
| `NATS_URL` | `reloop-nats:4222` |
| `SMTP_HOSTNAME` | `smtp.reloop.sh` |

### SMTP_HOSTNAME

The hostname senders connect to for submission. It is the relay's own EHLO
name, and the dashboard reads it to fill the **SMTP → Credentials** panel and
every code example on that page, so self-hosted users are shown their own
endpoint instead of Reloop's.

The installer defaults it to your Reloop domain and preserves it across
re-runs. Set it explicitly when submission runs on a different host:

```bash
SMTP_HOSTNAME=mail.example.com
```

It is read at request time, so both services pick up a change on restart:

```bash
reloop restart smtp dashboard
```

Leave it unset and the dashboard falls back to `smtp.reloop.sh`, which is
correct for Reloop Cloud and wrong for every self-hosted install, so set it.


## Commands

| Command | Description |
| :--- | :--- |
| `bun docker:up` | Start full Docker stack (includes SMTP) |
| `docker compose -f local/docker-compose.yml up -d smtp` | Start SMTP only |
| `docker logs -f reloop-smtp` | Stream logs |
| `docker compose -f local/docker-compose.yml stop smtp` | Stop container |


## Architecture

| Layer | Detail |
| :--- | :--- |
| **Submission** | Accepts outbound mail on ports `465` / `587` / `2025` / `2465` / `2587` |
| **Policies** | Lua scripts in `apps/backend/smtp/policy/` handle routing and DKIM |
| **Local delivery** | Captured by Mailpit at `http://localhost:8025` |
| **Inbound** | Port `25` MX is handled by [inbound](/docs/setup/backend/inbound), not this service |


## Next

<CardGroup cols={2}>
  <Card icon="rocket" title="Setup" href="/setup">
    One-command local bootstrap
  </Card>
  <Card icon="globe" title="Port reference" href="/setup/port">
    Edge ports and conflicts
  </Card>
  <Card icon="mail-single" title="Mail" href="/setup/backend/mail">
    HTTP send API that hands off here
  </Card>
  <Card icon="mail-receive" title="Inbound" href="/setup/backend/inbound">
    MX receiver on port `25`
  </Card>
</CardGroup>
