LM

leeguooooo/mail-use

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

47 stars 8 forks Качество 84 Тренд 27MIT

Электронная почта для агентов ИИ — читать, искать, отправлять и сортировать Gmail / QQ / 163 / любой IMAP от CLI или MCP. Часть семьи *-use.

Обзор

Один CLI через Gmail, QQ, 163, Outlook и любой IMAP / SMTP-бокс — каждая команда говорит JSON, каждая разрушительная работает до тех пор, пока вы не пройдете — подтвердите. Часть семьи — это небольшие инструменты, которые каждый дает агенту в руки одну реальную вещь. Каждый ответ имеет успех: boolean, а сбои несут код ошибки из фиксированного набора (auth failed, folder not found, imap error, ...). Задокументированный в docs/CLI JSON CONTRACT.md. - Cached читает отчет от cache, cache age seconds и cache stale, а снимок, достаточно старый, чтобы означать «ничто не синхронизируется», отклоняется в пользу живого вывода. Пустой почтовый ящик никогда не является молчаливым «ничего не прибыло». Удалите / пометьте / переместите / отправьте назад сухой предварительный просмотр - сгруппированный по учетной записи и папке с образцами предметов - и ничего не меняйте, пока - не подтвердите. Все папки пропускают Sent/Drafts/Junk/Trash без запроса.

Обзор (машинный перевод)

Электронная почта, как что-то, что агент ИИ может реально работать. Один CLI через Gmail, QQ, 163, Outlook и любая коробка IMAP/SMTP — каждая команда говорит о JSON, каждая разрушительная Один из них – сухой, пока вы не пройдете.

Часть семейства *-use — небольшие инструменты, которые каждый даёт агенту Руки на одну реальную вещь.

Почему это, а не фрагмент IMAP

Стабильный контракт с JSON, а не сорванный текст. Каждый ответ несет [[Т2]] и неисправности несут [[Т3]] из фиксированного набора [[Т4]], [[Т5]], [[Т6]], … Документировано в [[Т7]]. **Это говорит вам, когда это может быть неправильно. ** В кэше читается сообщение from_cache, cache_age_seconds и cache_stale, и снимок достаточно старый, чтобы означать «ничего». «Синхронизация» отклоняется в пользу живого приёма. Пустой ящик никогда не бывает тихим “Ничего не прибыло”. ** Разрушительный только по согласию. ** delete / mark / move / send сухой предварительный просмотр - сгруппированный по учетной записи и папке, с образцами предметов - и изменить --confirm --all-folders пропускает Sent/Drafts/Junk/Trash, если только его не спросят. **Построен для бюджетов токенов. ** --format compact Проектирует каждое электронное письмо к десяти

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

mail-use

Email, as something an AI agent can actually operate. One CLI over Gmail, QQ, 163, Outlook and any IMAP/SMTP box — every command speaks JSON, every destructive one is dry-run until you pass --confirm.

mail-use code --json          # the newest verification code, one live pass
mail-use email recent --format compact --json
mail-use email delete --from [email protected] --confirm --json

Part of the *-use family — small tools that each give an agent hands on one real thing.

Why this and not an IMAP snippet

  • A stable JSON contract, not scraped text. Every response carries success: boolean, and failures carry error_code from a fixed set (auth_failed, folder_not_found, imap_error, …). Documented in docs/CLI_JSON_CONTRACT.md.
  • It tells you when it might be wrong. Cached reads report from_cache, cache_age_seconds and cache_stale, and a snapshot old enough to mean “nothing is syncing” is refused in favour of a live fetch. An empty inbox is never a silent “nothing arrived”.
  • Destructive by consent only. delete / mark / move / send return a dry-run preview — grouped per account and folder, with sample subjects — and change nothing until --confirm. --all-folders skips Sent/Drafts/Junk/Trash unless asked.
  • Built for token budgets. --format compact projects each email to the ten fields worth scanning (~30% smaller than the full shape), --with-preview folds a body snippet into the list call, and batch show reuses one IMAP connection.
  • Fast enough to call in a loop. A persistent daemon pools IMAP connections and syncs to local SQLite in the background: five sequential email list calls go from 25s to 0.83s. See the table below.
  • MCP too. mail-use mcp config --json prints a paste-ready entry; the server exposes 16 tools with the same dry-run defaults.

Renamed from Mailbox to mail-use. The command is now mail-use; mailbox still works as an alias, and your config in ~/.config/mailbox is untouched.

Supported providers

163 / 126 · QQ · Gmail · Outlook / Hotmail · any custom IMAP+SMTP server.

Search behaves differently per provider and the CLI says so: Gmail searches bodies server-side via X-GM-RAW, while QQ/163/Outlook have broken IMAP TEXT search, so --query falls back to matching subject + sender only. Use --from / --subject there for predictable results.

Install

One line, no npm, no Node

curl -fsSL https://raw.githubusercontent.com/leeguooooo/mail-use/main/install.sh | sh
mail-use --help

Downloads the prebuilt binary for your platform (macOS arm64/x64, Linux x64/arm64) from the latest GitHub Release, verifies its checksum, and installs to ~/.local/bin. Pin a version with MAIL_USE_VERSION=v2.11.2, or

Открыть полный README на GitHub

Установка

npx skills update mail-use` for you to run).
Новичок в MCP? Начните с руководства на mcpskill.org →