Configuration
Mailman uses Figment for layered configuration. Values are resolved in order (last wins):
- Compiled defaults — sensible defaults for local development
- TOML file —
config/default.toml(optional) - Environment variables — prefixed with
MAILMAN_, nested with__
Environment Variables
All config is set via MAILMAN_ prefixed environment variables. Nesting uses double underscore (__).
Required
| Variable | Default | Description |
|---|---|---|
MAILMAN_DATABASE__URL | postgres://localhost/mailman | PostgreSQL connection string |
HTTP
| Variable | Default | Description |
|---|---|---|
MAILMAN_HTTP__BIND_ADDR | 0.0.0.0:8080 | API server bind address |
Logging
| Variable | Default | Description |
|---|---|---|
MAILMAN_LOGGING__FORMAT | json | json, pretty, or compact |
RUST_LOG | info | tracing log level filter |
TIP
Use MAILMAN_LOGGING__FORMAT=pretty for local development — it gives you human-readable colored output instead of JSON.
AWS
| Variable | Default | Description |
|---|---|---|
MAILMAN_AWS__REGION | Auto-detect | AWS region (e.g., us-east-1) |
S3
| Variable | Default | Description |
|---|---|---|
MAILMAN_S3__RAW_EMAIL_BUCKET | mailman-raw | Bucket for raw MIME storage |
MAILMAN_S3__ATTACHMENTS_BUCKET | mailman-attachments | Bucket for attachment files |
SQS
| Variable | Default | Description |
|---|---|---|
MAILMAN_SQS__INBOUND_QUEUE_URL | (empty) | Inbound processing queue URL |
MAILMAN_SQS__OUTBOUND_QUEUE_URL | (empty) | Outbound delivery queue URL |
MAILMAN_SQS__TELEMETRY_QUEUE_URL | (empty) | SES event notification queue URL |
Redis
| Variable | Default | Description |
|---|---|---|
MAILMAN_REDIS__URL | (none) | Redis URL for volume rate limiting. If unset, volume limiting is disabled. |
ClamAV
| Variable | Default | Description |
|---|---|---|
MAILMAN_SCAN__CLAMAV_HOST | (none) | ClamAV daemon hostname. If unset, scanning is skipped (noop). |
MAILMAN_SCAN__CLAMAV_PORT | (none) | ClamAV daemon port (typically 3310) |
Config Struct
The full config structure is defined in crates/config/src/lib.rs:
rust
pub struct AppConfig {
pub logging: LoggingConfig, // format
pub http: HttpConfig, // bind_addr
pub aws: AwsConfig, // region
pub database: DatabaseConfig,// url
pub redis: RedisConfig, // url
pub s3: S3Config, // raw_email_bucket, attachments_bucket
pub sqs: SqsConfig, // inbound/outbound/telemetry queue URLs
pub scan: ScanConfig, // clamav_host, clamav_port
}Minimal Local .env
For local API development, you only need:
bash
DATABASE_URL=postgres://postgres:mailman@localhost:5433/mailman
MAILMAN_LOGGING__FORMAT=prettyThe worker needs SQS URLs to function. For local development without AWS, only run the API service.