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
Create a docker-compose.yml:
services:
backend:
image: ghcr.io/sleepzhh/automail/backend:latest
environment:
- NODE_ENV=production
- PORT=4000
- BACKEND_URL=http://localhost:4000
- FRONTEND_URL=http://localhost
- MICROSOFT_CLIENT_ID=${MICROSOFT_CLIENT_ID}
- MICROSOFT_CLIENT_SECRET=${MICROSOFT_CLIENT_SECRET}
- JWT_SECRET=${JWT_SECRET}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
volumes:
- automail-data:/app/data
networks:
- automail-network
restart: unless-stopped
frontend:
image: ghcr.io/sleepzhh/automail/frontend:latest
ports:
- "80:80"
environment:
- BACKEND_URL=http://backend:4000
depends_on:
- backend
networks:
- automail-network
restart: unless-stopped
volumes:
automail-data:
networks:
automail-network:
driver: bridgeCreate a .env file:
MICROSOFT_CLIENT_ID=your-client-id
MICROSOFT_CLIENT_SECRET=your-client-secret
JWT_SECRET=$(openssl rand -hex 32)
ENCRYPTION_KEY=$(openssl rand -hex 32)Start the application:
docker compose up -dVisit http://localhost
| Variable | Description |
|---|---|
MICROSOFT_CLIENT_ID |
Azure OAuth client ID |
MICROSOFT_CLIENT_SECRET |
Azure OAuth client secret |
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