Your inbox, on autopilot.
Project description
mailagent
Your inbox, on autopilot.
[!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
- REST API for inbox/provider/workflow CRUD and sending emails
- 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 # writable — daemon hot-reloads on API changes
- ./mailagent-data/:/app/data/
depends_on:
mailserver:
condition: service_healthy
restart: unless-stopped
mailagent-api:
image: ghcr.io/vrag99/mailagent:latest
command: mailagent serve -c /app/config.yml
env_file: ./mailagent.env
ports:
- "8000:8000"
volumes:
- ./mailagent.yml:/app/config.yml
- ./mailagent-data/:/app/data/
- ./docker-data/dms/config/:/etc/dms/config/ # for mailbox provisioning
depends_on:
mailserver:
condition: service_healthy
restart: unless-stopped
- Create
mailagent.ymlfrom the starter template - Create
mailagent.envwith your API keys and secrets 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
serve Start the REST API server
api-key Manage API keys (create, list, revoke)
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
# Start the REST API server
mailagent serve -c ./mailagent.yml --port 8000
# Manage API keys
mailagent api-key create --name myapp # prints key once — save it
mailagent api-key list # shows name + hash prefix
mailagent api-key revoke <hash_prefix> # use hash prefix from list
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docker_mailagent-0.1.3.tar.gz.
File metadata
- Download URL: docker_mailagent-0.1.3.tar.gz
- Upload date:
- Size: 146.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee9172bbcd96434414f5fdcfa9b9790bf7cb1b6298ec0a8f6b2db0d776a9707f
|
|
| MD5 |
be9d1871a7e6b68d9fd5908748560bad
|
|
| BLAKE2b-256 |
07f51abf11d36d8357066116808fb0990c805d8325e347b5074f9c9d287a2545
|
Provenance
The following attestation bundles were made for docker_mailagent-0.1.3.tar.gz:
Publisher:
publish.yml on vrag99/mailagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docker_mailagent-0.1.3.tar.gz -
Subject digest:
ee9172bbcd96434414f5fdcfa9b9790bf7cb1b6298ec0a8f6b2db0d776a9707f - Sigstore transparency entry: 1191294162
- Sigstore integration time:
-
Permalink:
vrag99/mailagent@2ee18ebdc370c28cc8c41ece4cd7a0bf9c496950 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/vrag99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ee18ebdc370c28cc8c41ece4cd7a0bf9c496950 -
Trigger Event:
push
-
Statement type:
File details
Details for the file docker_mailagent-0.1.3-py3-none-any.whl.
File metadata
- Download URL: docker_mailagent-0.1.3-py3-none-any.whl
- Upload date:
- Size: 57.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b552111d991590f11e7a50a40afeaeff1c0fb521573291d93234d5291a184db8
|
|
| MD5 |
9ccd6f9dbb51f7678258d11ff11ac4b9
|
|
| BLAKE2b-256 |
6ec1511835dd2aa7982dac4ec44c0478cb207a02cf9bce7394d396e400b09a0b
|
Provenance
The following attestation bundles were made for docker_mailagent-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on vrag99/mailagent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docker_mailagent-0.1.3-py3-none-any.whl -
Subject digest:
b552111d991590f11e7a50a40afeaeff1c0fb521573291d93234d5291a184db8 - Sigstore transparency entry: 1191294165
- Sigstore integration time:
-
Permalink:
vrag99/mailagent@2ee18ebdc370c28cc8c41ece4cd7a0bf9c496950 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/vrag99
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2ee18ebdc370c28cc8c41ece4cd7a0bf9c496950 -
Trigger Event:
push
-
Statement type: