Introduction¶
A common approach to integrating enterprise email into DeepSeek Harness (DSH) is calling third-party APIs or running command-line clients within scripts. The former requires additional authentication and rate-limiting controls; the latter often drags in a heavy set of third-party dependencies, inflating maintenance costs. The dsh-netease-mail plugin implements a full IMAP/SMTP protocol stack directly inside DSH with zero third-party libraries—relying only on Node.js built-ins (node:tls / node:net / node:crypto)—making it well suited for scenarios where an agent needs to read and write qiye.163.com mailboxes in place.
What Is This¶
dsh-netease-mail is a DSH client plugin maintained by WYHboop. It ships three components: eight conversational tools (mail_*), a three-column sidebar panel titled “Mailbox,” and a bundled skill netease-mail. The plugin writes its own IMAP/SMTP layer with connection reuse, delivering a dramatic speed boost in reading messages (a 23 MB message drops from 37 seconds to roughly 1 second).
Core Features¶
Conversational Tools (Eight)¶
mail_check: Connectivity self-check—verifies login, folders, message counts, and the source of the authorization codemail_folders: List mailbox foldersmail_list: List messages in a specified foldermail_read: Read a message bodymail_search: Search messages across the mailboxmail_send: Send a message (outbound action; asks for confirmation before sending; supportsdryRunrehearsal)mail_attachment: Save message attachmentsmail_flag: Mark as read / unread / starred / move / delete
All of these tools are invoked imperatively and do not require any UI to be open.
Sidebar Panel “Mailbox”¶
The panel uses a three-column layout: Folders / List / Body. You can open it during a conversation to browse, search, compose, save attachments, and manage flags. Reading mail this way keeps the conversation stream uncluttered, which is ideal for scenarios that require frequent context switching.
Skill netease-mail¶
A skills/netease-mail/SKILL.md file is bundled and registered with the host’s skill service. Invoking skill(netease-mail) in a conversation teaches the assistant how to use the eight tools, which actions require prior user confirmation, and what the known limitations are (count drift, Chinese keywords only filterable locally, large attachments bandwidth-capped, etc.).
Speed Optimizations¶
- Connection reuse: no re-login on every operation
- Large messages: only the body parts are fetched; attachments are not downloaded
- Short-lived caches for previously read messages and searched terms
- Benchmarked: a folder list click takes just over 0.1 s; opening a 23 MB message takes ~1 s
Installation & Activation¶
Clone the repository from GitHub:
git clone https://github.com/WYHboop/dsh-netease-mail.git
dsh plugin --profile desktop add link:.\dsh-netease-mail
After installation, confirm that dsh-netease-mail is enabled in the DSH plugin manager.
Configuration¶
The plugin requires Node ≥ 20. Before first use, configure the account and authorization code.
The config file can be placed in any of the following locations (later entries override earlier ones):
- A JSON file pointed to by the environment variable
DSH_NETEASE_MAIL_SETTINGS - User directory:
~/.dsh/dsh-netease-mail.json - Plugin directory:
local-settings.json(for source-development use)
Example configuration:
{ "account": "you@yourcompany.com", "authCodeFile": "D:\\secret\\authcode.txt" }
You may also set the authorization code via the environment variable NETEASE_AUTH_CODE. The code is never logged to cordis.patch.yml and never appears in any echo; mail_check will only report which source it was loaded from.
Typical Usage¶
Enable the skill in a conversation:
skill(netease-mail)
Then invoke tools following the skill’s guidance, for example:
mail_check: Verify connection and authorization codemail_folders: List foldersmail_list folder:INBOX: List the inboxmail_search text:approval: Search for messages containing “approval”mail_send to:boss@company.com subject:Weekly Report body:This week I completed...: Send a message (confirmation prompt first)mail_attachment id:12345 path:C:\temp: Save an attachment
You can also call the /mail/api2/* routes directly from scripts or the UI.
Applicable Scenarios & Caveats¶
- Ideal for scenarios requiring direct read/write access to Netease enterprise mailboxes inside a DSH agent
- Suited to projects that want to avoid third-party dependencies and stay lightweight
- The plugin runs with the current DSH process privileges; review the source code and license before installing
- Known limitations:
EXISTScounts may drift (useUID SEARCH ALLas the source of truth), Chinese keywords can only be filtered locally, no IDLE push, body text is truncated at 6,000 characters by default, no HTML rendering, large attachments are subject to server bandwidth limits (~1 MB/s)
Closing¶
dsh-netease-mail delivers a zero-dependency IMAP/SMTP implementation that, combined with eight imperative tools and a three-column panel, enables full email read, write, search, send, and flag management within DSH. It is well suited to agent-development scenarios that interact directly with qiye.163.com.
- Catalog page: https://www.skillhub.cn/plugins/WYHboop/dsh-netease-mail
- GitHub: https://github.com/WYHboop/dsh-netease-mail