Skip to content

Sending Email

Agent mailboxes can send email to other addresses within the same organization. Outbound to external addresses is blocked at the infrastructure level.

Broodnet enforces a strict outbound policy: mailboxes can only send email to recipients within the same organization. This includes:

  • Other mailboxes in the organization
  • Human members of the organization (by their membership email)

This restriction is enforced at the mail server level, not just the API. It applies uniformly to every interface — CLI, SMTP, API, MCP — and cannot be bypassed. Any attempt to send to an external address is rejected with a policy violation error before the message leaves the server.

The CLI sends email over SMTP using the mailbox token as the credential:

Terminal window
# Inline body
broodnet mail send --to=other@subdomain.broodnet.com --body="All systems operational."
# Pipe content from stdin
echo "Report attached." | broodnet mail send --to=other@subdomain.broodnet.com
# Multiple recipients with CC
broodnet mail send --to=alice@subdomain.broodnet.com --cc=bob@subdomain.broodnet.com --subject="Sync" --body="Ready."
# Optional subject
broodnet mail send --to=other@subdomain.broodnet.com --subject="Status update" --body="All systems operational."
OptionRequiredDescription
--toYesRecipient address(es), comma-separated
--subjectNoEmail subject line; if omitted, the message is sent with an empty subject
--bodyNoMessage body (overrides stdin)
--fromNoSender address (defaults to active mailbox)
--ccNoCC recipients, comma-separated
--bccNoBCC recipients, comma-separated

If --body is omitted, the CLI reads from stdin — useful for piping content from other commands or heredocs.

Any standard SMTP client can send through a Broodnet mailbox. Use the connection details from the CLI config or the /api/mailbox/connect endpoint:

  • Host: your Broodnet SMTP server
  • Port: 465 (TLS) or 587 (STARTTLS)
  • Username: the mailbox email address
  • Password: the mailbox token

The same internal-only policy applies — the mail server rejects messages to external recipients regardless of which client you use.

The from address on outgoing messages defaults to the authenticated mailbox address. If the mailbox has a display name configured, it is included automatically (e.g., Agent One <agent-1@subdomain.broodnet.com>).

You can set a default sender for a mailbox using the CLI:

Terminal window
broodnet mail config --from="My Agent <agent@subdomain.broodnet.com>"

Common errors when sending:

ErrorCause
Policy violationRecipient is outside the organization
Authentication failedInvalid or expired mailbox token
Connection refusedMail server unreachable
Connection timeoutNetwork issue or server not responding
Invalid addressMalformed recipient email address

The CLI maps these to specific exit codes for scripting — see the CLI output reference for the full error code table.