Skip to content

armgit / posta

Public Imported from GitHub
0

Self-hosted email delivery platform that enables applications to send emails via HTTP APIs while handling SMTP delivery, templates, storage, security, and analytics. Fully self-hostable alternative to services like SendGrid or Mailgun.

9.8 KB
Raw Blame
# Server
# HTTP server port
POSTA_PORT=9000
# Environment (dev, production)
# With POSTA_ENV=production the server refuses to start on a missing, placeholder,
# or too-short POSTA_JWT_SECRET, and refuses to seed the first admin account with
# a placeholder POSTA_ADMIN_PASSWORD. Use dev for a local quick start.
POSTA_ENV=production

# Database (PostgreSQL)
POSTA_DB_HOST=localhost
POSTA_DB_USER=posta
POSTA_DB_PASSWORD=posta
POSTA_DB_NAME=posta
POSTA_DB_PORT=5432
POSTA_DB_SSL_MODE=disable
# PostgreSQL connection string (overrides individual DB settings)
POSTA_DB_URL=

# Redis
# URL overrides the settings below
POSTA_REDIS_URL=
POSTA_REDIS_ADDR=localhost:6379
POSTA_REDIS_USERNAME=
POSTA_REDIS_PASSWORD=
POSTA_REDIS_DB=0

# JWT signing secret — REQUIRED in production, 32+ characters recommended.
# Signs dashboard sessions, tracking links, and the email stamper: anyone who
# knows it can forge a session. Production refuses to start if this is empty or
# left at the placeholder below, and warns if it is shorter than 32 characters.
# Generate one with: openssl rand -hex 32
POSTA_JWT_SECRET=change-me-in-production

# Store emails without sending (useful for development)
POSTA_DEV_MODE=false
# Enable auth (login/register) rate limiting
POSTA_AUTH_RATE_LIMIT_ENABLED=true
# Hourly email limit per user
POSTA_RATE_LIMIT_HOURLY=100
# Daily email limit per user
POSTA_RATE_LIMIT_DAILY=1000

# Default admin credentials, used only to create the first account on an empty
# database. In production the password must be at least 12 characters and not a
# known placeholder, or the initial seed is refused.
[email protected]
POSTA_ADMIN_PASSWORD=admin1234

# Enable Swagger UI and ReDoc
POSTA_OPENAPI_DOCS=true

# Enable Prometheus metrics
POSTA_METRICS_ENABLED=false

# Daily check for a newer Posta release, shown as a banner to platform admins.
# Reads the public GitHub release list and sends nothing about this install;
# it never upgrades anything. Set to false for air-gapped deployments.
POSTA_UPDATE_CHECK=true

# Vue build directory (uncomment for development)
# POSTA_WEB_DIR=web/dist
# Public URL of the dashboard / instance
POSTA_WEB_URL=https://posta.example.com
# Public API base URL (advertised in the OpenAPI "servers" list; optional if POSTA_WEB_URL is set)
# POSTA_API_URL=https://posta.example.com

# Comma-separated allowed CORS origins. Defaults to the origins of POSTA_WEB_URL
# and POSTA_API_URL; only needed when the dashboard or API is called from elsewhere.
# POSTA_CORS_ORIGINS=https://dashboard.example.com

# Comma-separated CIDRs/IPs of reverse proxies allowed to set X-Forwarded-For
# and X-Real-IP. Leave empty only when Posta is not behind a proxy you control:
# otherwise clients can spoof the IP used for rate limits and API key allow-lists.
# POSTA_TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12

# Worker
# Run worker in server process
POSTA_EMBEDDED_WORKER=true
# Worker concurrency
POSTA_WORKER_CONCURRENCY=10
# Email retry attempts
POSTA_WORKER_MAX_RETRIES=5

# Health, readiness and Prometheus endpoints for a dedicated worker.
# Defaults to POSTA_PORT: the server and the worker run as separate containers,
# so one port covers both and one health check command works for either.
POSTA_WORKER_HEALTH_ENABLED=true
POSTA_WORKER_HEALTH_PORT=9000

# Webhook delivery retry attempts
POSTA_WEBHOOK_MAX_RETRIES=3
# Webhook request timeout in seconds
POSTA_WEBHOOK_TIMEOUT_SECS=10
# Webhook HTTP proxy URL (optional)
# POSTA_WEBHOOK_PROXY_URL=
# Let webhooks reach private addresses (loopback, 10/8, 192.168/16, ...). Off by default.
# POSTA_WEBHOOK_ALLOW_PRIVATE_NETWORKS=false
# Private networks webhooks may still reach, comma-separated (e.g. 10.0.5.0/24)
# POSTA_WEBHOOK_ALLOWED_NETWORKS=
# Let workspace SMTP servers reach private addresses. On by default.
# POSTA_SMTP_ALLOW_PRIVATE_NETWORKS=true

# Google OAuth client ID for SSO login
# POSTA_GOOGLE_OAUTH_CLIENT_ID=your-client-id
# Google OAuth client secret for SSO login
# POSTA_GOOGLE_OAUTH_CLIENT_SECRET=your-secret
# OAuth callback base URL (optional if POSTA_WEB_URL is defined)
POSTA_OAUTH_CALLBACK_URL=https://posta.example.com

# Blob storage (s3 or filesystem)
# POSTA_BLOB_PROVIDER=
# S3-compatible storage settings
# POSTA_BLOB_S3_ENDPOINT=
# POSTA_BLOB_S3_REGION=us-east-1
# POSTA_BLOB_S3_BUCKET=
# POSTA_BLOB_S3_ACCESS_KEY=
# POSTA_BLOB_S3_SECRET_KEY=
# POSTA_BLOB_S3_USE_SSL=true
# POSTA_BLOB_S3_PATH_STYLE=false
# Filesystem storage path
# POSTA_BLOB_FS_PATH=/data/attachments

# Encryption key for SMTP server passwords (AES-256-GCM)
# If empty, passwords are stored with base64 encoding only
# POSTA_ENCRYPTION_KEY=

# Posta Enterprise license, installed at startup when none is installed yet
# (Admin -> License takes precedence). The token itself, or a file holding it.
# POSTA_LICENSE=
# POSTA_LICENSE_FILE=

# System SMTP server used for platform notifications (daily reports, invitations,
# password resets, security alerts).
#
# On boot these are provisioned as a real SMTP server inside the "Posta System"
# workspace, so the settings are visible and testable from the dashboard. The
# connection fields below are re-synced on every restart — rotating a password
# here and restarting is enough — while the server's label and status stay as
# the operator left them.
#
# Required: Host and From must be set for SMTP to be active
POSTA_SYSTEM_SMTP_HOST=smtp.example.com
POSTA_SYSTEM_SMTP_PORT=587
[email protected]
POSTA_SYSTEM_SMTP_PASSWORD=secret
[email protected]
# Encryption mode: none, ssl, starttls
POSTA_SYSTEM_SMTP_ENCRYPTION=starttls

# Inbound email processing
# Master toggle — enables the SMTP receiver and the /api/v1/inbound/* routes
POSTA_INBOUND_ENABLED=false
# Bind address for the built-in SMTP receiver
POSTA_INBOUND_SMTP_HOST=0.0.0.0
# SMTP listener port (use 25 publicly)
POSTA_INBOUND_SMTP_PORT=2525
# Hostname announced in EHLO / used as TLS SNI — should match the MX record
POSTA_INBOUND_HOSTNAME=posta.example.com
# Max raw message size in bytes (default 25 MiB)
POSTA_INBOUND_MAX_MESSAGE_SIZE=26214400
# Max per-attachment size in bytes (default 10 MiB)
POSTA_INBOUND_MAX_ATTACH_SIZE=10485760
# Shared secret for the generic MX-provider webhook at POST /api/v1/inbound/webhook
# Clients must send it via the X-Posta-Inbound-Secret header
# POSTA_INBOUND_WEBHOOK_SECRET=
# SMTP TLS mode: none | starttls
POSTA_INBOUND_TLS_MODE=none
# PEM cert/key paths (required when POSTA_INBOUND_TLS_MODE=starttls)
# POSTA_INBOUND_TLS_CERT_FILE=/etc/posta/tls/fullchain.pem
# POSTA_INBOUND_TLS_KEY_FILE=/etc/posta/tls/privkey.pem
# Per-IP SMTP rate limit: max sessions per window (0 disables)
POSTA_INBOUND_SMTP_RATE_LIMIT=60
# Rate-limit window in seconds
POSTA_INBOUND_SMTP_RATE_WINDOW=60

# Web form messages — receive submissions from a website form, then reply from the dashboard
# Master toggle — enables the public /api/v1/f/{key} ingest endpoint and the messages routes
POSTA_MESSAGES_ENABLED=false
# Max submission body size in bytes (per-form override available in the dashboard)
POSTA_MESSAGES_MAX_BODY_BYTES=65536
# Max size of a single uploaded attachment in bytes (attachments are off per form by default)
POSTA_MESSAGES_MAX_ATTACH_SIZE=5242880
# Per-IP submissions allowed per window (0 disables — leaves a public endpoint open to flooding)
POSTA_MESSAGES_IP_RATE_LIMIT=20
# Rate-limit window in seconds
POSTA_MESSAGES_IP_RATE_WINDOW=3600
# Per-form submissions allowed per hour
POSTA_MESSAGES_PER_FORM_HOURLY=200
# Per-sender-address submissions allowed per hour, per form
POSTA_MESSAGES_PER_EMAIL_HOURLY=5
# Per-workspace submissions allowed per day
POSTA_MESSAGES_PER_WORKSPACE_DAILY=1000
# Domain used for msg+<token>@ reply addressing so email answers rejoin the thread.
# Requires POSTA_INBOUND_ENABLED=true. Leave blank for one-directional replies.
POSTA_MESSAGES_INBOUND_DOMAIN=

# SMTP Relay — lets a workspace issue SMTP credentials for migrating existing senders
# Master toggle — enables the SMTP relay listener and the /workspaces/current/smtp-credentials routes
POSTA_SMTP_RELAY_ENABLED=false
# Bind address for the built-in SMTP relay listener (keep private even with STARTTLS)
POSTA_SMTP_RELAY_HOST=0.0.0.0
# SMTP relay listener port (separate from POSTA_INBOUND_SMTP_PORT)
POSTA_SMTP_RELAY_PORT=2526
# Hostname announced in EHLO
POSTA_SMTP_RELAY_HOSTNAME=posta.example.com
# Use starttls to require TLS before AUTH; none preserves the private-network legacy mode.
POSTA_SMTP_RELAY_TLS_MODE=none
# Required when POSTA_SMTP_RELAY_TLS_MODE=starttls; certificate must match the client-facing hostname.
POSTA_SMTP_RELAY_TLS_CERT_FILE=
POSTA_SMTP_RELAY_TLS_KEY_FILE=
# Max raw message size in bytes (default 25 MiB)
POSTA_SMTP_RELAY_MAX_MESSAGE_SIZE=26214400
# Per-IP SMTP rate limit: max sessions per window (0 disables)
POSTA_SMTP_RELAY_RATE_LIMIT=60
# Rate-limit window in seconds
POSTA_SMTP_RELAY_RATE_WINDOW=60

# Require new users to verify their email address before they can sign in.
# When true, signup sends a verification link and login is blocked until confirmed.
POSTA_EMAIL_VERIFICATION_REQUIRED=false
# Adds a recipient to the suppression list when an
# outbound send is permanently rejected (5xx at RCPT TO, e.g. 550 user
# unknown), and stops retrying that message.
POSTA_AUTO_SUPPRESS_ON_REJECT=true

# Email verification endpoint
POSTA_EMAIL_VERIFY_ENABLED=true
# How long an address-level result is cached, in hours (default 7 days)
POSTA_EMAIL_VERIFY_CACHE_TTL_HOURS=168
# How long a domain's MX lookup is cached, in hours
POSTA_EMAIL_VERIFY_MX_CACHE_TTL_HOURS=24
# Per-user hourly cap on verification requests (0 disables the limit)
POSTA_EMAIL_VERIFY_RATE_HOURLY=1000

# Advanced
# Allow the server to boot when the binary version is older than the version
# recorded in the database (normally refused to prevent schema mismatches)
POSTA_ALLOW_DOWNGRADE=false
# Enforce hosted plan limits / quotas. Off by default.
POSTA_PLAN_ENFORCEMENT=false