LM

lucasmaffei/mailgrant

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

1 stars 0 forks 质量 56 趋势 16NOASSERTION

自托管的电子邮件MCP服务器和IMAP/SMTP网关用于AI代理:每个代理拥有一个令牌,拥有自己的邮箱和范围,有审计日志,并有通行密钥网页邮件PWA。

概览

AI代理的自托管邮件网关。每个代理都有自己的令牌、邮箱和权限。邮箱密码会保留在你手中。 英语 ·葡萄牙语 ·西班牙语 ·法语 ·简体中文 没有网关,每个接触邮件的代理(Claude、Codex、OpenClaw、你自己的脚本)都会保存每个邮箱密码的副本。使用 Mailgrant 时,你注册每个邮箱,每个代理都会获得一个令牌,只打开你选择的邮箱和操作。代理使用 MCP 或 REST,每次通话都会被检查和记录。 你需要一台带 Docker 的机器,并且至少有一个邮箱的 IMAP/SMTP 详细信息(最好有应用密码)。 配置包含两个列表:(网关能访问什么)和(谁可以使用哪个邮箱以及用于什么)。 它打印令牌,你给代理,以及哈希值,放在配置里。令牌只显示一次,且不会存储在任何地方。 放在旁边,这样配置就没有秘密: 它会显示谁可以接触什么,或者具体哪里出了问题:

概述(AI 翻译)

邮赠

AI代理的自托管邮件网关。 每个代理都有自己的令牌、邮箱和权限。邮箱密码会保留在你手中。

英语 ·葡萄牙语 ·西班牙语 ·法语 ·简体中文

没有网关,所有接触电子邮件的代理(Claude、Codex、OpenClaw, 你自己的脚本)保存着每个邮箱密码的副本。用Mailgrant 每个邮箱注册一次一次,每个代理都会获得一个仅能打开 邮箱和你选择的行动。特工们会说话 MCP或REST,每个通话都会被检查和 记录。

安装: 1.获取它 ·2. 配置 ·3. 运行 ·4. 连接代理 使用: 日常 ·网页应用 ·文档

1.拿到它

你需要一台带 Docker 的机器,并且至少有一台的 IMAP/SMTP 详细信息 邮箱(最好用应用密码)。

2.配置

配置包含两个列表:邮箱(网关能访问的地址)和 代理人(谁可以使用哪个邮箱,以及用于什么)。

为你的第一位经纪人创建一个代币:

它打印出令牌,你给代理,以及它的哈希值,哈希值被放入 配置。令牌只显示一次,且没有存储在任何地方。

**替换’config.“的内容。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

mailgrant

The self-hosted email gateway for AI agents. Each agent gets its own token, its own mailboxes and its own permissions. The mailbox passwords stay with you.

English · Português · Español · Français · 简体中文

Without a gateway, every agent that touches email (Claude, Codex, OpenClaw, your own scripts) holds a copy of every mailbox password. With mailgrant you register each mailbox once, and each agent gets a token that opens only the mailboxes and actions you chose. Agents talk MCP or REST, and every call is checked and logged.

Install: 1. Get it · 2. Configure · 3. Run · 4. Connect an agent Use: Day to day · The web app · Documentation

1. Get it

You need a machine with Docker, and the IMAP/SMTP details of at least one mailbox (an app password is best).

git clone https://github.com/lucasmaffei/mailgrant && cd mailgrant
cp config.example.yaml config.yaml

2. Configure

The config holds two lists: mailboxes (what the gateway can reach) and agents (who may use which mailbox, and for what).

Create a token for your first agent:

docker compose run --rm mailgrant mailgrant token --name support-bot

It prints the token, which you give to the agent, and its hash, which goes in the config. The token is shown only once and isn’t stored anywhere.

Replace the contents of config.yaml with your mailbox and that agent:

mailboxes:
  - name: contact
    imap: {host: mail.example.com, username: [email protected], password: "${CONTACT_PASSWORD}"}
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →