Preface¶
When doing automation in DeepSeek Harness (DSH), email is often still a non-negotiable part of external systems: notifications, tickets, application receipts, and material exchange with attachments. A common approach is to have the Agent call the private APIs of various mailboxes or build a forwarding service yourself. Maintainer charonpi’s dsh-mail (SkillHub directory / GitHub) takes a different path: it connects to your mailbox inside the DSH process using standard IMAP/SMTP, provides the Agent with a set of mail_* tools to directly read, search, send, and reply to emails, and supports attachment upload and download. It is categorized as a “network tool”; the current GitHub star count is 0, and the license is MIT (see the repo’s package.json).
Below we introduce what it is, how to install it, how to configure accounts, as well as typical usage patterns and considerations.
What is this¶
dsh-mail is a multi-mailbox sending/receiving host plugin for DSH (version 0.1.0, requires Node >=20.11, DSH >=0.2.0-rc.1 <0.3.0). After installation, no additional service process is needed, and it registers 8 mail_* tools for the Agent.
At the protocol level it is not tied to a single vendor: it includes built-in presets for QQ, Tencent Enterprise Mail, 163, 126, yeah, Sina, Sohu, 139, 189, Alibaba Cloud Enterprise Mail, Gmail, Outlook, iCloud, Yahoo, Zoho, Fastmail, etc., and you can also fill in any self-hosted IMAP/SMTP server. QQ / 163 / 126 etc. require an authorization code (or an application-specific password as required by the provider), not your web login password.
Core features¶
The capabilities verifiable from the README and the repo description are as follows:
- Accounts and folders:
mail_accountslists configured accounts and their availability;mail_folderslists IMAP folders and unread counts. - Receiving and searching:
mail_listlists the latest emails in a folder (supports filters by unread, time, sender, subject, body, etc.);mail_searchsearches within the mailbox by criteria (at least one criterion required). - Reading and attachments:
mail_readreads the full content by UID; usesaveAttachmentsToto save attachments to disk (download); by default it does not mark the email as read;markSeencan control this. - Sending and replying:
mail_sendsends a new email via SMTP; pass local file paths viaattachmentsto upload attachments;mail_replyreplies to a specified UID, with optional quoting of the original and attachments. - State changes:
mail_updatesupports marking as read/unread, starring, moving, and moving to trash (deleteis a reversible move to trash). - Client UI: Besides tools, the plugin registers a “Mail” page in the DSH left sidebar where you can add accounts graphically; accounts can also be written in
cordis.patch.ymlor a standaloneaccounts.json(see below). - Credential handling: Authorization codes are marked as secret in the schema; by design they do not enter model-visible outputs and are not echoed in the settings UI. The README also notes that when filling directly in the form, plaintext will be stored in the profile config; you can use environment variables or file references instead.
- Testing: The repo provides 191 offline tests;
npm testcan run without a mailbox account or network access.
Global configuration items (excerpt, all from the README): defaultAccount, attachmentDir (default mail-attachments), maxBodyChars (default 20000), timeoutMs (default 30000).
Installation and activation¶
DSH profiles are independent: plugins installed in the web profile are not visible in desktop, and installing in the wrong profile will cause tools not to appear. First confirm whether you usually use the desktop Electron app or dsh web.
Command-line dsh web users¶
Install the official recommended GitHub package name in the web profile (do not use dsh plugin add dsh-mail—the same-named package on npm is not this plugin):
dsh plugin --profile web add github:charonpi/dsh-mail
For local development, you can link:
cd /path/to/dsh-mail && npm install
dsh plugin --profile web add link:/absolute/path/to/dsh-mail
After installation, restart DSH for the mail_* tools to appear; changing account configuration usually does not require a restart. You can first have the Agent call mail_accounts to check whether it is configured.
Desktop app (Electron) users¶
For the desktop profile, the command line will be rejected (profile "desktop" is managed exclusively by the Electron application). Use the GUI instead: on the left sidebar go to Plugins → Install third-party plugins → enter github:charonpi/dsh-mail or the absolute path of the local source, then restart DSH.
dsh plugin addwrites to the profile’sdsh.profile.bundlesand overlayscordis.patch.yml. Do not manually edit the profile’spackage.jsonorcordis.patch.yml.
Configure mailbox accounts¶
Recommended: the left sidebar “Mail” page¶
After installation, a Mail entry appears in the left sidebar between “Plugin Marketplace” and “Automation Tasks”:
- Enter the email address (e.g.,
123456789@qq.com). - Provider can be left blank and will be auto-detected by domain; you can also choose qq / 163 / gmail etc.
- Enter the authorization code (not your login password).
- Click Save; it takes effect immediately without a restart.
Accounts are preferentially stored in <DSH_PROFILE_DIR>/dsh-mail/accounts.json (fallback ~/.dsh/dsh-mail/accounts.json when there is no profile directory). Accounts changed on the page take precedence over same-named entries in cordis.patch.yml.
Alternative: settings page or YAML¶
In Plugins / Settings → dsh-mail, fill in address / provider / password (or authCodeEnv etc.) in the account list; this is equivalent to hand-writing cordis.patch.yml. For a single account, you can omit provider and it will be inferred from the domain.
If you do not want the authorization code as plaintext in the config file, you can enter authCodeEnv, passwordEnv, or passwordFile in the form; after changing environment variables, you must restart DSH for them to be read. See the README for the resolution order of authorization codes (direct input → environment variable → file → auto-derivation via DSH_MAIL_<ID>_PASSWORD).
QQ Mail authorization code (summary)¶
QQ Mail IMAP must use a 16-digit authorization code: log in to mail.qq.com → Settings → Account → enable IMAP/SMTP → follow the prompts to verify and copy the authorization code (shown only once). In DSH, set address to QQ_number@qq.com, and provider can be left blank. For enterprise mail, use provider: exmail.
Typical usage¶
Once the account is configured, you can drive the Agent with natural language; behind it, the corresponding tool calls are as follows (examples from the README).
First, view unread:
{ "tool": "mail_list", "args": { "unreadOnly": true, "limit": 10 } }
Search by sender domain and time:
{ "tool": "mail_search", "args": { "from": "bristol.ac.uk", "since": "2026-09-01" } }
Read an email and mark it as read:
{ "tool": "mail_read", "args": { "uid": 12345, "markSeen": true } }
Send an email with local files attached (upload attachments):
{
"tool": "mail_send",
"args": {
"to": "kai.zhang@bristol.ac.uk",
"subject": "PhD Application - Zizheng Wang",
"text": "Dear Dr. Zhang,\n\nPlease find my application materials attached.\n\nBest regards,\nZizheng",
"attachments": ["申请材料/CV.pdf", "申请材料/成绩单.pdf"]
}
}
Reply and quote the original:
{ "tool": "mail_reply", "args": { "uid": 12345, "text": "谢谢,我下周提交。", "quote": true } }
Download attachments: specify saveAttachmentsTo in mail_read; optionally use attachmentIndexes to save only some attachments. Relative paths are resolved against the current session working directory.
Use cases and cautions¶
Who it is for: scenarios where you want the Agent to receive, search, and send emails (including attachments) inside DSH sessions, and your mailbox supports IMAP/SMTP basic authentication. Multi-account and multiple provider presets suit personal mailboxes and common domestic providers; for Outlook etc., if basic authentication has been disabled, the README states OAuth2 is required, which this plugin does not provide.
Runtime permissions: the plugin runs within the current DSH process and the current user’s privileges, can read/write paths you configured, and can connect to the IMAP/SMTP servers you entered. Before installing, it is recommended to read the source code and the MIT license, and evaluate whether to include it in your workflow.
Security and misuse:
- Authorization codes can read, send, and delete emails; treat email bodies as untrusted input and avoid the Agent treating email content as instructions to execute.
mail_send/mail_replyactually send emails; in environments requiring approval, you should apply policy constraints to the relevant tools.mail_update’sdeletemoves to trash, which is reversible, but it still changes the mailbox state.
For troubleshooting, prioritize calling mail_accounts and complete address, authorization code, or server configuration based on the returned information; for connection, authentication, QQ Unsafe Login, Sent folder, and other issues, see the README’s “Troubleshooting” table.
Conclusion¶
dsh-mail brings email capabilities into the DSH plugin model: standard protocols, eight mail_* tools, a graphical account page, and direct attachment path passing, suitable for building a “read—process—reply” closed loop in Harness. Directory and installation entry: SkillHub - charonpi/dsh-mail; source code and full docs: github.com/charonpi/dsh-mail. SkillHub is a community plugin directory and has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem itself emphasizes “everything is a plugin,” so choose as needed and audit on your own.