Skip to main content

Configuration

Posta is configured via environment variables. All variables are prefixed with POSTA_.

Server

VariableDefaultDescription
POSTA_PORT9000HTTP server port
POSTA_ENVdevEnvironment name
POSTA_DEV_MODEfalseDevelopment mode — stores emails without sending
POSTA_WEB_DIRweb/distPath to the dashboard frontend build
POSTA_WEB_URLPublic base URL of the Posta instance
POSTA_API_URLPublic API base URL advertised in the OpenAPI servers list (optional if POSTA_WEB_URL is set)

Database (PostgreSQL)

VariableDefaultDescription
POSTA_DB_HOSTlocalhostDatabase host
POSTA_DB_PORT5432Database port
POSTA_DB_USERpostaDatabase user
POSTA_DB_PASSWORDpostaDatabase password
POSTA_DB_NAMEpostaDatabase name
POSTA_DB_SSL_MODEdisableSSL mode (disable, require, verify-full)
POSTA_DB_URLFull connection string (overrides individual settings)

Redis

VariableDefaultDescription
POSTA_REDIS_ADDRlocalhost:6379Redis address
POSTA_REDIS_PASSWORDRedis password

Security

VariableDefaultDescription
POSTA_JWT_SECRETRequired. JWT signing key. Must be changed in production.
POSTA_ADMIN_EMAILadmin@example.comInitial admin account email
POSTA_ADMIN_PASSWORDadmin1234Initial admin account password
POSTA_CORS_ORIGINS*Comma-separated allowed CORS origins
POSTA_ENCRYPTION_KEYAES-256-GCM key used to encrypt stored SMTP passwords. Falls back to base64 encoding only when empty.
POSTA_EMAIL_VERIFICATION_REQUIREDfalseRequire new users to confirm their email address before they can sign in

Features

VariableDefaultDescription
POSTA_OPENAPI_DOCStrueEnable Swagger/ReDoc API documentation
POSTA_METRICS_ENABLEDfalseEnable Prometheus metrics endpoint
note

New-user registration is toggled at runtime from Admin → Settings (the registration_enabled setting), not via an environment variable.

Rate Limiting

VariableDefaultDescription
POSTA_AUTH_RATE_LIMIT_ENABLEDtrueEnable rate limiting on login/register endpoints
POSTA_RATE_LIMIT_HOURLY100Maximum emails per hour per user
POSTA_RATE_LIMIT_DAILY1000Maximum emails per day per user

Worker

VariableDefaultDescription
POSTA_EMBEDDED_WORKERfalseRun the worker within the API server process
POSTA_WORKER_CONCURRENCY10Number of worker goroutines
POSTA_WORKER_MAX_RETRIES5Maximum retry attempts per email

Webhooks

VariableDefaultDescription
POSTA_WEBHOOK_MAX_RETRIES3Maximum webhook delivery retries
POSTA_WEBHOOK_TIMEOUT_SECS10Webhook HTTP request timeout (seconds)
POSTA_WEBHOOK_PROXY_URLOptional HTTP/HTTPS/SOCKS5 proxy for outbound webhook delivery

Delivery

VariableDefaultDescription
POSTA_AUTO_SUPPRESS_ON_REJECTtrueAdd a recipient to the suppression list (and stop retrying) after a permanent 5xx rejection at RCPT TO, e.g. 550 user unknown

Email Verification

Controls the POST /api/v1/emails/verify endpoint (syntax, MX, disposable & role-account checks). Results are cached in Redis.

VariableDefaultDescription
POSTA_EMAIL_VERIFY_ENABLEDtrueEnable the email verification endpoint
POSTA_EMAIL_VERIFY_CACHE_TTL_HOURS168How long an address-level result is cached, in hours (default 7 days)
POSTA_EMAIL_VERIFY_MX_CACHE_TTL_HOURS24How long a domain's MX lookup is cached, in hours
POSTA_EMAIL_VERIFY_RATE_HOURLY1000Per-user hourly cap on verification requests (0 disables the limit)

OAuth / SSO

VariableDefaultDescription
POSTA_GOOGLE_OAUTH_CLIENT_IDGoogle OAuth client ID for SSO login
POSTA_GOOGLE_OAUTH_CLIENT_SECRETGoogle OAuth client secret
POSTA_OAUTH_CALLBACK_URLOAuth callback base URL (optional if POSTA_WEB_URL is set)

System SMTP

Outbound SMTP server used for platform notifications (daily reports, invitations, alerts). HOST and FROM must both be set for it to activate.

VariableDefaultDescription
POSTA_SYSTEM_SMTP_HOSTSMTP server host
POSTA_SYSTEM_SMTP_PORT587SMTP server port
POSTA_SYSTEM_SMTP_USERNAMESMTP username
POSTA_SYSTEM_SMTP_PASSWORDSMTP password
POSTA_SYSTEM_SMTP_FROMFrom address for platform notifications
POSTA_SYSTEM_SMTP_ENCRYPTIONstarttlsEncryption mode: none, ssl, or starttls

Blob Storage

Where email attachments are stored. Leave POSTA_BLOB_PROVIDER empty to disable external attachment storage.

VariableDefaultDescription
POSTA_BLOB_PROVIDERStorage backend: s3 or filesystem
POSTA_BLOB_S3_ENDPOINTS3-compatible endpoint (e.g. MinIO, R2)
POSTA_BLOB_S3_REGIONus-east-1S3 region
POSTA_BLOB_S3_BUCKETS3 bucket name
POSTA_BLOB_S3_ACCESS_KEYS3 access key
POSTA_BLOB_S3_SECRET_KEYS3 secret key
POSTA_BLOB_S3_USE_SSLtrueConnect to S3 over TLS
POSTA_BLOB_S3_PATH_STYLEfalseUse path-style addressing (required by some MinIO setups)
POSTA_BLOB_FS_PATHdata/attachmentsStorage path when using the filesystem provider

Inbound Email

VariableDefaultDescription
POSTA_INBOUND_ENABLEDfalseMaster toggle — enables the SMTP receiver and the /api/v1/inbound/* routes
POSTA_INBOUND_SMTP_HOST0.0.0.0Bind address for the built-in SMTP receiver
POSTA_INBOUND_SMTP_PORT2525SMTP listener port (use 25 publicly)
POSTA_INBOUND_HOSTNAMEposta.localHostname announced in EHLO / used as TLS SNI — should match the MX record
POSTA_INBOUND_MAX_MESSAGE_SIZE26214400Max raw message size in bytes (default 25 MiB)
POSTA_INBOUND_MAX_ATTACH_SIZE10485760Max per-attachment size in bytes (default 10 MiB)
POSTA_INBOUND_WEBHOOK_SECRETShared secret for the MX-provider webhook at POST /api/v1/inbound/webhook (sent via X-Posta-Inbound-Secret)
POSTA_INBOUND_TLS_MODEnoneSMTP TLS mode: none or starttls
POSTA_INBOUND_TLS_CERT_FILEPEM cert path (required when TLS mode is starttls)
POSTA_INBOUND_TLS_KEY_FILEPEM key path (required when TLS mode is starttls)
POSTA_INBOUND_SMTP_RATE_LIMIT60Per-IP max SMTP sessions per window (0 disables)
POSTA_INBOUND_SMTP_RATE_WINDOW60Rate-limit window in seconds

Advanced

VariableDefaultDescription
POSTA_ALLOW_DOWNGRADEfalseAllow the server to boot when the binary version is older than the version recorded in the database
POSTA_PLAN_ENFORCEMENTfalseEnforce hosted plan limits / quotas

Example .env File

# Server
POSTA_PORT=9000
POSTA_ENV=production

# Database
POSTA_DB_HOST=localhost
POSTA_DB_USER=posta
POSTA_DB_PASSWORD=secure-password
POSTA_DB_NAME=posta
POSTA_DB_PORT=5432

# Redis
POSTA_REDIS_ADDR=localhost:6379

# Security
POSTA_JWT_SECRET=your-very-long-random-secret-key
POSTA_ADMIN_EMAIL=admin@yourdomain.com
POSTA_ADMIN_PASSWORD=strong-admin-password
POSTA_CORS_ORIGINS=https://dashboard.yourdomain.com

# Features
POSTA_METRICS_ENABLED=true

# Rate Limiting
POSTA_AUTH_RATE_LIMIT_ENABLED=true
POSTA_RATE_LIMIT_HOURLY=500
POSTA_RATE_LIMIT_DAILY=5000

# Worker
POSTA_EMBEDDED_WORKER=true
POSTA_WORKER_CONCURRENCY=20