# Codebase

> How the open-source repository is organized.

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

For agents: sypnia-mail repo: engine/ Rust workspace (api, smtp, render, queue, transport SES/SMTP trait, events, webhooks, inbound, mcp), migrations/, packages/mail (@sypnia/mail server/templates/react/cli), deploy/ (compose with Mailpit, AWS template), spec/openapi.yaml, docs/ARCHITECTURE.md; tests with Mailpit and recorded SES fake.

```text
sypnia-mail/
├─ engine/              Rust workspace
│  ├─ api/              HTTP API (axum)
│  ├─ smtp/             the SMTP relay
│  ├─ render/           templates: Handlebars-compatible rendering, MIME building, text from HTML
│  ├─ queue/            the queue, pacing per project, scheduling
│  ├─ transport/        SES and SMTP transports behind one trait
│  ├─ events/           SES event receiver, suppression rules
│  ├─ webhooks/         dispatcher and signatures
│  ├─ inbound/          parser and rules
│  └─ mcp/              the MCP server
├─ migrations/          sypnia_mail schema
├─ packages/mail/       @sypnia/mail (server, templates, react, cli)
├─ deploy/              docker compose with Mailpit, AWS template
├─ spec/openapi.yaml
└─ docs/ARCHITECTURE.md
```

Tests run against Mailpit for SMTP and a recorded SES fake for events, so they need no AWS account.
