Skip to main content

Your inbox, on autopilot.

Project description

mailagent

Your inbox, on autopilot.

License PyPI version Python versions Docker image

[!WARNING] 🚧 Under active development — expect rough edges, breaking changes, and bugs. Contributions and issue reports welcome!

LLM-powered email agent that watches Maildir inboxes, classifies mail, and executes workflows. Docker sidecar for docker-mailserver.

Features

  • Multi-inbox support with 5 LLM providers (OpenAI, Anthropic, Gemini, OpenRouter, Groq)
  • LLM classification with keyword fallback
  • 4 action types: reply, ignore, notify, webhook — composable
  • Smart SMTP replies with threading, sent folder sync, and message flagging
  • Env var interpolation, JSON Schema autocomplete, global + per-inbox config
  • inotify watching, catch-up on restart, debounce, idempotent state
  • CLI (run, validate, test, schema) with rich output
  • Thread awareness
  • Web dashboard for monitoring and config management
  • Calendar-aware scheduling actions
  • Plugin system for custom action types ... and more to come(based on feedback and bugs)

Quick start

Setting up a new mail server? Follow Path A in the setup guide.

Already running docker-mailserver? Follow Path B in the setup guide.

Here's a taste of what the stack looks like:

services:
  mailserver:
    image: ghcr.io/docker-mailserver/docker-mailserver:latest
    # ... your config

  mailagent:
    image: ghcr.io/vrag99/mailagent:latest
    env_file: ./mailagent.env
    volumes:
      - ./docker-data/dms/mail-data/:/var/mail/:ro
      - ./mailagent.yml:/app/config.yml:ro
      - ./mailagent-data/:/app/data/
    depends_on:
      mailserver:
        condition: service_healthy
    restart: unless-stopped
  1. Create mailagent.yml from the starter template
  2. Create mailagent.env with your API keys and secrets
  3. docker compose up -d

CLI

uv pip install docker-mailagent
Usage: mailagent <command> [options]

Commands:
  run         Start the mail agent daemon (default)
  validate    Validate the config file and exit
  test        Dry-run a .eml file through the pipeline
  schema      Print the JSON Schema to stdout

Options:
  -c, --config PATH    Config file path (default: /app/config.yml)
  -v, --verbose        Enable debug logging
mailagent validate -c ./mailagent.yml
mailagent test ./some-email.eml -c ./mailagent.yml
mailagent schema > schema.json

Schema autocomplete

Add to the top of your YAML file:

# yaml-language-server: $schema=https://raw.githubusercontent.com/vrag99/mailagent/main/schema.json

VS Code mapping:

{
  "yaml.schemas": {
    "https://raw.githubusercontent.com/vrag99/mailagent/main/schema.json": "mailagent.yml"
  }
}

Configuration

mailagent is configured via a single mailagent.yml file with four top-level sections: providers, defaults, inboxes, and settings. Workflows are inbox-local and evaluated in order (first match wins).

See the full configuration reference and examples.

Development

uv sync --dev
uv run pytest -q
docker build -t mailagent/mailagent:local .

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docker_mailagent-0.1.2.tar.gz (100.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docker_mailagent-0.1.2-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file docker_mailagent-0.1.2.tar.gz.

File metadata

  • Download URL: docker_mailagent-0.1.2.tar.gz
  • Upload date:
  • Size: 100.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for docker_mailagent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 40e74c70c8a79ed11db8b896c71e50003a1034ded03319f681dda2978ab4524f
MD5 eb621258a8daf607075f960de148f981
BLAKE2b-256 89e166fe6710b9701a0df12b42bba4984cd8d6ed1c78743914d2906f689a900a

See more details on using hashes here.

Provenance

The following attestation bundles were made for docker_mailagent-0.1.2.tar.gz:

Publisher: publish.yml on vrag99/mailagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file docker_mailagent-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for docker_mailagent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3ce9b295290b88b40a921ab4009c8f513e1d69655823cb6c603f1e2db765b948
MD5 631b24d3c7c7380e0e1dd56ef57d749a
BLAKE2b-256 78949e4e04e111b62bdb5a051776ff10de550278a4e0a39f2dc230d90f302598

See more details on using hashes here.

Provenance

The following attestation bundles were made for docker_mailagent-0.1.2-py3-none-any.whl:

Publisher: publish.yml on vrag99/mailagent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page