Preface¶
DeepSeek Harness (DSH) uses a plugin architecture. Handling email typically requires calling third-party APIs or writing scripts. The zhengjy01/dsh-qqmail plugin integrates IMAP/SMTP protocol capabilities directly into DSH, allowing agents to read and write mailboxes without an additional middle layer.
Plugin Introduction¶
This is a DSH plugin designed for QQ Mail (and any IMAP/SMTP mailbox). It provides qqmail_* agent tools, a qqmail command-line tool, a qqmail-mcp stdio MCP server, and a Web configuration panel. Authentication uses a QQ Mail authorization code (no OAuth, no 2FA redirect).
Core Features¶
The plugin provides full IMAP/SMTP mailbox operation capabilities, divided into read-only and read-write tool categories:
- Read-only tools:
status(status check),config(configuration),folders(folder list),list(mail list),search(search),read(read full text),attachment(download attachments). - Read-write tools:
send(send),reply(reply),mark(mark/star),move(move),delete(delete). - Additional components: Web configuration panel, terminal CLI, and MCP stdio server.
Installation and Configuration¶
Install the plugin using the official CLI:
dsh plugin --profile web add github:zhengjy01/dsh-qqmail
After installation, restart dsh web, and you can see the QQ Mail card in the settings.
To configure the mailbox, first enable IMAP/SMTP services on the QQ Mail web interface and obtain the 16-character authorization code. Then use the configuration tool to set it:
qqmail_config email: "someone@qq.com" authCode: "<16位授权码>"
Verify whether the connection is successful:
qqmail status --probe
Usage¶
The plugin provides three usage entry points:
1. DSH Agent Tools¶
In DSH’s system prompt, the agent automatically recognizes qqmail_* tools. The agent can perform operations such as search, read, and mark.
2. Terminal CLI¶
Use the qqmail command-line tool to interact:
# 检查状态
qqmail status --probe
# 列出未读邮件
qqmail list --mailbox INBOX --limit 20 --unseen
# 搜索邮件
qqmail search --from finance --since 2026-09-01
# 发送邮件
qqmail send --to a@b.com --subject "Hi" --text "Body" --attach ./report.pdf
# 回复邮件
qqmail reply 12345 --text "收到"
# 标记与移动
qqmail mark 12345 --seen --flag
qqmail move 12345 --to "Archive"
# 永久删除(默认是移入回收站)
qqmail delete 12345 --permanent true
3. MCP stdio Server¶
Provides an interface for agents that do not support DSH plugins. Configure it as follows:
{
"mcpServers": {
"qqmail": {
"command": "npx",
"args": ["-y", "@zhengjunyao/dsh-qqmail", "qqmail-mcp"]
}
}
}
Behavior and Configuration¶
The configuration file is stored in <DSH_HOME>/dsh-qqmail.json, with file permissions set to 0600.
- Read-only mode: defaults to
readOnly: true; in this mode, no write tools are registered, preventing accidental operations by the agent. - Deletion policy: by default, emails are moved to the trash. If permanent deletion is required, specify
permanent: truewhen callingdelete. - Security: the authorization code is stored with 0600 mode, and only a masked value is displayed in the Web panel and tool results. It is not exposed to the model or recorded in logs. TLS certificate validation is enforced.
Applicable Scenarios and Notes¶
- Applicable scenarios: DSH users who need agents to process internal email notifications, automatic replies, or email archiving.
- Permission note: The plugin runs with the permissions of the current DSH process. Please ensure you review the source code and license (MIT) before installation.