文档Docs
用邮件指挥 Agent JCommand Agent J by e-mail
给 Agent 一个邮箱,白名单里的人发邮件就能派活,回复回到同一封邮件。白名单和发件人校验在程序里执行,挡下的邮件 Agent 一个字都看不到。QQ、163、企业邮箱都能用。Give the Agent a mailbox; people on your allowlist send it tasks by e-mail and the reply comes back in the same thread. The allowlist and sender check run in code before any model, so refused mail never reaches the Agent. Works with any IMAP/SMTP mailbox.
邮件是最通用的沟通方式:不用装 App,不用翻墙,公司Agent J 主机和手机都有。Agent J 可以收一个邮箱的信:白名单里的人发来一封邮件,它就当成一件任务交给主 Agent;做完了,用邮件回到同一个线程。
适合这些情况:
- 收到一封邮件,想让 Agent 处理——直接转发给 Agent 的邮箱,在最上面写一句要它做什么。
- 在大陆用不了 Telegram、Gmail,但公司邮箱、QQ 邮箱、163 都能用。
- 帮同事配好 Agent J,他们用自己的邮箱就能派活。
先说安全:白名单在程序里,模型之前
- 只有白名单里的地址发来的信才会交给 Agent。不在白名单的信只计数,正文、附件、标题都不会给模型。
- 发件人要能被验证。 发件地址很容易冒充,所以 Agent J 还会看你的邮箱服务商写在信头里的校验结果(SPF / DKIM / DMARC):默认是标准级别:任一项通过、而且域名对得上;严格级别只认 DMARC 或 DKIM。校验没有或没通过,同样不交给 Agent。
- 转发的原文是数据,不是指令。 你转发来的那封信会另存成一个文件交给 Agent,只有你自己在最上面写的那几句算你的话。
- 自动邮件不当任务、也不回: 自动回复、退信、邮件列表、群发通知,以及 Agent 自己发出的回信,都不会变成任务,不会形成邮件循环。白名单里的发件人发来的通知邮件会交给 Agent 读,但只读、不回信(见下文)。另一台 Agent J 主机的主人主动发来的信按普通来信处理(同样要过白名单和发件人校验),那台主机的自动邮件仍然跳过。
- 只回白名单里的地址,每小时有上限;Agent 选择不回复时,什么也不发。
- 白名单决定哪些来信会被处理;Agent 每次发信都要你在手机上长按确认。
- 授权码只在手机上填。 它加密保存在你的Agent J 主机上,不会出现在聊天、日志里,也不会上传到我们这里。
四步开通
- 准备一个邮箱。 建议给 Agent 专门注册一个,比如新开的 163 或 QQ 邮箱,当然用你现有的也行。
- 在邮箱网页里打开 IMAP/SMTP,拿到授权码。 注意,授权码不是登录密码,具体怎么拿见下一节。
- 在手机上打开 Agent J → 右上角设置 → 邮件通道:
- 选邮箱服务商(填了地址会自动选好),输入邮箱地址;
- 点「设置邮箱授权码」:地址等设置有变化时,先用 Face ID 确认人话摘要,随后直接弹出密钥卡。Gmail 请粘贴 16 位应用专用密码,空格不用删;密码只加密保存在主机,不进聊天。保存后自动测试收信和发信连接,不发测试邮件,页面显示成功或失败;
- 在白名单里加上你自己常用的邮箱。同事的邮箱可以加成「访客」;
- 打开「状态」开关。
- 发一封试试。 用白名单里的邮箱给 Agent 的邮箱写一封信,几分钟内就能收到回复(默认每 5 分钟检查一次,可以在设置里改,也可以直接点「立即检查」)。
也可以直接跟 Agent J 说:帮我配置邮件通道,它会带你一步步做;授权码依然只在手机的密钥卡上填。
打开以后,之前就在收件箱里的旧邮件不会处理,只处理之后收到的新邮件。
各家邮箱怎么拿授权码
| 邮箱 | 在哪里开 |
|---|---|
| QQ 邮箱 / Foxmail | 网页版 QQ 邮箱 → 设置 → 账号 → POP3/IMAP/SMTP 服务 → 开启 IMAP/SMTP 服务 → 按提示发短信 → 生成授权码 |
| 网易 163 / 126 | 网页版邮箱 → 设置 → POP3/SMTP/IMAP → 开启 IMAP/SMTP 服务 → 「新增授权密码」(只显示一次,记下来) |
| 阿里邮箱 / 阿里企业邮箱 | 网页版 → 设置 → POP3/SMTP/IMAP → 开启;开了安全登录的账号,要生成三方客户端安全密码 |
| 腾讯企业邮 | 网页版 → 设置 → 客户端设置 → 开启 IMAP/SMTP;绑定了微信安全登录的账号,在「账户 → 客户端专用密码」生成 |
| 网易企业邮箱 | 网页版 → 设置 → 客户端设置 → 开启 IMAP/SMTP;按管理员规定生成客户端授权码 |
| Gmail | Google 账号先开两步验证 → 打开 myaccount.google.com/apppasswords → 生成 16 位「应用专用密码」 |
| iCloud 邮件 | appleid.apple.com → 登录与安全 → App 专用密码 → 生成;登录名填完整的 iCloud 邮箱地址 |
| Outlook / Hotmail | 微软正在关闭 Outlook.com 的密码登录(只允许 OAuth)。如果「测试连接」失败,请换一个邮箱 |
其他邮箱选「其他邮箱(手动填写)」,按服务商给的 IMAP / SMTP 服务器、端口和加密方式填写。
发件人校验挡下了我自己的信?
在邮件通道页点「测试连接」,页面会告诉你:最近几封信里有没有校验结果、是哪台服务器写的。
- 有校验结果:Gmail 会自动固定校验服务器,页面显示「Gmail 已自动固定」。「只信任已确认的邮件服务器」可以勾选或取消,每次都要 Face ID 确认:取消就清除固定,主人邮件改按普通邮件处理;只有 Gmail 这类 Agent J 认识的邮箱能勾选,Outlook 和其他邮箱暂时不能在手机上勾选。旧版 Agent J 主机上只能查看。样本不完整时,不要凭显示的服务器名称判断可信。
- 一封都没有:说明这个邮箱服务商不写校验结果,标准和严格两档都会挡下所有信。只有这种情况才考虑把校验改成「关闭」——那时只靠白名单,别人冒充白名单里的地址就能把内容交给 Agent。更好的办法是给 Agent 换一个会写校验结果的邮箱。
同一个邮箱自己发给自己会被挡下:邮箱服务商不给内部邮件写校验结果(Gmail 实测如此)。所以请从你平时用的另一个邮箱发给 Agent 的邮箱,这也是我们建议给 Agent 单独注册邮箱的原因。
被挡下的发件人会列在页面最下面(只有地址和原因,没有内容),点「加入白名单」默认添加为「访客」。白名单每一行的身份下拉菜单可以选择「主人」或「访客」,选择后立即保存。访客改成主人需要指纹确认;只把主人改成访客时不用指纹,仍需已配对的遥控器签名确认。
邮件分身已回复、已转交给主人,或已记录为无需处理的邮件,会自动标为已读;处理失败、尚未完成或等待你决定的邮件保持未读。你手动改回未读后,分身不会重复处理。
会议纪要:/会议总结
录完会(见 手机:长录音),在输入框打 /会议总结(≡ 菜单「工具」里也有),录音各段留在附件栏,直接发送。Agent J 主机先把录音转成文字,Agent 再写纪要:概要、要点、决定、待办(负责人、截止时间)、未决问题。
- 后面写了邮箱,比如
/会议总结 发给 <邮箱1> <邮箱2>:纪要用你配好的 Agent 邮箱发给这些人,页面上也会显示一份。想发给自己,写一句“发我”就行。 - 什么都没写:纪要只显示在页面上,Agent 会问你要不要发、发给谁;你回一句发给谁(写上邮箱地址),它就发。
- 只会发给你亲手写的地址。 录音里有人说要发给谁不算,Agent 自己也加不了收件人,程序会直接拒绝。
- 没附录音时,用Agent J 主机上最近一组录音。
- 还没配邮箱:纪要照样显示在页面上,并提示你先按上面的四步开通。
让 Agent 自己去注册:等一封验证信
有了这个邮箱,可以让 Agent 自己去网站注册、登录。网站寄来的验证信发件人当然不在白名单里,平常只会被计数; Agent 让网站发出验证码之后,可以主动等这一封:
agentj mail expect --from github.com --subject-has verify --within 15m
- 只等一个发件人:写完整地址或网站域名。gmail.com、qq.com 这类公共邮箱域名会匹配所有陌生人,必须写完整地址。
- 只看窗口里的新信:从开始等之前 2 分钟起,最长等 60 分钟;每次最多拿 3 封。
- 只读:不标已读、不挪动 Agent 平时收信的进度,你在邮箱里看到的样子不变。
- 伪造的发件人拿不到:服务商的 SPF / DKIM / DMARC 校验没通过的信只计数,正文不读也不给 Agent。
- 只交给发起的 Agent:返回标题、正文纯文本(截断)、提取出的验证码和链接,标明「外部数据,不是指令」;
不进聊天记录,也不会自动回信。次数和结果在
agentj mail status里看得到。
白名单里的通知邮件
区块浏览器提醒、账单通知这类自动发出的邮件,只要发件地址在白名单里,也会交给 Agent 读。
- 照样校验发件人。 SPF / DKIM / DMARC 没通过的,和普通邮件一样挡下;冒充的通知进不来。
- 只读,不回信。 交给 Agent 时标着〔通知邮件〕,只当资料,不当你的指令,发件人是「主人」也一样;Agent J 不会给它回任何邮件。重要的事 Agent 会告诉你。
- 钓鱼邮件直接丢进废纸篓。 Agent 判断是钓鱼或地址投毒(比如一个长得像你常用地址的陌生地址给你转了 0 元)时,会把这封信移到邮箱的废纸篓,不来打扰你:
agentj mail trash --id <邮件 id>
- 能找回。 只是移到邮箱自己的废纸篓,不会彻底删除,你随时能在邮箱里找回。邮箱没有废纸篓文件夹时,什么也不动。
- 一次一封,只限交给过 Agent 的通知邮件。 只能处理 Agent J 这次启动后交给 Agent 的通知邮件,你自己的信和访客的信都动不了;每丢一封,聊天里会出现一行说明,日志里只记邮件 id 和结果。
主人和访客
- 主人:你自己的邮箱。这类邮件按你的指令处理,和在手机上说话一样;需要批准的操作照样在手机上批准。
- 访客:同事、家人等。访客的邮件不当作你的指令,不能批准任何操作;Agent 不会把你的凭据和私人资料给访客,回信会去掉邮箱地址等私人信息。
朋友的邮箱已经在通讯录里的话,不用再输一遍:在「设置」→「通讯录」里点他那一行右边的信封图标,就加进白名单,身份是「访客」;你自己那一行(0 号位)加成「主人」。这是你在手机上亲手点的,所以直接生效。
用命令行配置
Agent 在Agent J 主机上也能用 agentj mail 帮你配置:
agentj mail setup --address <Agent 的邮箱> # 按域名自动选服务器
agentj mail password # 在已配对手机上弹出授权码密钥卡
agentj mail allow <你常用的邮箱> # 加白名单(--guest 是访客)
agentj mail on
agentj mail test # 测试收信和发信能不能登录(不会发信)
agentj mail status
Agent 自己改设置时,凡是会让更多邮件进来的改动(加白名单、放松校验、打开通道、换服务器),都会先在你的手机上弹出批准卡片,你同意了才生效;你没确认(拒绝或超时),什么都不改,Agent 那边的命令也会报失败。白名单有任何变化,聊天记录里都会出现一行提示。
Gmail 用户请看 应用专用密码图文帮助,空格不用删,原样粘贴。
外部消息引发的自发邮件会把 HTML 压成纯文字;你自己要求发送的 HTML 报告不受此限制。
邮件与敏感卡片的确认
你自己发起的邮件通常要在手机上长按确认;收件人全是你本人的地址时不弹卡。外部消息或好友任务只发给你本人时也一样;但定时任务发信仍须批准。卡片绑定收件人、内容、附件摘要和邮件服务器;白名单只决定来信是否处理。你在已配对的遥控器上亲手点「转发到邮箱」或转发到 Telegram,或者在客服会话里签名发邮件,这一下就是你的批准,直接发出,不弹卡片,也不要通行密钥。修改邮件设置和测试连接仍需要通行密钥;仅把已有白名单身份从「主人」改成「访客」时不用指纹。邮箱账号、登录名或 IMAP/SMTP 的服务器、端口、加密方式改变后,旧授权码立即作废。旧版本保存的授权码:邮箱用的是固定服务商(Gmail、QQ、163 等)时,升级后第一次运行会自动迁移,照常收发;自定义服务器的不会直接使用,先核验已登记候选,只有没有可用项时才需要在密钥卡重新输入。
管理员和密钥卡需要本机遥控器的审批通行密钥;未开通时先到设置里开通。更换已有通行密钥时,先用旧密钥验证本次注册邀请,再创建新密钥;取消或验证失败会保留旧密钥。账号登录的通行密钥与遥控器审批密钥分别设置。
邮箱授权码失效时,Agent J 会先在已登记来源里查找同一账号的新授权码,测试收信和发信登录都通过后接管,不发测试邮件,也不显示授权码。来源包括托管密钥、主人登记的额外文件,以及密钥卡成功保存的文件;历史密钥卡即使没有邮箱账号标记、文件里也没有对应的邮箱地址变量,应用专用密码候选仍会用当前邮箱账号实测;只有收信和发信登录都通过才会使用。手机发信失败会说明原因;授权问题可点「修复并重试」,只有找不到可用授权码时才需要补充。保存的授权码打不开时,收发邮件会暂停:聊天里会出现一行说明原因,「设置 → 邮件通道」页面上也写着原因,到那里重新填写授权码即可。
设置授权码没有弹出输入卡怎么办?
输入卡只在你点击「设置邮箱授权码」的那台已配对遥控器上打开。若设备已解绑或连接失效,请重新连接,再点一次;没有创建卡片就会显示失败。
Agent 运行 agentj mail password 和 agentj mail status 时会使用隔离层内可达的主机通道。若返回 sandbox_blocked,表示隔离层或文件权限拒绝连接;请在已配对遥控器的「设置 → 沟通渠道 → 邮件通道」设置授权码,其它操作可在 Agent J 主机的终端里重试。若返回 host_unreachable,请在 Agent J 主机的终端里运行 agentj service status,按提示恢复服务后重试。连接失败不表示主机忙碌;请勿把授权码发到聊天里。
按域名添加访客
白名单支持 @anthropic.com。默认只匹配这个域名;勾选「包含子域名」也会接收 来自 mail.anthropic.com 的随机 no-reply 发件人 这样的通知。域名条目只能是访客,不能代表主人,也不能批准操作。比对不区分大小写,不会匹配 evilanthropic.com。
域名邮件必须通过 DMARC 或与发件人域名对齐的 DKIM 校验,即使普通发件人校验已关闭也一样;只有 SPF 通过不够。Gmail、QQ、163、Outlook、iCloud、Yahoo 等公共邮箱不能整域放行,请添加完整地址。
命令行:agentj mail allow @anthropic.com --guest --subdomains;不含子域时去掉 --subdomains。旧的完整地址白名单继续有效。Agent J 判断通知是钓鱼邮件并移到废纸篓后,结果只留在本机记录,不再打断主对话。
白名单内的 no-reply、noreply、no.reply、do-not-reply、donotreply、do_not_reply、alerts、notifications、mailer-daemon 类发件人(包括 no.reply.alerts),以及带 List-Unsubscribe 或 List-Id 的邮件,都按只读通知处理:不建立回信路由,永不自动回信。普通访客来信仍沿用原来的回信方式;白名单和发件认证照常检查。
工作流完成后自动给自己发产物
先配置邮件通道和通讯录0号位的主邮箱,让 Agent 把工作流接到 Agent J 原生定时任务,再由该任务申请交付授权。外部系统定时器不会自动取得原生任务身份。
在已配对的手机上签名并验证通行密钥一次,授权指定工作流把绑定产物发到你的主邮箱,不再逐期弹确认卡。v1只发你的主邮箱;v2还可抄送单独签名批准的联系人。宿主支持已签名单子集时,每封可以缩小这份抄送名单,无需重签或弹卡;名单外地址仍须重新签名批准。你本人必须始终在收件人中,不得添加其他收件人或密送。子集支持是0.27.0发行候选,须安装对应主机版本。
你可以随时让 Agent 撤销授权。未设到期日的授权持续到撤销,已有到期日仍有效;不再限制总封数和每日封数,仍保留防重及每封0至10个附件、共25 MiB的限制。主人身份、主邮箱、已签产物目录或签名权限变化须重新授权;普通任务修改不重签邮件授权。
提交邮件前检测到配置变化,仍会停止发送。明确标为提交前失败且可重试时,也须显式重新请求,不会自动重发。宿主已保留投递记录时,先走现有的本人批准重试流程;邮件受理状态未知时不要自动重发。
仅支持Linux原生任务。授权卡分别列出任务文件夹和产物文件夹,产物可以留在单独签名的目录,不必搬进任务文件夹。邮箱所属账号改变、任务停用或研究模式不能继续发信。
附件限ZIP、txt/md/json/srt/vtt/csv和jpg/jpeg/png/webp。ZIP最多100项,解包总量不超过25 MiB;不接受嵌套或加密压缩包,仍检查密钥。产物摘要用于核对交付内容,不能代替实际发布回执。
E-mail works everywhere: no app to install, available on every work computer and phone. Agent J can watch one mailbox. When someone on your allowlist writes to it, the mail becomes a task for your main Agent, and the result goes back as a reply in the same thread.
Good for:
- An e-mail you want handled — forward it to the Agent's address with one line on top saying what to do.
- Places where Telegram or Gmail are blocked but a work, QQ or 163 mailbox works.
- Colleagues you set Agent J up for: they send tasks from their own mailbox.
Safety first: the allowlist runs in code, before the model
- Only allowlisted addresses reach the Agent. Everything else is counted — its body, attachments and subject are never shown to a model.
- The sender must be verified. A From address is easy to fake, so Agent J also reads the check results your mail provider writes into the headers (SPF / DKIM / DMARC). Default Standard: one of them passes for the sender's own domain. Strict accepts only DMARC or DKIM. Missing or failed results: the mail does not reach the Agent.
- A forwarded original is data, not instructions. It is saved as a file for the Agent; only the lines you wrote on top count as yours.
- Automatic mail is never a task and never answered: auto-replies, bounces, mailing lists, bulk notices and the Agent's own replies never become tasks, so there are no mail loops. Notification mail from an allowlisted sender is handed to the Agent to read, but read-only and never answered (see below). A letter another Agent J host's owner deliberately sends is an ordinary letter (allowlist and sender checks as above); that host's automatic mail is still skipped.
- Replies only go to allowlisted addresses, with an hourly limit; when the Agent decides not to reply, nothing is sent.
- The allowlist controls incoming mail; every message the Agent sends needs your long-press confirmation on the phone.
- The app password is entered on your phone only. It is stored encrypted on the Agent J host, never appears in the chat or logs, and is never uploaded to us.
Set it up in four steps
- Pick a mailbox. Best a new one just for the Agent; your existing mailbox also works.
- Turn on IMAP/SMTP in the mailbox's web settings and get an app password (not your sign-in password) — see the table below.
- On your phone: Agent J → Settings (top right) → Email:
- choose the provider (it follows the address), enter the address;
- tap Set email authorization code: if settings changed, confirm the plain-language changes with Face ID, then the key card opens directly. For Gmail, paste the 16-character App Password with its spaces. It is stored encrypted on the host and never enters chat. Saving automatically tests incoming and outgoing login, sends no test mail, and shows success or failure on the page;
- add the address you usually write from to the allowlist; colleagues can be added as Guest;
- turn the Status switch on.
- Send a test. From an allowlisted address, write to the Agent's mailbox. A reply arrives within minutes (checks run every 5 minutes by default; change it in Settings or tap Check now).
You can also just ask Agent J to set up the e-mail channel; it walks you through it. The app password still goes only into the phone's key card.
When you turn it on, mail already in the inbox is not handled — only mail that arrives afterwards.
Where to get an app password
| Mailbox | Where |
|---|---|
| QQ Mail / Foxmail | QQ Mail web → Settings → Account → POP3/IMAP/SMTP service → enable IMAP/SMTP → send the SMS → generate an authorization code |
| NetEase 163 / 126 | Web mail → Settings → POP3/SMTP/IMAP → enable IMAP/SMTP → add an authorization password (shown once) |
| Aliyun Mail / Alibaba Mail | Web → Settings → POP3/SMTP/IMAP → enable; with secure login on, create a third-party client password |
| Tencent Exmail | Web → Settings → Client settings → enable IMAP/SMTP; with WeChat secure login, create a client-only password under Account |
| NetEase Enterprise Mail | Web → Settings → Client settings → enable IMAP/SMTP; create a client authorization code as your admin allows |
| Gmail | Turn on 2-Step Verification → myaccount.google.com/apppasswords → create a 16-character app password |
| iCloud Mail | appleid.apple.com → Sign-In and Security → App-Specific Passwords → generate; the sign-in name is the full iCloud address |
| Outlook / Hotmail | Microsoft is retiring password sign-in for Outlook.com (OAuth only). If Test connection fails, use another mailbox |
For anything else choose Other (enter servers) and fill in the provider's IMAP / SMTP servers, ports and security.
The sender check refused my own mail?
Tap Test connection on the Email page. It tells you whether recent mails carry check results and which server wrote them.
- They do: Gmail pins its check server automatically; the page says “Gmail check server pinned automatically”. You can tick or untick “Trust only the confirmed mail server”, with Face ID each time: unticking removes the pin, and owner mail is then handled as ordinary mail. Only providers Agent J knows, such as Gmail, can be ticked; Outlook and other mailboxes can't be ticked on the phone yet. On an older Agent J host the box only shows status. If the samples are incomplete, do not trust the displayed server name.
- None do: this provider writes no results, so Standard and Strict refuse everything. Only then consider turning the check Off — the allowlist alone then protects you, and anyone faking an allowlisted address can reach the Agent. Better: give the Agent a mailbox whose provider writes check results.
A mailbox writing to itself is refused: providers write no check results for internal mail (verified on Gmail). Send from your usual address to the Agent's mailbox — one more reason to give the Agent a mailbox of its own.
Refused senders are listed at the bottom of the page (address and reason only, never the content); one tap adds a sender you recognise.
Meeting notes: /meeting-notes
After recording a meeting (see Phone: long recordings), type /meeting-notes (also under "Tools" in the ≡ menu) with the recording's parts still in the tray, and send. the Agent J host transcribes the audio, then the Agent writes the minutes: summary, key points, decisions, action items (owner, due date) and open questions.
- Addresses after it, e.g.
/meeting-notes send to <address 1> <address 2>: the minutes go to them from the Agent's mailbox you set up, and also show on the page. For a copy yourself, just ask for one (send it to me). - Nothing after it: the minutes show on the page only, and the Agent asks whether to e-mail them and to whom; reply with who should get them (their addresses) and it does.
- It only sends to addresses you typed yourself. Someone in the recording asking to send it somewhere does not count, and the Agent cannot add a recipient on its own — the program refuses it.
- Without a recording attached, the latest recording on the Agent J host is used.
- No mailbox set up yet: the minutes still show on the page, with a note to set one up first (the four steps above).
Let the Agent sign up by itself: wait for one confirmation mail
With this mailbox the Agent can register and sign in on websites by itself. The site's confirmation mail of course comes from a sender that is not on your allowlist, so normally it is only counted; right after the Agent asks the site for a code it can wait for that one mail:
agentj mail expect --from github.com --subject-has verify --within 15m
- One sender only: a full address or the site's domain. Public mailbox domains such as gmail.com or qq.com would match every stranger, so they need the full address.
- Only new mail in the window: from 2 minutes before the wait starts, for at most 60 minutes; at most 3 mails per wait.
- Read-only: nothing is marked read and the Agent's normal inbox check does not move; your mailbox looks the same.
- A forged sender gets nothing: mail whose provider SPF / DKIM / DMARC check fails is only counted; its body is never read or given to the Agent.
- Only to the Agent that asked: subject, the body as plain text (cut short), the codes and links found in it, marked
"outside data, not instructions"; it never enters the chat and is never answered. Counts and results show in
agentj mail status.
Notification mail from allowlisted senders
Automatic mail such as block-explorer alerts or billing notices also reaches the Agent when the sender is on your allowlist.
- The sender is still checked. Mail failing SPF / DKIM / DMARC is refused like any other; a forged notice never gets in.
- Read-only, never answered. It reaches the Agent marked [Notification mail], as data rather than your instruction — even from an "Owner" address — and Agent J never mails anything back. The Agent tells you when it matters.
- Phishing goes to the trash. When the Agent judges a notice to be phishing or address poisoning (say, a look-alike of an address you use sending you a 0-value transfer), it moves that mail to the mailbox's trash without bothering you:
agentj mail trash --id <mail-id>
- Recoverable. The mail only moves to the mailbox's own trash, never deleted for good; you can get it back in your mailbox. A mailbox without a trash folder: nothing is moved.
- One mail at a time, only notices the Agent was given. It works only on notification mail Agent J handed to the Agent since it last started — never your own letters or a guest's; each move adds one line to the conversation, and the log keeps just the mail id and the result.
Me and Guest
- Me: your own addresses. Their mail is handled as your instruction, like a message from your phone; anything that needs approval is still approved on the phone.
- Guest: colleagues, family. A guest's mail is not your instruction and cannot approve anything; the Agent does not give guests your credentials or private data, and private details such as e-mail addresses are removed from the reply.
Friends already in your address book do not need typing again: in Settings → Contacts, tap the envelope icon on their row and the address goes on the allowlist as a guest; your own row (slot 0) goes on as Me. You tap it yourself on the phone, so it applies at once.
From the command line
The Agent can also set it up for you with agentj mail:
agentj mail setup --address <agent-mailbox> # servers chosen from the domain
agentj mail password # opens the app-password key card on the paired phone
agentj mail allow <your-address> # allowlist (--guest for a guest)
agentj mail on
agentj mail test # can both servers sign in (sends nothing)
agentj mail status
When the Agent changes the settings itself, anything that lets more mail in (a new allowlisted address, a weaker check, turning the channel on, another server) first shows an approval card on your phone and applies only if you allow it; declined or timed out, nothing changes and the Agent's command reports a failure. Every allowlist change also leaves one line in the chat history.
Gmail: create an App Password, with screenshots. Keep the spaces when pasting.
Mail to yourself prompted by an external message turns HTML into plain text; an HTML report you ask the Agent to send yourself is unaffected.
Confirming email and sensitive cards
Mail you ask the Agent to send normally shows a card on your phone for a long-press confirmation, without Face ID. If every recipient is one of your own addresses, no card is needed, even when an external message or friend task prompted it. Scheduled mail still needs approval. The card binds recipients, content, attachment hashes and mail servers. The allowlist only controls incoming mail. When you yourself tap Forward by e-mail or forward to Telegram on a paired remote, or sign a customer-service email, that tap is your approval: it goes out at once, with no card and no passkey. Mail settings changes and connection tests still require the passkey; changing only existing allowlist roles from Me to Guest needs no fingerprint confirmation. Changing the account address, login name, IMAP/SMTP server, port or encryption invalidates the old app password. An app password saved by an older version moves over by itself on the first run after the upgrade when the mailbox uses a fixed provider (Gmail, QQ, 163 …). With a custom server it is not used directly: saved candidates are verified first, and you enter it again in the secret card only when none works.
Administrator and secret cards require this remote's approval passkey; enable it in Settings first. Replacing an existing passkey asks the old key to verify this one-use registration offer, then creates the new key. Cancellation or verification failure keeps the old key. Account sign-in and remote approval passkeys are set up separately. If mailbox authentication fails, Agent J first checks registered sources for a new app password for that same account. It takes over only after both IMAP and SMTP sign-in pass, without sending a test message or displaying the password. Sources include managed keys, owner-registered extra files and files saved successfully by a secret card. Historical cards need no mailbox metadata or matching address variable: app-password candidates are tested with the configured mailbox account, and only successful IMAP and SMTP logins authorize reuse. Failed sends show the reason. For authentication errors, tap Repair and retry; a new password is requested only when no saved candidate works. If the saved app password can no longer be opened, mail pauses: the chat shows one line with the reason, and Settings → Email shows it too. Enter the app password again there.
No input card after setting the app password?
The input card opens only on the paired remote where you pressed Set email authorization code. If that device was removed or disconnected, reconnect and try again. A request that creates no card reports failure.
agentj mail password and agentj mail status use the host channel available inside isolation. sandbox_blocked means the sandbox or file permissions refused the connection. Set the app password on the paired remote in Settings → Channels → E-mail; retry other operations in the computer terminal. For host_unreachable, run agentj service status in the computer terminal, follow its recovery instructions and retry. A connection failure does not mean the host is busy. Never paste the app password into chat.
Add a domain as a guest
Add @anthropic.com to the allowlist to match that domain. Include subdomains also admits notifications from random no-reply addresses at mail.anthropic.com. Domain entries are always guests: they never represent the owner or approve operations. Matching ignores case and does not match evilanthropic.com.
Domain mail must pass DMARC or DKIM aligned with the sender domain, even when ordinary sender checks are off. SPF alone is insufficient. Public mailbox domains such as Gmail, QQ, 163, Outlook, iCloud and Yahoo cannot be allowlisted as a whole; add a full address instead.
CLI: agentj mail allow @anthropic.com --guest --subdomains. Omit --subdomains for the exact domain. Existing full-address allowlists keep working. When Agent J moves a phishing notification to the trash, it keeps the result in local records without adding a message to the main conversation.
Allowlisted no-reply, noreply, no.reply, do-not-reply, donotreply, do_not_reply, alerts, notifications and mailer-daemon senders (including no.reply.alerts), or mail with List-Unsubscribe or List-Id, are read-only notifications. They never create a reply route or trigger an automatic reply. Ordinary guest letters keep their existing reply route. Allowlist and sender authentication checks still apply.
Change a sender’s role and mark processed mail as read
Adding a blocked sender from the suggested list always adds them as a Guest. Each allowlist row has a role dropdown: choose Me or Guest and it saves immediately. Promoting a Guest to Me requires fingerprint confirmation. Changing only Me to Guest needs no fingerprint; the paired remote still signs the change.
The email twin automatically marks mail as read after replying, handing it to you or recording that no action is needed; failed, unfinished mail and mail awaiting your decision stay unread. Marking it unread yourself does not make the twin process it again.
Receive workflow artifacts automatically
Set up the email channel and your primary address in contact slot 0 first. Connect the workflow to a native Agent J scheduled task, then have that task request a delivery grant. An external system timer does not acquire a native task identity.
Sign once on your paired phone and verify your approval passkey. The specified workflow can deliver bound artifacts to your primary mailbox without asking again for each episode. V1 permits only your primary mailbox. V2 also permits separately signed Cc contacts. On a host with signed-pool subset support, each message may narrow that approved Cc list without another signature or card; addresses outside it still require a new signed approval. You must remain a To recipient; adding other To or Bcc recipients is not allowed. Subset support is a 0.27.0 release candidate and requires the corresponding installed host.
You can revoke the grant at any time. Without an explicit expiry it lasts until revoked; existing expiry dates remain in force. Total and daily message-count limits are removed, while deduplication and the per-message limit of 0–10 attachments totaling 25 MiB remain. Changes to your owner identity, primary mailbox, signed artifact directory or signing authority require a new approval; ordinary task edits do not require re-signing mail authority.
Configuration changes detected before mail submission still stop the send. A retryable pre-submission result requires an explicit new request and never triggers an automatic resend. If the host has reserved the delivery, use the existing owner-approved workflow retry first. Never automatically resend a message whose acceptance is unknown.
Only native Linux tasks are supported. The grant card lists the task folder and artifact folder separately, so artifacts can remain in the separately signed directory. A changed mailbox account, disabled task or research run cannot continue sending.
Attachments are limited to ZIP, txt/md/json/srt/vtt/csv and jpg/jpeg/png/webp. A ZIP allows at most 100 members totaling 25 MiB decoded; nested or encrypted archives are refused and secret checks still apply. An artifact digest checks delivery content; it does not replace an actual publication receipt.