email-inbox

email-inbox is a skill for Claude Code, Codex from askie/cfmail. It costs 94 tokens per session (3,113 once invoked), scanned A, a copy of email-inbox, MIT.

A command-line tool for reading and sending mail through a cloudflare-email mailbox, using an access key tied to a particular email address.

In plain words
What is it for?
Reading new or unread mail, finding codes or invoices, polling for notifications, sending replies, and handling attachments.
Why use it?
It gives an AI agent a defined way to check messages and send mail without needing to open a separate mail application.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/askie/cfmail/email-inbox
Any agent
npx skills add askie/cfmail --skill email-inbox
Clone the repo
git clone --depth 1 https://github.com/askie/cfmail

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for email-inbox

README.md
[![agentmods](https://agentmods.dev/badge/skills/askie/cfmail/email-inbox.svg)](https://agentmods.dev/skills/askie/cfmail/email-inbox)
Your own site
<a href="https://agentmods.dev/skills/askie/cfmail/email-inbox"><img src="https://agentmods.dev/badge/skills/askie/cfmail/email-inbox.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00094 $0.03113
Opus 5 $0.00047 $0.01556
Sonnet 5 $0.00019 $0.00623
Haiku 4.5 $0.00009 $0.00311

Measured 4d ago against content hash 7a1bf605ef1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

email-inbox scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to email-inbox — 14 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/email-inbox/SKILL.md · 208 lines

How it starts

The opening of the file, as written. The whole thing — 208 lines — stays where its author put it; the contents beside it link to each section on GitHub.

email-inbox

收发 cloudflare-email 邮箱里的邮件。这个服务把发到某个域名的邮件存档;你拿到一把绑定到某个邮箱地址的 API Key,就能读取属于这个邮箱的邮件,并以这个地址发信

所有操作都通过 cfmail 这个命令行工具完成,从任何目录都能跑,不用 cd 到技能目录。

何时使用

  • :查收邮件 / 看有没有新邮件 / 读未读邮件 / 找验证码、发票、账单、通知 / 轮询某个邮箱
  • :发一封邮件 / 回复某封邮件 / 把某个附件发给谁 / 把收到的附件转发出去

前置:安装 cfmail(一次性)

先看有没有装:

cfmail --version

没有就装(需要 Node 20+):

npm install -g cfmail

要跑仓库里最新未发布的代码才用源码安装:

git clone https://github.com/askie/cfmail.git
cd cfmail/cli && npm i -g $(npm pack | tail -1)

装完 cfmail 在任何目录都能用,不需要 cd 到技能目录。

第一步:配置接入点(一次性)

cfmail setup --base <服务地址> --email <你的邮箱> --key <你的API Key>
  • 服务地址:例如 https://mail.example.com,不带 /mcp
  • 邮箱地址:这把 Key 绑定的收件地址,仅用于显示,权限由 Key 决定
  • API Key:一串 32 位十六进制字符,由服务管理员发放。这是凭证,不要泄露。

命令会当场连服务验证,看到 ✅ Connected 才算成功。配置写到 ~/.config/email-inbox/config.json,Key 只存在本机这个文件里。

一台机器多个邮箱

一份配置文件 = 一个邮箱。 没有「当前邮箱」这种共享设置,所以不存在被别的 Agent 改掉的问题。

再收一个邮箱就再开一份配置:

export EMAIL_INBOX_CONFIG=~/.config/email-inbox/work.json
cfmail setup --base <服务地址> --email [email protected] --key <Key>
cfmail unread                     # 这个进程之后都走 work 这份

密钥、未读游标、归档目录、推送设置全在各自的文件里,互相看不见。不设这个变量就用默认那份 ~/.config/email-inbox/config.json

这台机器上有多个 Agent 时

各设各的 EMAIL_INBOX_CONFIG,一次设好,之后所有命令自动走对邮箱:

export EMAIL_INBOX_CONFIG=~/.config/email-inbox/agent-a.json

不确定自己现在连的是哪个邮箱,跑 cfmail config 看一眼——它会打印邮箱、服务地址、归档目录和用的哪份配置文件,不打印 Key。

同一份配置被并发读写是安全的,不会丢更新也不会读到写了一半的内容。

注意 unread 的语义:它是「我看到哪儿了」的游标,不是任务队列。两个 Agent 读同一个邮箱会各自拉到同一批未读——即使用两份配置也一样,那只是让游标各走各的。要分工请让它们用不同邮箱。

命令输出会标明这次读的是哪个邮箱。

收邮件

cfmail unread                      # 收最新未读(首次给存量,之后只给新的)
cfmail unread --peek               # 只看,不标记已读
cfmail unread --all                # 忽略已读状态,看最近的
cfmail unread --reset              # 把当前全部标为已读
cfmail read <邮件id>                # 读全文,末尾列出附件 id
cfmail read <邮件id> --html         # 连 HTML 正文一起
cfmail search "关键字"              # 全文搜索,中文可用
cfmail list --from [email protected]   # 按发件人/主题/时间筛选
cfmail attachment <附件id> --out ./file.pdf   # 下载附件
cfmail stats                       # 邮箱统计

Read the full file on GitHub · 208 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 208 lines · 94 tokens per session scan A 7a1bf605ef1a

Subscribe to this mod's changes

email-inbox is a skill published in the GitHub repository askie/cfmail (0 stars, last pushed 8d ago), licensed MIT. It adds 94 tokens to every session and 3,113 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to email-inbox, differing in 14 lines, and is treated as a copy.