Post
Use the post CLI for email tasks and postd for the background daemon.
Read First
- - Read
SETUP.md for first-time install, keychain credentials, daemon setup, and scoped API keys. - Read
references/common-tasks.md for concrete workflows and reply recipes.
Core Rules
- - Treat UIDs as mailbox-scoped, not globally unique. If a message is not in
INBOX, pass --reply-mailbox <mailbox> when replying. - Prefer
--json when the result will be parsed or reused in a later step. - Prefer scoped API keys for agents. Use
--token <token> for one-off commands or set POST_API_KEY only in that agent’s environment. - Use
post draft --replying-to <uid> for threaded replies. This auto-derives from, to, and subject, and sets In-Reply-To / References. - Omit
--body to create a Mail-style reply draft with quoted original content ready for inline editing. - Use
--reply-all only when you really want all original recipients copied.
Fast Command Map
Inspect accounts and folders
CODEBLOCK0
Find mail
CODEBLOCK1
Draft and reply
CODEBLOCK2
Attachments and exports
CODEBLOCK3
Organize mail
CODEBLOCK4
Reply Workflow Guidance
For real replies, prefer one of these two modes:
- 1. Compose in Markdown first
- Fetch the original message
- Write a
.md file with your reply
- Use INLINECODE18
- 2. Create a native Mail-style draft
- Use
post draft --replying-to <uid>
- Open and finish it in Mail.app
For multi-question emails, fetch the message first, identify each question, and write an interleaved Markdown reply using blockquotes. See references/common-tasks.md for a full example.
Security / Agent Isolation
Use per-agent API keys instead of sharing a full-access environment:
CODEBLOCK5
Then either:
CODEBLOCK6
or set only that agent’s environment:
CODEBLOCK7
Details and setup examples live in SETUP.md.
Post
使用 post CLI 处理邮件任务,使用 postd 处理后台守护进程。
先阅读
- - 阅读 SETUP.md 了解首次安装、钥匙串凭据、守护进程设置和作用域 API 密钥。
- 阅读 references/common-tasks.md 了解具体工作流程和回复方案。
核心规则
- - 将 UID 视为邮箱作用域,而非全局唯一。如果邮件不在 INBOX 中,回复时需传递 --reply-mailbox 。
- 当结果需要被后续步骤解析或复用时,优先使用 --json。
- 为代理优先使用作用域 API 密钥。对于一次性命令使用 --token ,或仅在该代理的环境中设置 POSTAPIKEY。
- 使用 post draft --replying-to 进行线程化回复。这会自动推导 from、to 和 subject,并设置 In-Reply-To / References。
- 省略 --body 可创建带引用原文的 Mail 风格回复草稿,便于内联编辑。
- 仅在确实需要抄送所有原始收件人时使用 --reply-all。
快速命令映射
检查账户和文件夹
bash
post servers
post folders --server
post status --server --mailbox INBOX
查找邮件
bash
post list --server --mailbox INBOX --limit 20
post search --server --from someone@example.com --since 2026-03-01
post fetch --server --mailbox INBOX
post fetch --server --mailbox INBOX --json
起草和回复
bash
新建草稿
post draft --server --from me@example.com --to you@example.com \
--subject Hello --body reply.md
带正文的线程化回复
post draft --server --replying-to --body reply.md
线程化回复,回复全部
post draft --server --replying-to --reply-all --body reply.md
在 Mail.app 中进行内联编辑的线程化回复
post draft --server --replying-to
回复 INBOX 之外的邮件
post draft --server --replying-to --reply-mailbox Archive --body reply.md
附件和导出
bash
post attachment --server --mailbox INBOX --output /tmp/mail
post pdf --server --mailbox INBOX --output /tmp/
post eml --server --mailbox INBOX --output /tmp/
整理邮件
bash
post move Archive --server --mailbox INBOX
post archive --server --mailbox INBOX
post trash --server --mailbox INBOX
post junk --server --mailbox INBOX
回复工作流程指导
对于实际回复,优先选择以下两种模式之一:
- 1. 先用 Markdown 撰写
- 获取原始邮件
- 用 .md 文件撰写回复
- 使用 post draft --replying-to --body reply.md
- 2. 创建原生 Mail 风格草稿
- 使用 post draft --replying-to
- 在 Mail.app 中打开并完成编辑
对于包含多个问题的邮件,先获取邮件,识别每个问题,然后使用块引用编写交错式 Markdown 回复。完整示例请参见 references/common-tasks.md。
安全 / 代理隔离
使用每个代理独立的 API 密钥,而非共享全访问环境:
bash
post api-key create --servers work
post api-key create --servers personal
然后执行:
bash
post servers --token
或仅设置该代理的环境:
bash
export POSTAPIKEY=
详细信息和设置示例见 SETUP.md。