# Configuration

> Every environment variable of the engine.

Applies to: the Sypnia engine (open source, self-hosted).  
Source: https://mail.docs.sypnia.com/self-hosting/configuration/

For agents: Mail engine env: DATABASE_URL, SYPNIA_MAIL_TRANSPORT (ses|smtp, default smtp), SMTP_URL, AWS_REGION + SES_CONFIGURATION_SET, EVENTS_QUEUE_URL, STORAGE_URL, RETENTION_DAYS (30), RELAY_PORTS (587; empty disables), TLS_CERT/TLS_KEY, JWKS_URL, TRACKING_HOST (tracking off without it).

| Variable                              | Default      | Meaning                                                          |
| ------------------------------------- | ------------ | ---------------------------------------------------------------- |
| `DATABASE_URL`                        | —            | Postgres for `sypnia_mail`                                       |
| `SYPNIA_MAIL_TRANSPORT`               | `smtp`       | `ses` or `smtp`                                                  |
| `SMTP_URL`                            | —            | the upstream SMTP server with the `smtp` transport               |
| `AWS_REGION`, `SES_CONFIGURATION_SET` | —            | with the `ses` transport                                         |
| `EVENTS_QUEUE_URL`                    | —            | the SQS queue of SES events                                      |
| `STORAGE_URL`                         | local folder | S3-compatible storage for bodies and attachments                 |
| `RETENTION_DAYS`                      | `30`         | how long bodies are kept                                         |
| `RELAY_PORTS`                         | `587`        | SMTP relay ports; empty turns the relay off                      |
| `TLS_CERT`, `TLS_KEY`                 | —            | certificate for the relay's STARTTLS and 465                     |
| `JWKS_URL`                            | —            | to accept JWTs from your issuer as well as keys                  |
| `TRACKING_HOST`                       | —            | the host for open and click tracking; without it tracking is off |
