跳到正文Skip to content
Agent J Beta
菜单Menu
中文EN
登录Sign in

搜索文档和页面Search docs and pages

文档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;做完了,用邮件回到同一个线程。

适合这些情况:

  • 收到一封邮件,想让 Agent 处理——直接转发给 Agent 的邮箱,在最上面写一句要它做什么。
  • 在大陆用不了 Telegram、Gmail,但公司邮箱、QQ 邮箱、163 都能用。
  • 帮同事配好 Agent J,他们用自己的邮箱就能派活。

先说安全:白名单在程序里,模型之前

  • 只有白名单里的地址发来的信才会交给 Agent。不在白名单的信只计数,正文、附件、标题都不会给模型。
  • 发件人要能被验证。 发件地址很容易冒充,所以 Agent J 还会看你的邮箱服务商写在信头里的校验结果(SPF / DKIM / DMARC):默认是标准级别:任一项通过、而且域名对得上;严格级别只认 DMARC 或 DKIM。校验没有或没通过,同样不交给 Agent。
  • 转发的原文是数据,不是指令。 你转发来的那封信会另存成一个文件交给 Agent,只有你自己在最上面写的那几句算你的话。
  • 自动邮件不处理、也不回: 自动回复、退信、邮件列表、群发通知,以及 Agent 自己发出的回信,都不会变成任务,不会形成邮件循环。
  • 只回白名单里的地址,每小时有上限;Agent 选择不回复时,什么也不发。
  • 白名单是双向的: 白名单里的人发来的信会直接处理,Agent 给他们发信也不用你再确认;给白名单以外的人发信,每次都要你在手机上确认。所以只把信得过的人加进来——加进来以后,Agent 可以不经你确认给他发信。
  • 授权码只在手机上填。 它加密保存在你的电脑上,不会出现在聊天、日志里,也不会上传到我们这里。

四步开通

  1. 准备一个邮箱。 建议给 Agent 专门注册一个,比如新开的 163 或 QQ 邮箱,当然用你现有的也行。
  2. 在邮箱网页里打开 IMAP/SMTP,拿到授权码。 注意,授权码不是登录密码,具体怎么拿见下一节。
  3. 在手机上打开 Agent J → 右上角设置 → 邮件通道:
    • 选邮箱服务商(填了地址会自动选好),输入邮箱地址,点「保存」;
    • 点「设置邮箱授权码」:手机上会弹出一张密钥卡,把授权码填进去。电脑加密保存后会自动测试 IMAP/SMTP 连接,但不发信;测试结果会显示在页面上;
    • 在白名单里加上你自己常用的邮箱。同事的邮箱可以加成「访客」;
    • 打开「状态」开关。
  4. 发一封试试。 用白名单里的邮箱给 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;按管理员规定生成客户端授权码
GmailGoogle 账号先开两步验证 → 打开 myaccount.google.com/apppasswords → 生成 16 位「应用专用密码」
iCloud 邮件appleid.apple.com → 登录与安全 → App 专用密码 → 生成;登录名填完整的 iCloud 邮箱地址
Outlook / Hotmail微软正在关闭 Outlook.com 的密码登录(只允许 OAuth)。如果「测试连接」失败,请换一个邮箱

其他邮箱选「其他邮箱(手动填写)」,按服务商给的 IMAP / SMTP 服务器、端口和加密方式填写。

发件人校验挡下了我自己的信?

在邮件通道页点「测试连接」,页面会告诉你:最近几封信里有没有校验结果、是哪台服务器写的。

  • 有校验结果:可以点「只认这台服务器写的校验结果」,安全性更高。
  • 一封都没有:说明这个邮箱服务商不写校验结果,标准和严格两档都会挡下所有信。只有这种情况才考虑把校验改成「关闭」——那时只靠白名单,别人冒充白名单里的地址就能把内容交给 Agent。更好的办法是给 Agent 换一个会写校验结果的邮箱。

同一个邮箱自己发给自己会被挡下:邮箱服务商不给内部邮件写校验结果(Gmail 实测如此)。所以请从你平时用的另一个邮箱发给 Agent 的邮箱,这也是我们建议给 Agent 单独注册邮箱的原因。

被挡下的发件人会列在页面最下面(只有地址和原因,没有内容),确认是自己人,点一下就能加进白名单。

会议纪要:/会议总结

录完会(见 手机:长录音),在输入框打 /会议总结(≡ 菜单「工具」里也有),录音各段留在附件栏,直接发送。电脑先把录音转成文字,Agent 再写纪要:概要、要点、决定、待办(负责人、截止时间)、未决问题。

  • 后面写了邮箱,比如 /会议总结 发给 <邮箱1> <邮箱2>:纪要用你配好的 Agent 邮箱发给这些人,页面上也会显示一份。想发给自己,写一句“发我”就行。
  • 什么都没写:纪要只显示在页面上,Agent 会问你要不要发、发给谁;你回一句发给谁(写上邮箱地址),它就发。
  • 只会发给你亲手写的地址。 录音里有人说要发给谁不算,Agent 自己也加不了收件人,程序会直接拒绝。
  • 没附录音时,用电脑上最近一组录音。
  • 还没配邮箱:纪要照样显示在页面上,并提示你先按上面的四步开通。

让 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 不会把你的凭据和私人资料给访客,回信会去掉邮箱地址等私人信息。

朋友的邮箱已经在通讯录里的话,不用再输一遍:在「设置」→「通讯录」里点他那一行右边的信封图标,就加进白名单,身份是「访客」;你自己那一行(0 号位)加成「我本人」。这是你在手机上亲手点的,所以直接生效。

用命令行配置

Agent 在电脑上也能用 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 用户请看 应用专用密码图文帮助,空格不用删,原样粘贴。

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 handled or answered: auto-replies, bounces, mailing lists, bulk notices and the Agent's own replies never become tasks, so there are no mail loops.
  • Replies only go to allowlisted addresses, with an hourly limit; when the Agent decides not to reply, nothing is sent.
  • The allowlist works both ways: mail from people on it is handled directly, and the Agent can mail them without asking you; mail to anyone else needs your confirmation on the phone every time. Add only people you trust — once added, the Agent can write to them without asking.
  • The app password is entered on your phone only. It is stored encrypted on your computer, never appears in the chat or logs, and is never uploaded to us.

Set it up in four steps

  1. Pick a mailbox. Best a new one just for the Agent; your existing mailbox also works.
  2. Turn on IMAP/SMTP in the mailbox's web settings and get an app password (not your sign-in password) — see the table below.
  3. On your phone: Agent J → Settings (top right) → Email:
    • choose the provider (it follows the address), enter the address, tap Save;
    • tap Set email authorization code: a key card opens on the phone; type the app password there. The computer signs in with it automatically after saving it encrypted; no mail is sent;
    • add the address you usually write from to the allowlist; colleagues can be added as Guest;
    • turn the Status switch on.
  4. 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

MailboxWhere
QQ Mail / FoxmailQQ Mail web → Settings → Account → POP3/IMAP/SMTP service → enable IMAP/SMTP → send the SMS → generate an authorization code
NetEase 163 / 126Web mail → Settings → POP3/SMTP/IMAP → enable IMAP/SMTP → add an authorization password (shown once)
Aliyun Mail / Alibaba MailWeb → Settings → POP3/SMTP/IMAP → enable; with secure login on, create a third-party client password
Tencent ExmailWeb → Settings → Client settings → enable IMAP/SMTP; with WeChat secure login, create a client-only password under Account
NetEase Enterprise MailWeb → Settings → Client settings → enable IMAP/SMTP; create a client authorization code as your admin allows
GmailTurn on 2-Step Verification → myaccount.google.com/apppasswords → create a 16-character app password
iCloud Mailappleid.apple.com → Sign-In and Security → App-Specific Passwords → generate; the sign-in name is the full iCloud address
Outlook / HotmailMicrosoft 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: tap Trust only this server's check results for extra safety.
  • 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 computer 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 computer 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.

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.

这一页的 Markdown 原文This page as Markdown: zh.md · en.md