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.

4.7 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
POSTA_WEB_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

# 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=

# System SMTP server used for platform notifications (daily reports, invitations, etc.)
# 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
POSTA_AUTO_SUPPRESS_ON_REJECT=true

# Email verification endpoint
POSTA_EMAIL_VERIFY_ENABLED=true
POSTA_EMAIL_VERIFY_CACHE_TTL_HOURS=168
POSTA_EMAIL_VERIFY_MX_CACHE_TTL_HOURS=24
POSTA_EMAIL_VERIFY_RATE_HOURLY=1000