Automate your Mailbox
Email automation tool for moving emails between accounts
autoMail connects your IMAP and Microsoft mail accounts, letting you create automation flows that move emails between mailboxes on a schedule. Self-hosted, simple web UI, your data stays on your machine.
- Multi-account support — IMAP (password-based) and Microsoft OAuth
- Automation flows — Source mailbox to target mailbox routing
- Scheduled triggers — Interval-based execution
- Self-hosted — Your data stays on your machine
- Simple UI — Clean web interface for configuration
From the repository root, build and start the application:
docker compose up --build -dVisit http://localhost
On the first start, the backend generates the Prisma client during the image
build and applies all database migrations before serving requests. The SQLite
database is retained in the sqlite-data Docker volume.
No .env file is required for local-only use. The Compose file contains stable
development secrets so encrypted account credentials and login sessions survive
container restarts. Before exposing AutoMail outside your machine, create a
.env file and set unique BETTER_AUTH_SECRET, JWT_SECRET, and
ENCRYPTION_KEY values generated with openssl rand -hex 32.
Note: this setup initializes a new v0.3 database. Upgrading an existing v0.2 Docker volume is not supported yet.
| Variable | Description |
|---|---|
MICROSOFT_CLIENT_ID |
Azure OAuth client ID |
MICROSOFT_CLIENT_SECRET |
Azure OAuth client secret |
BETTER_AUTH_SECRET |
Secret used to sign Better Auth cookies and sessions |
BETTER_AUTH_URL |
Public application URL used by Better Auth |
JWT_SECRET |
32-byte hex key for JWT tokens |
ENCRYPTION_KEY |
32-byte hex key for token encryption |
BACKEND_URL |
Public URL of backend (for OAuth callbacks) |
FRONTEND_URL |
Public URL of frontend (for redirects) |
Update URLs to your domain:
environment:
- BACKEND_URL=https://api.yourdomain.com
- FRONTEND_URL=https://yourdomain.com- Go to Azure Portal
- Navigate to Azure Active Directory > App registrations
- Create a new registration
- Add redirect URI:
{BACKEND_URL}/api/oauth/microsoft/callback - Create a client secret
- Copy the Application (client) ID and secret to your
.env
Backend: Express 5, TypeScript, SQLite Frontend: React 19, Vite 7, Tailwind CSS 4 Infrastructure: Docker
cd backend && npm run dev # Start backend
cd frontend && npm run dev # Start frontendMIT