メインコンテンツへスキップ
F

dsh-qqmail

fubai-fenzhi/dsh-qqmail

Manage a QQ mailbox from DSH over IMAP/SMTP: list, read, search, file by rule, mark read, deduplicate, and send, with a dry-run before every bulk action.

インストール

dsh plugin --profile web add github:fubai-fenzhi/dsh-qqmail

README

dsh-qqmail

npm

Manage a QQ mailbox (@qq.com) from DeepSeek Harness: list and read mail, search, file messages by rule, mark read, remove duplicates, and send — all over IMAP and SMTP with a small client written against node:tls, so the package has no runtime dependencies.

Install from npm as @fubai-fenzhi/dsh-qqmail, or add the local directory through Plugins > Add plugin.

What it registers

ToolPurpose
qqmail_checkProve login; print inbox and per-folder message/unread counts.
qqmail_listNewest-first message list for a folder, optional unread-only.
qqmail_readOne message by UID: headers, attachment names, text body.
qqmail_searchSubstring search over subject/sender/date in the newest N messages.
qqmail_archiveMove mail by rules (sender/subject substrings). Dry-run by default.
qqmail_mark_readMark unread mail as read by sender. Dry-run by default.
qqmail_dedupeDelete duplicate copies (same Message-ID) inside one folder.
qqmail_sendCompose; preview by default, send only with apply: true.
qqmail_setupStore the address and authorization code in a local secret file (mode 600).

A companion skill (qqmail) carries the workflow and the provider-specific traps.

How it runs

Every mailbox operation runs in a short-lived Node child process (lib/cli.mjs) instead of the DSH host. Doing the IMAP/SMTP work in-process made long calls vanish as an empty error with no stack, because the host cancels them; the child also keeps blocking network I/O off the host event loop. Credentials travel to the child over stdin, never through argv or the environment, and the child is spawned with process.execPath plus ELECTRON_RUN_AS_NODE=1 so the same code works inside DSH Desktop and in plain Node.

After changing plugin source in a linked install, disable and re-enable the row in Plugins (or restart DSH) to load a fresh module generation — editing the files alone does not hot-reload a Host plugin.

Requirements

  • QQ Mail → 设置 → 账号 → 开启 IMAP/SMTP 服务. The client password is the 16-character 授权码, not the QQ password.
  • Node 18 or newer. No build step, no dependencies.

Configuration

Credentials are resolved in this order:

  1. Plugin config email and authcode.
  2. Environment QQMAIL_EMAIL and QQMAIL_AUTHCODE.
  3. The secret file ~/.dsh/qqmail.json (override with config secretFile).

Preferred: keep the profile clean and let qqmail_setup write the secret file.

{ "email": "12345678@qq.com", "authcode": "<16-char authorization code>" }

Optional config keys: imapHost, imapPort, smtpHost, smtpPort, timeoutMs.

Typical session

qqmail_check                                   → login + folder inventory
qqmail_list  { folder: "INBOX", unseen: true }  → what needs attention
qqmail_archive { rules: [...], apply: false }   → preview hit counts per rule
qqmail_archive { rules: [...], apply: true }    → actually move
qqmail_dedupe { folder: "其他文件夹/通知-npm", apply: true }
qqmail_send { to: ["a@b.com"], subject: "Hi", body: "...", apply: false }

Limitations

  • Folder rules are substring matches on the decoded From and Subject; there is no server-side filter management (set those in the QQ Mail web UI).
  • Attachment extraction: names are listed, contents are not downloaded.
  • Deleting real mail is intentionally out of scope; only duplicate removal is implemented. Move mail to a folder and let the user decide.
  • The plugin reads at most the newest N messages per folder (default 300–500) to keep a single tool call fast; pass a larger scan when needed.

License

MIT

関連プラグイン