Environment Variables
MailPort is configured entirely through environment variables. On Vercel, go to Settings → Environment Variables; for local development, copy .env.example to .env.
Required
Without these, login returns 503 and writes fail.
Database (configure one group)
MailPort auto-detects the driver in this fixed order: PostgreSQL → MongoDB → MySQL → SQLite. Configure exactly one group.
PostgreSQL
Works with Supabase, Neon, Tembo, or self-hosted.
Aliases also accepted: POSTGRES_DATABASE, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORT, POSTGRES_SSL.
MongoDB
Works with MongoDB Atlas or self-hosted MongoDB.
A full MONGODB_URI connection string is also accepted and takes precedence over the variables above.
MySQL / TiDB
Works with self-hosted MySQL, PlanetScale, FreeDB. TiDB is wire-compatible — use the MySQL variables.
TiDB aliases also accepted: TIDB_DB, TIDB_USER, TIDB_PASSWORD, TIDB_HOST, TIDB_PORT, TIDB_SSL.
SQLite
Local development and VPS only. Not usable on Vercel Serverless (read-only filesystem).
Optional
Timezone (TZ)
In the current version, send logs and key usage times are formatted in the browser and follow each visitor's system timezone — the server-side TZ variable does not affect the UI. It is reserved for future server-side time formatting.
If you do set it, note that POSIX timezone signs are inverted:
UI language
Set SITE_LOCALE to choose the dashboard's default language:
An invalid or missing value falls back to English.
Users can also switch language from the dropdown in the top-right corner of the dashboard. The choice is stored in a cookie that overrides the environment default for one year. To add another language, see the notes in src/i18n/.
Detection order
If none is set, /api/health reports status: "degraded" and all writes return 503.
Rotating MAILPORT_SECRET
Changing it makes previously encrypted SMTP passwords and API keys undecryptable. To rotate:
- Change
MAILPORT_SECRET. - Re-enter each sender's SMTP password in the dashboard.
- Delete old API keys and generate new ones; update callers.
Post-deploy check
GET /api/health:
driver: null or status: "degraded" means no database was detected.