Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

1.9 KB
Raw Blame

EMAIL_SEND_MESSAGE requires text for plain-text compatibility. html optionally adds a multipart alternative. inline_images accepts at most four objects containing only cid (unique ASCII identifier, 1–128 characters) and data_base64 (canonical PNG bytes). Decoded bytes total at most 256 KiB. All arguments combined must fit 900000 UTF-8 JSON bytes (including base64, escaping and metadata), leaving room below the unchanged 1048576-byte harness frame/body limit. Individual text/HTML limits do not override this aggregate budget. Reference an image with . URL attachments, raw MIME and arbitrary headers are not accepted. Composition disables file and URL access. Existing send approval, audit, recipient, reply and Sent-copy behavior remains in the host/client path. filed=false means sending succeeded but filing did not.

attachments (EMAIL_SEND_MESSAGE and EMAIL_SAVE_DRAFT) is a list of at most 10 file paths, 25 MB together. Each is read by the server with attach_file's rule (server/bot-attachment.ts readBotFile): only the bot's working folder (its Local VM workspace first), its inbox of handed files and files attached in this conversation. A path outside them fails the call before anything is sent or saved. Sending still asks for approval as before.

EMAIL_SAVE_DRAFT appends the message flagged \Draft and \Seen to the mailbox's Drafts folder: the one the server marks \Drafts (RFC 6154), else one named Drafts or INBOX.Drafts, else the mailbox named with mailbox. It needs no outgoing server and sends nothing; to is optional and Bcc is kept. replace_uid updates a draft: the old message must carry \Draft, the new one is saved first, then the old one removed.

Offline acceptance: run vitest on server/email/. Tests use synthetic PNG bytes and fake SMTP/IMAP dependencies, including the native host-to-client path. Keep OMB_EMAIL_REAL_TEST unset unless a dedicated local test mail server was explicitly prepared.