Email Manager
Introduction
The Email Manager tool operates on your IMAP mailbox: list messages, read them, send new ones, reply to existing threads, move messages between folders, and apply labels. It reuses the IMAP and SMTP credentials of the Email connector.
!NOTE The Email Manager tool is not the same as the Email connector. The connector lets users message the bot via email. The tool lets the bot read and write your inbox. They can be enabled independently and only share the SMTP/IMAP config.
Reading the Inbox
| Parameter | Description |
|---|---|
operation | inbox |
folder | Folder name (default INBOX) |
search | Plain text search across subject, sender, and body. Don't use Gmail-style operators like from: or subject: — just words. |
from_filter | Filter by sender (partial match) |
limit | Max messages to return (default 10, max 20) |
Returns a JSON array of message summaries: UID, subject, sender, date, read/flagged status, attachment count, size.
To read a single message in full:
| Parameter | Description |
|---|---|
operation | read |
uid | Message UID |
folder | Folder name (default INBOX) |
The body is returned as plain text, falling back to a stripped HTML body, truncated at 50 KB.
Sending and Replying
To send a new email:
| Parameter | Required | Description |
|---|---|---|
operation | Yes | send |
to | Yes | Array of recipient email addresses |
subject | Yes | Subject line |
body | Yes | Body text |
cc | No | CC recipients |
bcc | No | BCC recipients |
attachments | No | Array of {disk, path, filename, mime_type} objects |
To reply to an existing message:
| Parameter | Required | Description |
|---|---|---|
operation | Yes | reply |
uid | Yes | The UID of the message being replied to |
body | Yes | Reply body |
to | No | Override the reply-to address |
attachments | No | Same shape as send |
Replies set In-Reply-To and References automatically so they thread correctly in mail clients. The original message is marked as answered.
Folders and Labels
| Operation | Parameters | Notes |
|---|---|---|
move | uid, folder (destination), optional source_folder | Moves the message to another folder |
label | uid, folder (label), optional source_folder | Copies the message to another folder, leaving it in place |
folders | — | Lists every folder in the mailbox |
create_folder | folder | Creates a new folder |
delete_folder | folder (or folders) | Requires confirmation. Deletes one or more folders. |
Marking Read and Unread
| Operation | Parameters |
|---|---|
mark_read | uid, optional folder |
mark_unread | uid, optional folder |
Deleting Messages
| Parameter | Description |
|---|---|
operation | delete |
uid or uids | Single UID or array of UIDs |
folder | Folder name (default INBOX) |
Delete requires confirmation. The user is prompted in chat first, and the deletion is permanent (the message is expunged, not just flagged).