huaxiren6/DSH-EmailReader ↗★ 1
dsh-email-reader
OAuth2-capable IMAP email reader for DeepSeek Harness: list/read/search mail for accounts where password auth is disabled (Outlook post-2024), with automatic token refresh, app-password Gmail via optional proxy, and ol_email_* tools that coexist with the market dsh-email plugin.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:huaxiren6/DSH-EmailReader说明文档
阅读完整 README ↗配置
方式一: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}),一个插件可访问多个邮箱。