Email Channel (SMTP / IMAP)
An Email channel connects any standard mailbox using SMTP (for sending) and IMAP (for receiving). No third-party email API account is required.
Configuration
On your agent’s page, choose Add an email channel and provide:
| Field | Notes |
|---|---|
| SMTP host, port, security | Port 587 is typically starttls; port 465 is tls. |
| IMAP host, port, security | Port 993 is typically tls. |
| Username & password | Used for SMTP and IMAP. Use an app password if your provider requires one (e.g., Gmail with 2-step verification). OAuth is not supported. |
| IMAP folder | Defaults to INBOX. |
| Mailbox address | The address msend sends as and receives on. Display name and signature are optional. |
Existing mail is never imported: Connecting checks both SMTP and IMAP logins, then records the mailbox’s current end position. Only mail arriving after connection is ingested. msend reads with BODY.PEEK and marks a message as read only after it is safely stored.
Polling & Resync
- Active email channels are polled every 30 seconds (
EMAIL_POLL_SECONDS) by a Solid Queue recurring job. Ensurebin/jobsorSOLID_QUEUE_IN_PUMA=1is running. - If the IMAP server changes
UIDVALIDITY(renumbering the mailbox),msendautomatically resyncs from the current end without importing historical mail.
Threading, Participants & Text Normalization
- Threads: Keyed by the first ID in
References, thenIn-Reply-To, then the message’s ownMessage-ID. Subject changes do not split a thread. Outbound replies setIn-Reply-To,References, andRe: ...subjects, and record the sentMessage-IDasexternal_id. - Participants &
addressed_to_agent: Everyone inFrom,To, andCc(excluding the mailbox itself) is recorded as a participant.addressed_to_agentistrueonly when the mailbox is inTo. Under the defaultmentionsreply policy, mail where the mailbox is only inCcis stored but not sent to the agent. - Clean Text:
message.textstrips quoted reply history, signatures, and"Sent from my iPhone"footers so your LLM sees only the new turn. The full original body remains in the storedInboundEvent. Attachments overMAX_ATTACHMENT_BYTESare skipped with a note intext.
Bounces & Auto-Reply Loop Prevention
- Bounces: A delivery status report or
MAILER-DAEMONbounce referencing a sent message marks itfailedwitherror_code: "bounced"and the server’s diagnostic. SMTP5xxerrors fail immediately;4xxerrors and timeouts are retried. - Loop Prevention: Mail with
Auto-Submitted(other thanno),Precedence: bulk/junk/list, or fromMAILER-DAEMON,postmaster, ornoreply-style senders is stored withmetadata.automated = trueand not delivered to the agent.
Last updated on