boxgent is a mail-filter, with a web-interface. It works over imap. boxgent is ment for non programers, that don't handle the complexety of tools like sieve, or tools like imapfilter.
  • Python 52.7%
  • JavaScript 47.1%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-04 14:10:38 +00:00
.forgejo/workflows ci: production image also gets the rolling X.Y.Z tag 2026-11-04 14:35:21 +01:00
app fix(ci): strip AI_LIVE_* values; close SQLite engines in db tests 2026-11-04 13:12:28 +01:00
docker feat(security): run the app as an unprivileged user, add a healthcheck (#49) 2026-10-06 14:24:53 +02:00
docs docs: architecture overview and v0.5 upgrade notes (#558) 2026-10-30 08:50:19 +01:00
scripts ci: skip re-testing an already tested tree, run tests in parallel 2026-11-04 13:26:53 +01:00
tests ci: skip re-testing an already tested tree, run tests in parallel 2026-11-04 13:26:53 +01:00
.dockerignore feat: add Dockerfile and docker-compose for single-container deployment 2026-06-17 14:42:22 +02:00
.gitattributes Update .gitattributes 2026-06-30 11:09:12 +02:00
.gitignore ci: skip re-testing an already tested tree, run tests in parallel 2026-11-04 13:26:53 +01:00
.python-version chore: require Python 3.14 2026-09-29 14:30:53 +02:00
CHANGELOG.md docs: CHANGELOG v0.5.1 mentions the rolling image tag (#86) 2026-11-04 14:35:38 +01:00
docker-compose.yml chore(config): remove the unused DEBUG setting (#238) 2026-10-09 14:50:00 +02:00
docker-stack-dev.yml deploy: generic docker-stack.yml template, dev stack in docker-stack-dev.yml (#503) 2026-10-22 18:12:25 +02:00
docker-stack.yml deploy: generic docker-stack.yml template, dev stack in docker-stack-dev.yml (#503) 2026-10-22 18:12:25 +02:00
Dockerfile feat(security): run the app as an unprivileged user, add a healthcheck (#49) 2026-10-06 14:24:53 +02:00
LICENSE feat: add AGPL-3.0 license, copyright headers, and gorgeIT branding 2026-06-23 10:32:09 +02:00
pyproject.toml ci: skip re-testing an already tested tree, run tests in parallel 2026-11-04 13:26:53 +01:00
README.md docs: README describes the AI features, API/MCP and today's rule editor (#566) 2026-10-30 16:05:39 +01:00
uv.lock ci: skip re-testing an already tested tree, run tests in parallel 2026-11-04 13:26:53 +01:00

Boxgent

Boxgent is a self-hosted web UI for managing IMAP email filter rules. Rules are defined in a browser and executed by a built-in Python IMAP engine that runs on new mail (IMAP IDLE) or on a schedule — no external filter daemon, no Lua scripting, no mail server changes required. Optionally, an AI of your choice (any OpenAI-compatible server, e.g. a local Ollama) can sort, categorize, summarize and draft replies — only for the accounts you allow it to read.

Built by gorgeIT · AGPL-3.0

Alpha. Until the first release candidate of 1.0 (v1.0_rc1), Boxgent is alpha software. The REST API, MCP, rule exports and settings backups are only guaranteed to work within one version and its bug-fix releases (v0.3.0, v0.3.1, … — not from v0.3 to v0.4). The database is always upgraded to a newer version automatically, but never back: back up your database yourself before every upgrade. Every incompatible change is listed under Breaking changes in the changelog. See Installation → Upgrading.


Why Boxgent

Most self-hosted email filtering tools require either deep server access (Sieve), a full mail stack (Roundcube, Mail-in-a-Box), or hand-written config files (imapfilter, fdm). Boxgent connects to any existing IMAP server as a client and gives you a point-and-click rule editor with live match previews and per-rule execution statistics.

Comparison with similar tools

Boxgent imapfilter Roundcube + Sieve Thunderbird rules fdm / getmail
Web UI ✅ ❌ Lua config ✅ plugin ❌ desktop app ❌ config file
No server changes needed ✅ ✅ ❌ needs ManageSieve ✅ ✅
No mail server required ✅ ✅ ❌ part of Roundcube ✅ ✅
Multi-account ✅ ✅ ✅ ✅ ✅
Multi-user with roles ✅ ❌ ❌ ❌ ❌
Live match preview (dry run) ✅ ❌ ❌ ❌ ❌
IMAP IDLE (push triggers) ✅ ❌ server-side ❌ ❌
Per-rule match statistics ✅ ❌ ❌ ❌ ❌
AI conditions, categories, digests, reply drafts ✅ optional ❌ ❌ ❌ ❌
REST API and MCP (AI assistants) ✅ ❌ ❌ ❌ ❌
SSO / OIDC / proxy auth ✅ ❌ ❌ ❌ ❌
Single container deploy ✅ — ❌ — —
PostgreSQL / MySQL support ✅ optional — server DB — —

Features

Rules

  • Point-and-click rule editor — conditions on from, to, subject, headers, spam score, message age and account (contains, not contains, regex); conditions are combined with AND, with drag-and-drop AND / OR / NOT cards for anything more
  • Actions — move or copy (also into another of your accounts), delete, mark read/unread, star/unstar, add tags (IMAP keywords, Thunderbird labels); several actions per rule; Stop and End to end processing for a mail
  • Triggers — on new mail, on a schedule (every run, hourly, daily, weekly), in a date range or in an active time window on chosen weekdays, in your time zone
  • Live match preview — dry-run a rule and see which messages it would touch before committing
  • Duplicate, compress, import and export — merge neighbouring rules with the same actions into one; JSON export/import and a Sieve export

AI (optional, per account, off by default)

  • AI conditions — AI filter (your yes/no question) and Mail is important (your own definition), with a confidence threshold
  • AI categorize / AI yes/no — one AI question per mail, each answer runs its own actions
  • AI digest — collects matching mail and writes one summary mail per day or week into a folder; never sent
  • AI draft reply — writes a threaded reply into the Drafts folder; never sent
  • Rules from the AI — describe a rule in your own words, or let the AI suggest rules from your inbox's senders and subjects; you review before saving
  • Reads the new text of a mail (no quoted replies or signature) and PDF, Word and Excel attachments; works with any OpenAI-compatible server or SystemOne

Running and results

  • IMAP IDLE — new mail triggers filter runs immediately; polling fallback for servers that don't support IDLE
  • Per-rule match statistics with configurable time window, including how often each AI branch was taken
  • Smart account setup — IMAP settings autodiscovered from an email address (autoconfig XML, DNS SRV records, provider heuristics)

Users and operation

  • Multi-user with roles — admin, manager, and user roles; managers can view and edit team members' rules via the Team tab
  • Authentication — local accounts (bcrypt), login with the mail account (per mail domain), reverse-proxy header trust (Authentik, Authelia), OpenID Connect / OAuth 2.0, SSO-only mode
  • REST API and MCP — per-user API keys (read-only or without mail access); AI assistants such as Claude can list, preview and edit rules over MCP
  • English and German interface, light and dark theme
  • Settings backup and restore on the Admin page
  • Multi-DB — SQLite by default; connect to PostgreSQL or MySQL via DATABASE_URL; automatic one-time data migration from SQLite on first boot
  • Container deploy — Docker / Podman Compose, or a Docker Swarm stack with PostgreSQL (docker-stack.yml)

Quick start

# 1. Generate an encryption key
mkdir -p secrets
python3 -c "import base64, os; print(base64.urlsafe_b64encode(os.urandom(32)).decode())" \
  > secrets/encryption_key
chmod 600 secrets/encryption_key

# 2. Start
podman-compose up -d          # or: docker compose up -d

Open http://localhost:8080, log in as admin / boxgent, and change the password when prompted.

See docs/installation.md for full installation instructions.


Documentation

Installation Container setup, volumes, first boot, upgrading
Configuration All environment variables: database, authentication, API, AI
Usage Accounts, rules, conditions, actions, AI, teams, REST API and MCP
Architecture How the code is laid out: rules, conditions, actions, mailboxes
Brand Logo, wordmark, colours, font and how to use them
Changelog Every release, its breaking changes and upgrade notes

Development

Requires Python 3.14+ and uv:

uv sync
uv run pytest -v

Install the pre-commit hook once per clone. It runs the secret scan (gitleaks, on the staged changes) and the dependency audit (pip-audit, on uv.lock) of CI before every commit; git commit --no-verify skips it:

ln -sf ../../scripts/git-hooks/pre-commit .git/hooks/pre-commit

License

AGPL-3.0 — © 2026 Michael Klamminger - gorgeIT (https://gorgeit.com)