Configuration
This page is for self-hosted deployments. If you're using the hosted version, you don't need any of this.
Environment variables
Set these in your .env file:
| Variable | Required | Description |
|---|---|---|
ENV | Yes | local or production |
BASE_URL | Yes | Your app URL, e.g. https://mailfellow.example.com |
PORT | Yes | Server port, e.g. :8080 |
SESSION_SECRET_KEY | Yes | Random string for session encryption |
DATABASE_URL | Yes | PostgreSQL connection string, e.g. postgres://user:pass@localhost:5432/mailfellow?sslmode=disable |
ENCRYPTION_KEY | No | Key for encrypting sensitive data (API keys, tokens). Auto-generated if not set. |
MAIL_HOST | No | SMTP host for system emails |
MAIL_PORT | No | SMTP port (usually 587) |
MAIL_USERNAME | No | SMTP username |
MAIL_PASSWORD | No | SMTP password |
Setup wizard
On first launch, MailFellow opens a setup wizard where you configure:
- Discord or Slack: your bot token
- Gmail: Google OAuth Client ID, Secret, and Redirect URL
- Outlook: Microsoft OAuth Client ID, Secret, and Redirect URL
These are saved in the database and can be changed later from the admin panel (/admin).
Polling interval
MailFellow checks for new emails periodically:
ENV=local: every 15 seconds (for development)ENV=production: every 3 minutes
Database
MailFellow uses PostgreSQL. The database schema is created automatically on first startup. On subsequent startups, any new columns or tables are added via ALTER TABLE ... ADD COLUMN IF NOT EXISTS migrations. No manual migration steps are needed.
Attachment storage
Email attachments are stored on disk. In Docker, this is the mailfellow-attachments volume mounted at /app/data/attachments. Make sure this volume is persistent across container restarts.