Mail workflow
Top-level commands for the jobs agents and people do most: send a message, read one with its trust verdict, wait for a message or a verification code, and follow events live. Usage, flags and examples for `machinemail send`, `machinemail read`, `machinemail wait`, `machinemail tail`.
Top-level commands for the jobs agents and people do most: send a message, read one with its trust verdict, wait for a message or a verification code, and follow events live.
| Command | Summary |
|---|---|
send | Send an email from an inbox |
read | Show a message: headers, trust verdict and agent-safe text |
wait | Wait for a message to arrive (and extract a code or magic link with —otp) |
tail | Follow live events (messages, deliveries, inboxes) as they happen |
Every command also takes the global flags.
send
Send an email from an inbox.
Sends through POST /v0/inboxes/{inbox_id}/messages/send. The body comes from —text, —html or —file (a .html/.htm file is sent as HTML, anything else as text); pass - to any of them to read stdin. Stdin is never read unless you ask. —from defaults to MACHINEMAIL_INBOX, the profile inbox from machinemail register, or the inbox of an inbox-scoped key.
Flags
--from <inbox-id>string--to <address>string[]--cc <address>string[]--bcc <address>string[]-s, --subject <text>string--text <text|->string--html <html|->string-f, --file <path|->string--attach <path>string[]--reply-to <address>string[]--label <label>string[]--header <Name: value>string[]Examples
read
Show a message: headers, trust verdict and agent-safe text.
Shows one message with its trust report summary (verdict, score, authentication, flags) and the agent-safe body (trust.content.text: hidden text, zero-width characters, quotes and signatures removed). —original shows the text as the sender wrote it, labelled untrusted; —raw prints the raw RFC 5322 source.
Piped (or with —json) it prints the agent view: headers, the trust verdict, untrusted: true unless the sender authenticated (verified or known), and body: the agent-safe text (body_source says where it came from; quarantined mail is withheld, as the MCP server does). —full prints the whole API object instead, with the original text and HTML. The inbox can be given as —inbox or as the first argument; without it the CLI finds it.
Arguments
<message-id>stringRequiredFlags
--inbox <inbox-id>string--originalboolean--fullboolean--rawbooleanExamples
wait
Wait for a message to arrive (and extract a code or magic link with —otp).
Blocks until a new inbound message matching the filters arrives in the inbox, then prints it. Listens on the SSE event stream and polls as a fallback. Only mail received after the command starts counts; —since 5m also accepts mail from the last five minutes (use it when you triggered the email before calling wait).
Piped (or with —json) it prints the agent view of the message: headers, the trust verdict, untrusted: true unless the sender authenticated, and the agent-safe body (withheld for quarantined mail); —full prints the whole API object instead, original text included.
—otp prints only the verification code (or the magic link when there is no code), read from the agent-safe text. It only uses mail whose sender authenticated (trust level verified or known, or a DMARC pass, or an aligned SPF or DKIM pass); —allow-unauthenticated also accepts unauthenticated mail and mail without a trust report, and suspicious or quarantined mail is never used. Unauthenticated mail does reach the inbox (labelled UNAUTHENTICATED), so this check matters. —from matches an address exactly, or a domain and its subdomains (github.com matches mail.github.com, not github.com.example.net). —json prints {code, link, message_id, …} instead. Exits 8 on —timeout.
Flags
--inbox <inbox-id>string--from <address|domain>string[]--subject <text>string[]-t, --timeout <duration>string--since <duration|iso>string--otpboolean--linkboolean--pattern <regex>string--link-domain <domain>string--allow-unauthenticatedboolean--fullboolean--pollbooleanExamples
tail
Follow live events (messages, deliveries, inboxes) as they happen.
Streams GET /v0/events/stream. On a terminal: one line per event with the trust badge of inbound mail, and a status line. Piped: NDJSON, one {id, event, data} per line. Reconnects on its own and resumes with Last-Event-ID; pass —last-event-id to resume from an earlier run. Ctrl-C stops it (exit 0).
Flags
--inbox <inbox-id>string[]--pod <pod-id>string[]-e, --event-typesstring[]--last-event-id <evt_...>string--max <n>integer