Skip to content

Repository files navigation

autoMail Logo

autoMail

Automate your Mailbox
Email automation tool for moving emails between accounts

TypeScript React Express License


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.

Features

  • 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

Quick Start

Docker Compose (recommended)

From the repository root, build and start the application:

docker compose up --build -d

Visit 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.

Configuration

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)

Production

Update URLs to your domain:

environment:
  - BACKEND_URL=https://api.yourdomain.com
  - FRONTEND_URL=https://yourdomain.com

Microsoft OAuth Setup

  1. Go to Azure Portal
  2. Navigate to Azure Active Directory > App registrations
  3. Create a new registration
  4. Add redirect URI: {BACKEND_URL}/api/oauth/microsoft/callback
  5. Create a client secret
  6. Copy the Application (client) ID and secret to your .env

Tech Stack

Backend: Express 5, TypeScript, SQLite Frontend: React 19, Vite 7, Tailwind CSS 4 Infrastructure: Docker

Development

cd backend && npm run dev   # Start backend
cd frontend && npm run dev  # Start frontend

License

MIT

About

Self-hosted email automation tool for moving emails between accounts automatically. Supports IMAP and Microsoft OAuth with a simple web UI and Docker deployment.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages