# urbestack-botmail-key-add

First published 18 Oct 2026 (release 0.2.10) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-botmail-key-add --address user@example.com --name NAME [--used-by-person yes|no] [--platform WORD] [--from-name NAME] [--may read,search,flag,draft,send,reply] [--send-mode self|drafts|known] [--folders-out drafts,sent,junk,trash] [--recipients a@b,example.com,...] [--blocked ...] [--sends-per-hour N] [--sends-per-day N] [--recipients-per-message N] [--calls-per-minute N] [--copy-to ADDRESS] [--from-addresses IP,CIDR,...] [--expires-days N] [--owner USER]
```

## Description

Creates a named BotMail key for the mailbox specified by --address. BotMail must be ready for the domain and allowed by the customer's package. Use --owner to require that the mailbox belong to that customer. The command returns the secret only once, both on its own and in the MCP URL for the bot.

When you create the mailbox's first key, use --used-by-person yes if a person also uses the mailbox in a mail client, or no if only bots use it. The default is yes. The setting belongs to the mailbox and supplies defaults for new keys. A shared mailbox defaults to --send-mode drafts, which leaves outgoing mail in Drafts, and excludes Drafts and Trash from the key's folder access. A bots-only mailbox defaults to --send-mode self, which lets the bot send directly. It excludes Trash and sends copies to the customer's email address if one is set.

--platform records the bot's platform. --from-name sets the sender display name for this key. An empty value uses just the sender's email address. --may takes a comma-separated list of permitted operations and defaults to read,search. --folders-out takes a comma-separated list of folders the key cannot access. --recipients and --blocked take comma-separated lists of email addresses or domain names, such as a@b,example.com. --copy-to sets the email address that receives copies of outgoing mail. --from-addresses restricts access to a comma-separated list of IP addresses or CIDR networks. --expires-days sets the key's lifetime in days and defaults to 0 for no expiration.

--sends-per-hour defaults to 20 and accepts 1 to 1000. --recipients-per-message defaults to 5 and accepts 1 to 50. --sends-per-day defaults to 100 and --calls-per-minute defaults to 30. Both have a minimum of 1 and are capped by mail.botmail_sends_per_day and mail.botmail_calls_per_minute, which default to 200 and 60 respectively. The package can set a lower key limit per mailbox than the server's mail.botmail_keys_per_mailbox ceiling, which defaults to 5. An unset or zero package limit uses the server ceiling.

## Same in the API

- [POST /domains/{name}/mail/accounts/{local}/bot-keys](https://urbestack.com/docs/api/post-domains-name-mail-accounts-local-bot-keys.md): Create a bot key for a mailbox

## Command family: botmail

- [urbestack-botmail-domain-list](https://urbestack.com/docs/commands/urbestack-botmail-domain-list.md): Lists domains whose mail is hosted on this server.
- [urbestack-botmail-domain-off](https://urbestack.com/docs/commands/urbestack-botmail-domain-off.md): Turns off BotMail for a domain and immediately revokes every BotMail key for its mailboxes.
- [urbestack-botmail-domain-on](https://urbestack.com/docs/commands/urbestack-botmail-domain-on.md): Turns on BotMail for a domain whose mail is hosted on this server or changes its BotMail hostname.
- [urbestack-botmail-events](https://urbestack.com/docs/commands/urbestack-botmail-events.md): Runs one round of BotMail webhook delivery, the same work the timer runs every minute.
- [urbestack-botmail-key-address](https://urbestack.com/docs/commands/urbestack-botmail-key-address.md): Issues a new MCP URL for an existing bot key by rotating its secret.
- [urbestack-botmail-key-del](https://urbestack.com/docs/commands/urbestack-botmail-key-del.md): Revokes a bot key immediately and removes its webhook.
- [urbestack-botmail-key-list](https://urbestack.com/docs/commands/urbestack-botmail-key-list.md): Lists all bot keys on the server by default.
- [urbestack-botmail-key-set](https://urbestack.com/docs/commands/urbestack-botmail-key-set.md): Changes selected rules for a bot key, pauses it, or resumes it.
- [urbestack-botmail-prune](https://urbestack.com/docs/commands/urbestack-botmail-prune.md): Deletes BotMail key activity, counters from expired rate-limit windows, and webhook events that have reached a final status when they are older than the retention period set by mail.botmail_activity_days.
- [urbestack-botmail-webhook-del](https://urbestack.com/docs/commands/urbestack-botmail-webhook-del.md): Removes a bot key's webhook and its stored bearer token, ending new-mail notifications for that key.
- [urbestack-botmail-webhook-resume](https://urbestack.com/docs/commands/urbestack-botmail-webhook-resume.md): Resumes a bot key's webhook after BotMail paused it following seven failed delivery attempts.
- [urbestack-botmail-webhook-set](https://urbestack.com/docs/commands/urbestack-botmail-webhook-set.md): Creates or updates the webhook for the bot key identified by --key.
- [urbestack-botmail-webhook-test](https://urbestack.com/docs/commands/urbestack-botmail-webhook-test.md): Sends an immediate test ping through BotMail to the webhook for the bot key identified by --key.
