agent-zero/plugins/_email_integration
frdel e138e33ca9 Add file-level DOX docs & update AGENTS indexes
Add comprehensive file-level DOX documentation across the repo and update directory AGENTS.md indexes. Many new `*.py.dox.md` files were added under api, helpers, tools, plugins, extensions, webui, and other dirs to document endpoint purpose, ownership, runtime contracts, work guidance, and verification. Several AGENTS.md files were created or updated (agents profiles, api, docker, extensions, helpers, plugins, skills, webui components, etc.) to list child DOX files and clarify documentation/work guidance. Also add example and bundled profile DOX files (agent0, default, developer, hacker, researcher) and minor updates to helpers/dirty_json.py and its tests. These changes improve on-disk documentation coverage and establish the convention that each direct runtime file should have a matching `*.dox.md` describing its contracts and verification steps.
2026-06-08 12:41:53 +02:00
..
api ui: redesign email, Telegram, and WhatsApp settings 2026-04-11 01:40:24 +02:00
extensions/python Refactor: use user locale for time displays 2026-05-21 15:26:00 +02:00
helpers integrations: add native chat controls and email config presets 2026-04-11 18:49:13 +02:00
prompts Squashed commit of the following: 2026-03-31 09:47:25 +02:00
webui Polish onboarding and email setup UX 2026-04-27 03:00:09 +02:00
AGENTS.md Add file-level DOX docs & update AGENTS indexes 2026-06-08 12:41:53 +02:00
default_config.yaml Polish onboarding and email setup UX 2026-04-27 03:00:09 +02:00
plugin.yaml Update plugin.yaml 2026-03-18 19:08:31 +08:00
README.md integrations: add native chat controls and email config presets 2026-04-11 18:49:13 +02:00

Email Integration

Communicate with Agent Zero through email inboxes and send replies back over SMTP.

What It Does

This plugin polls configured mailboxes, downloads incoming messages and attachments, decides whether a message should continue an existing chat or start a new one, and sends replies back by email.

It supports both:

  • IMAP inbox polling
  • Exchange inbox polling
  • SMTP replies

Main Behavior

  • Mailbox polling
    • Tracks per-handler mailbox state in usr/email/state.json.
    • Uses UID tracking for IMAP accounts so only new mail is processed after initialization.
  • Attachment handling
    • Downloads attachments into usr/email/attachments.
  • Dispatcher workflow
    • Reuses or creates a background Email Dispatcher context.
    • Uses model prompts to decide whether an email belongs to an existing chat or should open a new one.
    • Supports handler-level model presets for new chats, in addition to the dispatcher's utility/chat routing mode.
  • Thread routing
    • Can continue an existing chat by thread ID found in the email subject.
    • Falls back to model-based dispatch if no direct thread match is available.
    • Email replies inside an existing Agent Zero thread can use /project, /config, and /send control commands.
  • Notifications and persistence
    • Saves chats after routing and emits notifications about new or continued conversations.

Key Files

  • Core orchestration
    • helpers/handler.py manages polling, state persistence, dispatching, and reply flow.
  • Mail helpers
    • helpers/imap_client.py handles IMAP and Exchange fetching.
    • helpers/smtp_client.py handles outbound replies.
    • helpers/dispatcher.py formats chat summaries and parses dispatcher decisions.
  • API and extensions
    • api/ and extensions/ connect the polling loop and UI-facing operations into the main app.

Configuration Scope

  • Settings section: external
  • Per-project config: false
  • Per-agent config: false

Plugin Metadata

  • Name: _email_integration
  • Title: Email Integration
  • Description: Communicate with Agent Zero via email. Supports IMAP/Exchange inbox polling with SMTP replies.