HeIIoAgain/dsh-notify-email ↗★ 1
dsh-notify-email
DeepSeek Harness plugin that emails you when a turn finishes, when the agent waits for an answer or approval, and a send_email tool with attachment support.
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:HeIIoAgain/dsh-notify-email配置
配置写在 profile 的 patch 层($DSH_HOME/profiles/ /cordis.patch.yml):
- id: notify-email
name: 'dsh-notify-email'
config:
smtpHost: smtp.qq.com
smtpPort: 465
secure: true
user: you@qq.com # 发件邮箱(= SMTP 登录账号)
from: you@qq.com # 发件人地址,一般与 user 相同
to: you@qq.com # 收件邮箱,多个用逗号分隔;可与 user 不同
subjectPrefix: '' # 标题前缀,留空则不加
notifyOnQuestion: true
notifyOnApproval: true
notifyOnTurnEnd: false
config是整体替换:按id覆盖时要把需要的字段写全。 发件地址必须与 SMTP 登录账号一致,否则 163/QQ 会拒信;收件地址可以是任意邮箱。
授权码
SMTP 密码不要写进 YAML。放进独立文件(每次发送时实时读取,改完不用重启):
mkdir -p ~/.dsh/notify-email
printf '%s' '你的SMTP授权码' > ~/.dsh/notify-email/password
chmod 600 ~/.dsh/notify-email/password
也可以用 passwordFile 指定其他路径,或用环境变量 DSH_SMTP_PASSWORD(启动 dsh 前 export)。
常见邮箱参数
| 邮箱 | smtpHost | 端口 / secure | 密码 |
|---|---|---|---|
| QQ 邮箱 | smtp.qq.com | 465 / true | 设置 → 账户 → 开启 SMTP 后生成的授权码 |
| 163 邮箱 | smtp.163.com | 465 / true | 客户端授权码 |
| 126 邮箱 | smtp.126.com | 465 / true | 客户端授权码 |
| Gmail | smtp.gmail.com | 465 / true(或 587 / false) | 应用专用密码(需开两步验证) |
| Outlook / Microsoft 365 | smtp.office365.com | 587 / false | 账户密码或应用密码 |
| 阿里云邮箱 | smtp.aliyun.com | 465 / true | 登录密码或授权码 |
25 端口通常被云厂商封禁,别用;587 端口需要
secure: false,插件会自动 STARTTLS。
使用
- 直接说:“把刚才的结果发到我邮箱” → agent 调
send_email。 - 带附件:“把 report.pdf 和 run.log 作为附件发我邮箱” → agent 传
attachments(绝对路径,或相对会话工作目录)。 - 定时:用 DSH 自带
schedule_create建提醒,prompt 里写明“把结果发到邮箱”,到点触发的回合里 agent 会调send_email。 - 每轮结束都要摘要:把
notifyOnTurnEnd改成true。 - 需要诊断自动通知为什么没触发:把
debugLog改成true,日志写入$DSH_HOME/notify-email/debug.log。
附件
- 支持中文文件名(RFC 2231 编码),按扩展名自动判断 Content-Type(txt/md/json/csv/pdf/zip/png/jpg 等,其余按
application/octet-stream) - 默认限制:单个 ≤ 20MB、每封 ≤ 10 个,可用
maxAttachmentBytes/maxAttachments调整 - 文件不存在、不是普通文件、超过限制都会在读文件阶段直接报错,不会建立 SMTP 连接
- 自动提醒(提问 / 授权 / 回合结束)不带附件
配置项
| 字段 | 默认值 | 说明 |
|---|---|---|
smtpHost | smtp.qq.com | SMTP 服务器 |
smtpPort | 465 | 端口;465 隐式 TLS,587 STARTTLS |
secure | true | true 直接 TLS;587 设为 false |
starttls | true | secure: false 时是否升级 STARTTLS |
user | — | SMTP 登录账号(通常是发件邮箱) |
from | 同 user | 发件人地址,必须与登录账号一致 |
to | — | 默认收件人,逗号分隔 |
passwordFile | $DSH_HOME/notify-email/password | 授权码文件 |
passwordEnv | DSH_SMTP_PASSWORD | 授权码环境变量名 |
subjectPrefix | [DSH] | 标题前缀,留空不加 |
notifyOnQuestion | true | 等待回答时发提醒 |
notifyOnApproval | true | 等待授权时发提醒 |
notifyOnTurnEnd | false | 每轮结束发摘要 |
debugLog | false | 写诊断日志 |
timeoutMs | 15000 | SMTP 超时 |
maxAttachmentBytes | 20971520 | 单个附件上限(字节) |
maxAttachments | 10 | 单封附件数量上限 |