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_URL—Public base URL of the Posta instance
POSTA_API_URL—Public 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_URL—Full connection string (overrides individual settings)

Redis​

VariableDefaultDescription
POSTA_REDIS_URL—Full connection string, e.g. redis://user:pass@host:6379/2. When set, it overrides POSTA_REDIS_ADDR, POSTA_REDIS_USERNAME, POSTA_REDIS_PASSWORD and POSTA_REDIS_DB.
POSTA_REDIS_ADDRlocalhost:6379Redis address (host:port)
POSTA_REDIS_USERNAME—Redis ACL username (Redis 6+)
POSTA_REDIS_PASSWORD—Redis password
POSTA_REDIS_DB0Redis database number to select

Security​

VariableDefaultDescription
POSTA_JWT_SECRET—Required. JWT signing key. Must be changed in production.
POSTA_ADMIN_EMAILadmin@example.comInitial admin account email
POSTA_ADMIN_PASSWORDadmin1234Initial admin account password
POSTA_CORS_ORIGINSorigins of POSTA_WEB_URL / POSTA_API_URLComma-separated allowed CORS origins. When unset, the origins of POSTA_WEB_URL and POSTA_API_URL are allowed; with neither set, only same-origin requests are served. * allows every origin (without credentials) and is reported as insecure.
POSTA_TRUSTED_PROXIES—Comma-separated CIDR blocks or IPs of the reverse proxies in front of Posta (e.g. 10.0.0.0/8,192.0.2.7). X-Forwarded-For and X-Real-IP are only honoured on connections from these peers. When empty, the headers are trusted from any client, so the IP used for rate limiting, API key IP allow-lists and audit logs can be spoofed. An invalid entry stops the server from starting.
POSTA_ENCRYPTION_KEY—AES-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
POSTA_WORKER_HEALTH_ENABLEDtrueServe /healthz, /readyz and /metrics from a dedicated worker
POSTA_WORKER_HEALTH_PORTPOSTA_PORTPort for those endpoints. Server and worker run as separate containers, so sharing the number is safe and means one health check for both

Webhooks​

VariableDefaultDescription
POSTA_WEBHOOK_MAX_RETRIES3Maximum webhook delivery retries
POSTA_WEBHOOK_TIMEOUT_SECS10Webhook HTTP request timeout (seconds)
POSTA_WEBHOOK_PROXY_URL—Optional 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_ID—Google OAuth client ID for SSO login
POSTA_GOOGLE_OAUTH_CLIENT_SECRET—Google OAuth client secret
POSTA_OAUTH_CALLBACK_URL—OAuth callback base URL (optional if POSTA_WEB_URL is set)

System SMTP​

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

On boot, Posta provisions these settings as a real SMTP server inside the built-in Posta System workspace, so they are visible and testable from the dashboard rather than only readable from the deployment's environment. See Workspaces.

The connection fields — host, port, username, password, encryption — are re-synced from the environment on every restart, so rotating a credential means changing it here and restarting. The server's label and status belong to the operator and survive a restart.

VariableDefaultDescription
POSTA_SYSTEM_SMTP_HOST—SMTP server host
POSTA_SYSTEM_SMTP_PORT587SMTP server port
POSTA_SYSTEM_SMTP_USERNAME—SMTP username
POSTA_SYSTEM_SMTP_PASSWORD—SMTP password
POSTA_SYSTEM_SMTP_FROM—From 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_PROVIDER—Storage backend: s3 or filesystem
POSTA_BLOB_S3_ENDPOINT—S3-compatible endpoint (e.g. MinIO, R2)
POSTA_BLOB_S3_REGIONus-east-1S3 region
POSTA_BLOB_S3_BUCKET—S3 bucket name
POSTA_BLOB_S3_ACCESS_KEY—S3 access key
POSTA_BLOB_S3_SECRET_KEY—S3 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_SECRET—Shared 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_FILE—PEM cert path (required when TLS mode is starttls)
POSTA_INBOUND_TLS_KEY_FILE—PEM 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

Web Form Messages​

VariableDefaultDescription
POSTA_MESSAGES_ENABLEDfalseMaster toggle — enables the public /api/v1/f/{key} ingest endpoint and the messages routes
POSTA_MESSAGES_MAX_BODY_BYTES65536Max submission body size in bytes (each form can lower it)
POSTA_MESSAGES_MAX_ATTACH_SIZE5242880Max per-attachment size in bytes (attachments are off per form by default)
POSTA_MESSAGES_IP_RATE_LIMIT20Per-IP submissions per window (0 disables — leaves a public endpoint unthrottled)
POSTA_MESSAGES_IP_RATE_WINDOW3600Rate-limit window in seconds
POSTA_MESSAGES_PER_FORM_HOURLY200Submissions allowed per form per hour
POSTA_MESSAGES_PER_EMAIL_HOURLY5Submissions allowed per sender address per hour, per form
POSTA_MESSAGES_PER_WORKSPACE_DAILY1000Submissions allowed per workspace per day
POSTA_MESSAGES_INBOUND_DOMAIN—Domain for msg+<token>@ reply addressing so email answers rejoin the thread (requires POSTA_INBOUND_ENABLED=true)

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
POSTA_TRUSTED_PROXIES=10.0.0.0/8

# 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