Skip to content

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:

VariableRequiredDescription
ENVYeslocal or production
BASE_URLYesYour app URL, e.g. https://mailfellow.example.com
PORTYesServer port, e.g. :8080
SESSION_SECRET_KEYYesRandom string for session encryption
DATABASE_URLYesPostgreSQL connection string, e.g. postgres://user:pass@localhost:5432/mailfellow?sslmode=disable
ENCRYPTION_KEYNoKey for encrypting sensitive data (API keys, tokens). Auto-generated if not set.
MAIL_HOSTNoSMTP host for system emails
MAIL_PORTNoSMTP port (usually 587)
MAIL_USERNAMENoSMTP username
MAIL_PASSWORDNoSMTP 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.