agent-zero/plugins/_email_integration
2026-03-23 21:34:28 +08:00
..
api improve: test connection send test email to self after auth passes 2026-03-18 20:00:58 +08:00
extensions/python refactor: remove _read_fw helper, add ChatSummary TypedDict to dispatcher 2026-03-17 02:58:48 +08:00
helpers fix(email): reference attachments before text parts and remove unused import 2026-03-23 18:28:42 +08:00
prompts improve: email system prompts 2026-03-18 16:38:24 +08:00
webui fix: prevent empty project override in UI and sync project state on routes 2026-03-23 21:34:28 +08:00
default_config.yaml feat: add dispatcher_model setting to choose utility or chat model for email routing 2026-03-17 00:46:02 +08:00
plugin.yaml Update plugin.yaml 2026-03-18 19:08:31 +08:00
README.md refactor: normalize plugin paths, add README viewer to plugin info modal, and update plugin hub filters 2026-03-22 08:05:32 +01: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.
  • 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.
  • 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.