Mail

Email CLI configuration

See and change a profile's mailbox settings, permissions and run records.

Decide how far back mail reads, which addresses are yours and what an agent may change. Settings live in one file, config.json, in the folder mail doctor shows. Each profile has its own part, and defaults apply to every profile. config shows and changes them:

mail personal config show
mail personal config set limit 50
mail personal config unset limit

A profile made by session start also holds the mailbox: address, login (when it is not the address), imap_host, imap_port, imap_security (tls or starttls), auth (app-password; a profile saved without it signs in with an app password too) and folders (the folders sync reads). smtp_host, smtp_port and smtp_security name the server messages send submits to; set them only for a provider the built-in list does not know. The app password is not a setting: it lives in the keyring, or in MAIL_PASSWORD for a run that has no keyring. Nor is an OAuth sign-in: its tokens live in the keyring too.

aliases lists your other addresses on this mailbox, the ones you also send from (config set aliases me@work.example.com,me.alias@example.com). Mail from one of them is yours, as mail from address is, and mail to one is addressed to you: review --unanswered and tasks agenda count it as owed. A shared address, such as a team's, is not an alias: mail your colleagues send from it would count as yours. Mail in the Sent folder is yours whatever address it came from, and its senders join your addresses in the store on their own; set aliases for an address that has no mail in Sent yet. Mail stored before is marked at the next sync. The store keeps an address once it is yours: config unset aliases does not take it back.

A Gmail profile signed in with Google also reads Gmail's "send as" list at each sync (Gmail API), and every address Gmail accepted there is yours, as an alias is. The sign-in's https://mail.google.com/ scope allows it; your own Google app needs the Gmail API turned on (see Gmail with OAuth). When Gmail does not answer, sync uses the list it read last and says why under send_as.unread. A profile with an app password cannot read the list: name those addresses in aliases.

read_attachments (default true) and max_attachment_mb (default 10) decide whether sync reads the text of attachments into the search index and the largest file it reads. No file is kept. sync --no-attachments, --attachments and --max-attachment-mb override them for one run; messages show reads one email's attachments whatever they say.

sync_since (default 30d) is how far back sync reads when a run gives no --since-time: a window back from now in days, weeks or years (90d, 12w, 1y), or a date (2025-01-01, from local midnight). Make it wider and the next sync reads the older mail too; no --rescan is needed. config set sync_since 1y sets it for one profile, --defaults for every profile. WireCat Desktop shows it in the mail settings.

microsoft_client_id is the Microsoft app that Outlook.com and Microsoft 365 sign in with, when you use your own instead of WireCat's. Set it once for every profile with config set --defaults microsoft_client_id and the app's id; how to get an id is in register a Microsoft app. google_client_id does the same for Gmail over OAuth; its secret comes from MAIL_GOOGLE_CLIENT_SECRET, never the file. MAIL_MICROSOFT_CLIENT_ID and MAIL_GOOGLE_CLIENT_ID win over both settings for one run, and --client-file wins over everything for Gmail. A profile already signed in keeps refreshing with the app it signed in with. mail doctor shows each profile's app under oauth_client.

An agent over MCP that holds mcp.authority may change settings with config set, but never these: the mailbox settings above, which decide where the app password goes, aliases, which decides which addresses are yours, microsoft_client_id and google_client_id, which decide which app you sign in to, and permissions.messages.send.others, which lets an agent mail other people. Only you change them, at a terminal.

config show lists each setting and where it came from: the file, a variable or the default.

config set also lists settings for search, speech and embeddings (embedding_*, speech_model, picture_search and others). Every WireCat CLI shares that list. mail ignores them.

Permissions

permissions decides what a command may do for this profile: allow, ask, readonly or deny, per permission key. Over MCP there is no one to ask, so ask lets the command run: only deny or readonly stops an agent. Mail to other people is the one exception, described under sending. MAIL_READ_ONLY=1 refuses every write, whatever the permissions say, but one: rules add --sender or --list-id with --do envelope, for a sender or list that has no rule yet, which memo's scheduled mail triage runs. It is recorded with source: agent (rules list source:agent); a replaced rule, --domain, --filter, --kind, any other action and a tag stay refused, as do rules remove, rules import and rules apply.

The key of a command is its path: messages.move, folders.delete. Built in, a change that can be undone goes ahead (flags, moves, copies, folders made or renamed, drafts saved), and these ask: messages.delete, folders.delete, drafts.delete, and messages.bulk, which every change of more than 20 messages or chosen by --filter passes as well. At a terminal ask is a y/N question, and no is the default. A flag answers it instead: --allow-dangerous for drafts delete, since a deleted draft does not come back, and --yes for every other change, messages delete included, since Trash and messages restore bring the mail back. With no terminal and no flag the command stops with confirmation_required (exit 7) and changes nothing.

Sending has two keys. messages.send and messages.forward are the commands themselves and go ahead when the mail goes only to you. Mail that reaches anyone else also passes messages.send.others, which asks by default; set it to allow to send without the question, or readonly to let this profile mail only you. An agent over MCP, where nobody can answer the question, mails only you until you set messages.send.others in the config yourself (ask or allow); an mcp serve --permission cannot open it. Each recipient counts toward sends_per_hour (30 by default).

mail personal config set permissions.messages readonly      # no flag, move, deletion or send on this profile
mail personal config set permissions.messages.bulk deny     # one message at a time only
mail personal config set permissions.messages.send.others allow   # send to others without the question, agents too

Every attempt to change the mailbox or send goes into the profile's send journal with its key, the count and the outcome, never a subject, an address or the text.

Run records

A command that fails is kept as a run, for mail runs list and runs show. record_input decides whether a run keeps the words you typed; it is true unless you set it to false. Secrets are masked either way; see Security.