OAuth2-capable IMAP email reader for accounts where password authentication is disabled. Microsoft disabled Basic Auth for personal Outlook IMAP in 2024, so this plugin authenticates via refresh-token OAuth2 (XOAUTH2) with automatic token refresh, plus app-password login for Gmail through an optional local HTTP/SOCKS proxy. Registers list/read/search as ol_email_* so it can coexist with the market dsh-email plugin without tool-name clashes.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:huaxiren6/DSH-EmailReader
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
✉️ DSH-EmailReader

DeepSeek Harness IMAP 邮件读取插件(OAuth2 版)
基于 imapflow 连接任意 IMAP 邮箱,让模型具备读邮件的能力。
简介
给 DeepSeek Harness 提供三个模型可调用的邮件工具:列邮件、读全文、服务端搜索。支持多账号、OAuth2 与代理。
npm 包名
dsh-email-reader(dsh-email已被其他作者占用)。
解决的实际问题
微软从 2024 年 9 月起停止了对个人 Outlook.com 账号 IMAP 的基本认证(用户名+密码,含应用密码),只接受 OAuth2。 市面上多数邮件插件(含市场版 dsh-email)仍只支持密码登录,导致 Outlook 账号无法读取。本插件补上了这个缺口:
- 🔐 OAuth2 / XOAUTH2:
refreshToken + clientId自动换取 access token,无需手动授权,微软禁用密码认证的账号也能读 - 🌐 HTTP/SOCKS 代理:教育网 / 企业网直连 Google 被屏蔽时,可指定本地代理(如
http://127.0.0.1:7892)访问 Gmail - 🧩 与市场版 dsh-email 共存:工具注册为
ol_email_*(ol = Outlook)前缀,不与市场版的email_*撞名,两个插件可同时安装——市场版管 Gmail,本插件管 Outlook
功能特性
- ✉️
ol_email_list— 列出收件箱最近邮件(发件人 / 主题 / 时间 / 旗标) - 📄
ol_email_read— 读取单封邮件全文(含正文,自动解析 MIME,兼容 Outlook 服务器) - 🔍
ol_email_search— 服务端 IMAP 全文搜索,最新优先 - 👥 多账号:
accounts[]配置,account参数切换 - 🔐 OAuth2:refreshToken + clientId 自动换 access token(Microsoft / 任意端点)
- 🌐 可选 HTTP/SOCKS 代理(教育网 / 企业网访问 Google 等被屏蔽服务时使用)
- 🛡️ 全部工具返回
{ ok, ... },绝不抛异常,配置错误不会拖垮宿主
安装
dsh plugin --profile web add dsh-email-reader
配置
方式一:OAuth2(推荐,Outlook 等强制 OAuth 的邮箱)
- insert:
- id: email-reader
name: dsh-email-reader
config:
accounts:
- id: outlook
host: outlook.office365.com
port: 993
user: you@outlook.com
refreshToken: "从 OAuth 授权流程获取"
clientId: "你的应用 Client ID"
tokenUrl: "https://login.microsoftonline.com/common/oauth2/v2.0/token"
mailbox: INBOX
方式二:密码 / 应用专用密码
- insert:
- id: email-reader
name: dsh-email-reader
config:
host: imap.example.com
port: 993
user: you@example.com
pass: your-app-password
tls: true
mailbox: INBOX
方式三:环境变量(凭据不落盘)
| 环境变量 | 含义 | 默认 |
|---|---|---|
DSH_IMAP_HOST |
IMAP 服务器(必填) | — |
DSH_IMAP_PORT |
端口 | 993 |
DSH_IMAP_USER |
用户名 | — |
DSH_IMAP_PASS |
密码 / App 专用密码 | — |
DSH_IMAP_TLS |
是否 TLS | true |
DSH_IMAP_MAILBOX |
默认邮箱 | INBOX |
DSH_IMAP_OAUTH_REFRESH |
OAuth refresh token | — |
DSH_IMAP_CLIENT_ID |
OAuth client id | — |
DSH_IMAP_TOKEN_URL |
OAuth token 端点 | — |
DSH_IMAP_PROXY |
代理地址(如 http://127.0.0.1:7892) |
— |
走代理访问 Gmail 的示例
- insert:
- id: email-reader
name: dsh-email-reader
config:
accounts:
- id: gmail
host: imap.gmail.com
port: 993
user: you@gmail.com
pass: your-app-password
proxy: "http://127.0.0.1:7892"
mailbox: INBOX
使用示例
对模型说:
- 「看下收件箱最近 5 封邮件」→
ol_email_list - 「读第 12 封邮件的内容」→
ol_email_read - 「搜一下主题里含 'invoice' 的邮件」→
ol_email_search
每个工具都支持可选的 connection 覆盖对象({host, port, user, pass, tls, mailbox}),一个插件可访问多个邮箱。
License
Links
More in this category
DayuanJiang/next-ai-draw-io#dsh-plugin★ 36749
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
Tencent/WeKnora#dsh-weknora★ 36302
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
superdesigndev/treg★ 7042
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 5074
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
sixtysevenlf/dsh-blender-plugin★ 1575
Lets a DSH agent drive a local Blender over a direct TCP channel with 15 tools: viewport frames, custom-angle renders, Python execution, headless and job offload, transaction rollback, and a planning layer of 228 ops across 34 families.
TencentCloudBase/CloudBase-AI-Toolkit#dsh-plugin★ 1155
Tencent CloudBase backend for DeepSeek Harness — scaffold and deploy full-stack apps from chat, render query results as table cards with paging, sorting and CSV export, preview a deployment on its domain, and call the CloudBase MCP toolset (`mcp__cloudbase__*`) with device-code login.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.