dsh-mail-digest: Organize Your Mailbox into One Report per Round in DSH

Introduction

When developing or collaborating daily with DeepSeek Harness (DSH), agents can read files and call tools, but emails often still require you to open them one by one to judge priority. Common practices are manual filtering or using rules in email clients to sort folders—this can lighten the load but makes it hard to directly see in every round of conversation “what’s important in this batch, what needs your reply, and which thread is at what step”.

Below, I introduce the community plugin dsh-mail-digest (maintainer skyrocks): It periodically fetches emails via IMAP on the DSH desktop side, tags them, writes summaries, merges threads based on communication, outputs a readable report every round, and pops up a notification after finishing organization. The plugin is categorized as a Workflow, repository skyrocks/dsh-mail-digest, license MIT.

Overview

dsh-mail-digest is a DeepSeek Harness plugin whose positioning can be summarized as: Automatically organize emails, leaving a readable report for every round. It focuses on answering three things: the highlights in this batch of emails, items that need your processing, and the progress of each email thread; for the rest of the emails, it mostly keeps only the title to reduce interference.

The report and raw data are stored in a local directory (default ~/.dsh/mail-digest/). Content for the same round is generated in three formats: JSON (for the panel), HTML (for browsers), and Markdown. The email side is read-only; it does not send replies, delete emails, or change read status.

Core Features

Fetching and Classifying

The plugin fetches emails periodically via IMAP, tags each one and writes a one-sentence summary. Emails with correspondence are merged into threads, and a “summary so far” is written after organizing the timeline. It fetches up to 500 emails at once; the time window maxes out at 3650 days. Attachments do not save the body content, only the filename is recorded; the entire email is read during fetching, but the local body of each email is retained with a maximum of 20,000 characters.

Report Structure

The title of each report roughly looks like “Mail Organization · Main Inbox · Date Time”, and includes a statistics line (e.g., number of new emails, number pending reply, number of high priority). The body is divided into blocks including:

  • Highlights: Summary entries that need attention
  • Needs Your Action: Emails pending reply or to-do items (can include contact, time, and key points)
  • Thread Progress: Threads merged by topic and their summaries
  • What This Batch Is: Counting by type (e.g., promotions, work, contracts, etc.)
  • The Rest (Titles Only): Low-disturbance list

The interface provides three tabs: Report (list, unread markers, sidebar reading, manual “Organize Now”, multi-account switching), Auto (toggle and frequency: every 1-168 hours, or specific HH:mm daily), and Config (add/remove mailboxes, service provider and IMAP, authorization code, time window, tag list).

Tools Available to Agents

The plugin registers multiple groups of tools in DSH to facilitate driving the same process in conversation, for example:

Tool Function
mail_status Mailbox list, tags, auto toggle and counts
mail_fetch Fetch once (can specify account or all)
mail_inbox List unorganized emails
mail_read / mail_thread Read a single email or the full thread timeline
mail_file Write back tags, summaries, priorities, and whether a reply is needed
mail_thread_summary Write thread summaries
mail_report / mail_reports Generate, list, read or delete reports

Thread merging relies on email headers and subject lines; the same matter across different topics will not be automatically connected, so be aware of this when using it.

Installation and Setup

The current version in the repository is 0.4.2, requiring Node.js >= 18 and DSH >=0.2.2-rc.2 and <0.3.0. It is recommended to read the source code and MIT license before installing; the plugin runs with the current DSH process permissions and will access your configured mailboxes and local data directory.

The installation method given in the official README is as follows (path needs to be replaced with your local plugin directory):

dsh plugin --profile desktop add "link:/path/to/dsh-mail-digest"

You can also drag the plugin directory into DSH’s “Plugins → Add Plugin”. After installation, go to “Settings → Mail Organization → Config”, select the email service provider and fill in the account and Authorization Code (QQ, 163, Gmail, etc. all require an authorization code, not the login password).

The authorization code is stored in the DSH credential database, with a key name like DSH_MAIL_DIGEST_MAIL_<AccountID>, and will not be written to config files like account.json.

Typical Usage

After the installation steps above, you can try running a round in the following order.

  1. Fill in the mailbox on the config page, click “Test Connection”, and confirm IMAP is available.
  2. Open the report page, click “Organize Now”: the process is fetch emails → tag and summarize → organize threads → generate report; after completion, DSH will pop a notification.
  3. In the conversation, you can also directly say “Organize the emails”, and the agent will go through the above toolchain.
  4. If scheduling is needed: on the “Auto” page, select “Every N Hours” or “09:00 Daily” etc. and save; you can see the “Mail Organization” item in “Settings → Scheduled Tasks”. Automatic organization depends on DSH’s scheduled task service—it won’t execute when Host is not running, and if it’s missed, it generally only makes up for the most recent one.

For multiple mailboxes, one round generates a report for each account; you can switch accounts at the top of the report page.

Data and Security Boundaries

The default data root directory is $DSH_HOME/mail-digest/ (i.e., ~/.dsh/mail-digest/), mainly including:

mail-digest/
├── account.json    # mailbox list, tags, auto settings (passwords excluded)
├── messages.json
├── threads.json
├── reports.json
└── reports/
    ├── <id>.json
    ├── <id>.html
    └── <id>.md

File permissions are 0600, directories 0700. Backups can be made by copying the whole directory; to switch machines, you need to fill in the authorization code again. Deleting local reports only removes the three report files; the corresponding emails will revert to “Pending Organization”, and a new report will be generated on the next organization.

In terms of security design: fetching uses BODY.PEEK for read-only; authorization codes do not go into config and are not sent back to the interface; no delete or mark-as-read commands are sent to the server.

Applicable Scenarios and Limitations

It is suitable for developers or knowledge workers who are already using the DSH desktop environment and want to turn their inbox into a “structured brief every round”, especially scenarios involving contracts and project correspondence that require tracking threads and to-dos.

Please note before use:

  • Attachments are not saved; large inboxes still have a 500-email limit per run.
  • Automatic tasks are bound to the DSH Host running status.
  • The community directory page dsh-mail-digest on skillhub.cn and the GitHub repository are maintained by the community and have no official affiliation with DeepSeek / Huafan; stars and versions follow the repository.

If you hope to change “reading emails” from manual flipping to a reportable, deletable round in Harness, you can first configure one account to try “Organize Now”, then enable automatic frequency and conversation commands as needed.

  • Directory Page: https://www.skillhub.cn/plugins/skyrocks/dsh-mail-digest
  • Source Code and Docs: https://github.com/skyrocks/dsh-mail-digest
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye