Skip to content

martystephan/autoMail

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)

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: bridge

Create 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 -d

Visit http://localhost

Configuration

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)

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

Watchers

Forks

Packages

 
 
 

Contributors

Languages