docs/book/src/channels/email.md
Two email channels depending on how you want inbound messages delivered.
email_channel)The general-purpose email channel. Polls IMAP for new messages, sends via SMTP. Works with Gmail, Outlook, Fastmail, self-hosted Postfix, and anything else that speaks IMAP/SMTP.
[channels.email]
enabled = true
[channels.email.imap]
host = "imap.example.com"
port = 993
username = "[email protected]"
password = "..." # or app-password for Gmail/iCloud
mailbox = "INBOX"
poll_interval_secs = 60
[channels.email.smtp]
host = "smtp.example.com"
port = 587
username = "[email protected]"
password = "..."
[channels.email.filter]
allowed_senders = ["[email protected]", "[email protected]"]
subject_prefix = "[agent]" # only respond to subjects starting with this
OAuth 2.0 is recommended over password auth:
[channels.email.imap]
host = "outlook.office365.com"
port = 993
username = "[email protected]"
oauth_token = "..." # managed via `zeroclaw channel auth email`
gmail_push)Real-time delivery via Google Cloud Pub/Sub — no polling.
[channels.gmail_push]
enabled = true
account = "[email protected]"
client_secret_json = "~/.zeroclaw/gmail-client-secret.json"
pubsub_topic = "projects/my-project/topics/gmail-inbox"
pubsub_subscription = "projects/my-project/subscriptions/zeroclaw-sub"
allowed_senders = ["[email protected]"]
zeroclaw channel auth gmail-push opens a browser for the OAuth consentOutbound sends still go via SMTP — configure an smtp block in this channel the same way as the IMAP+SMTP channel.
Both email channels thread replies using In-Reply-To and References headers so conversations stay grouped in whatever client the sender uses.
Inbound attachments are stored under <workspace>/attachments/<conversation>/. The agent gets file paths in its context and can read them via the file_read tool.
Outbound attachments are not supported yet — the agent replies with links to files in the workspace, and the user downloads via whatever tunnel the workspace is exposed through.
Email isn't optimised for conversational latency. Expect:
poll_interval_secs (default 60 s). Lower at the cost of server load; some providers rate-limit aggressive polling.Email has no auth at the protocol level beyond SMTP's envelope — anyone can claim to be anyone. Always configure allowed_senders (strict list of addresses) or subject_prefix (shared secret in the subject line) before exposing the agent to an inbox that receives public mail.