dsh-mail-account
Adds one section to DSH Settings for the accounts of mcp-email-server: see which incoming/outgoing bindings exist, replace a mailbox authorization code, run an IMAP/SMTP test. If the server or its accounts are missing, the same section walks you through setting them up.
Requirements
- A DSH build that publishes the host's local web server (Desktop, or
dsh web). mcp-email-serverinstalled, with at least one account added through its own management page. The Settings section offers a button that opens that page.
mcp-email-server is distributed as PyPI packages (plus a Linux container image); there is no exe or msi installer. uvx mcp-email-server@latest ui runs it without a permanent install, pipx install mcp-email-server installs it, and pip install mcp-email-server works inside a virtual environment. The panel accepts any of those layouts through Change path.
Install
dsh plugin --profile <your-profile> add github:Venpor/dsh-mail-account
Restart DSH, then open Settings → Mail auth code.
Configuration
The CLI path is resolved in this order:
- the plugin row's config,
config: { exe: '...' } - the environment variable
DSH_MAIL_MCP_EXE - a default:
D:\develop\mail-mcp\.venv\Scripts\mcp-email-server.exeon Windows,mcp-email-serverelsewhere
The panel can set the first one for you: Change path, type the full path of the executable. That is the expected case when the server lives somewhere other than the default.
The authorization code
- The browser posts it to
POST /api/mail-account/secret. That route sits on the host's loopback server and rejects non-loopback peers. - The host passes it to
mcp-email-server account set-secret <account> <incoming|outgoing> --password-stdinthrough the child's stdin. - It is stored in the server's own catalog, e.g.
%USERPROFILE%\.config\mcp-email-server\managed.sqlite3.
It never appears in argv, never comes back in a response, never reaches the conversation log, and is not logged by this plugin.
Limits
- Credentials only. Hosts, ports, TLS,
save_to_sentand recipient allowlists stay in themcp-email-servermanagement UI. - A running MCP server may keep the old credential in memory; restart DSH if mail still fails after a successful save. The panel's test talks to the mail server directly, so it tells you whether the code itself is right.
- The default path is Windows-specific; set
exeorDSH_MAIL_MCP_EXEon other layouts.
dsh-mail-account(中文)
在 DSH 的设置里加一节,管理 mcp-email-server 的账号:看收件/发件配没配、重填授权码、测一次 IMAP/SMTP。服务没装或者还没账号时,这一节会直接给出下一步怎么做。
前提
- DSH 带本机 web 服务(Desktop 或
dsh web); - 装好
mcp-email-server,并且已经用它的管理界面加过账号——设置页里有按钮可以直接拉起那个界面。
mcp-email-server 只发 PyPI 包(另有 Linux 容器镜像),没有 exe/msi 安装包。uvx mcp-email-server@latest ui 可以免安装直接跑,pipx install mcp-email-server 装机,虚拟环境里 pip install mcp-email-server 也行。装在哪一种布局下都能用,面板里点「换个路径」指过去即可。
安装
dsh plugin --profile <你的 profile> add github:Venpor/dsh-mail-account
重启 DSH,打开 设置 → 邮箱授权码。
配置
命令行路径按顺序取:插件行的 config.exe → 环境变量 DSH_MAIL_MCP_EXE → 默认值(Windows 是 D:\develop\mail-mcp\.venv\Scripts\mcp-email-server.exe,其它平台是 mcp-email-server)。
第一项可以在面板里直接设:点「换个路径」,填可执行文件的完整路径。装到别处的情况走这里。
授权码怎么走
- 浏览器提交到本机
POST /api/mail-account/secret,这个路由只挂在回环地址上; - Host 通过子进程 stdin 交给
mcp-email-server account set-secret <账号> <incoming|outgoing> --password-stdin; - 落到它自己的账号库,例如
%USERPROFILE%\.config\mcp-email-server\managed.sqlite3。
不进命令行参数、不回传浏览器、不进会话记录,插件也不留任何凭据。
限制
- 只管凭据。收发服务器、端口、TLS、
save_to_sent、收件人白名单仍在mcp-email-server的管理界面里改。 - 正在跑的 MCP 服务可能还拿着旧凭据;保存成功但收信仍失败时重启 DSH。页面上的「测试」直接连邮件服务器,能先确认授权码本身对不对。
- 默认路径是 Windows 的,别的位置请设
exe或DSH_MAIL_MCP_EXE。
No comments yet. Be the first to write one.