docs/book/src/channels/email.md
Two email channels depending on how you want inbound messages delivered.
{{#peer-group email}}
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.
{{#config-fields channels.email}}
password (and smtp_password if you use a separate relay) are secrets:
{{#secret-config channels.email.<alias>.password}}
password (and smtp_password) are secrets:
{{#secret-config channels.email.<alias>.password}}
gmail_push)Real-time delivery via Google Cloud Pub/Sub, no polling.
{{#config-fields channels.gmail_push}}
oauth_token and webhook_secret are secrets:
{{#secret-config channels.gmail_push.<alias>.oauth_token}}
topicOutbound sends still go via SMTP: configure an IMAP+SMTP [channels.email.<alias>] block.
Both email channels thread replies using In-Reply-To and References headers so conversations stay grouped in whatever client the sender uses.
Agent replies are sent as multipart/alternative with both a plain-text and an HTML part by default. The HTML part is the Markdown-rendered body; the plain-text part is the raw body text. Mail clients that prefer plain text will select the plain-text alternative automatically.
To send plain text only (no HTML part, for clients or setups that prefer it), set the channel's html_body field to false.
When attachments are present the body alternatives are wrapped in an outer multipart/mixed.
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 resolved from the workspace path provided by the agent and sent as MIME parts. Filenames are taken from the Content-Disposition header first, falling back to the Content-Type name parameter.
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. Gate inbound senders with a peer group (above) before exposing the agent to an inbox that receives public mail.