返回 Skill 列表
extension
分类: AI Agent 能力无需 API Key

ming

读取并处理企业邮箱( Coremail):默认经网页 JSON API 拉取未读/按发件人/主题筛选的邮件,也可用 IMAP;由 AI 起草回复,发送前必须经用户明确确认;支持 Re: 主题、会话回复头、回复后标记已读。Use when the user asks to check mail, 查邮件, 未读邮件, read inbox, draft reply, 回复邮件, auto-reply, 自动回复, or work with Streamax / Coremail email.

person作者: zmkryzenhubModelScope

Email Auto Reply (Streamax)

Operate on Streamax Coremail at mail.streamax.com.

Default transport: Web JSON API (same path as the browser — works without VPN). IMAP/SMTP remain available when the company network resolves imap/smtp.streamax.com.

Hard rules

  1. Never send until the user explicitly confirms the draft (e.g.「确认发送」or "send it").
  2. Show the full draft (To / Subject / Body) before asking for confirmation.
  3. Do not store passwords in chat or commit .env. Use env vars / local .env.
  4. Prefer reply (In-Reply-To / References) over a new thread unless asked otherwise.

Prerequisites

  1. Copy .env.example to .env in this skill directory and fill values.
  2. MAIL_PASSWORD must be the 客户端专用密码 from webmail settings.
  3. Python 3.10+; optional: pip install -r scripts/requirements.txt.

| Role | Host / URL | Notes | |------|------------|-------| | Web API (default) | https://mail.test.com/coremail | No VPN needed | | IMAP | imap.test.com:993 | Often needs company network | | SMTP | smtp.test.com:465 | Often needs company network |

See reference.md for env vars and troubleshooting.

Workflow

Email task:
- [ ] 1. Load config / verify credentials present
- [ ] 2. Fetch matching messages
- [ ] 3. Summarize for user (do not dump huge bodies unless asked)
- [ ] 4. Draft reply (AI)
- [ ] 5. Present draft → wait for explicit confirm
- [ ] 6. Send via script
- [ ] 7. Optionally mark original as read

1. Fetch mail

python scripts/fetch_mail.py --unread
python scripts/fetch_mail.py --unread --from "alice@example.com"
python scripts/fetch_mail.py --uid "1:xxxx" --full
python scripts/fetch_mail.py --unread --via imap

| Flag | Meaning | |------|---------| | --unread | Unread only | | --since YYYY-MM-DD | Since date (IMAP only) | | --from TEXT | FROM contains TEXT | | --subject TEXT | SUBJECT contains TEXT | | --limit N | Max messages (default 20) | | --uid ID | Single message id (web) / IMAP UID | | --full | Download bodies (web list is headers-only by default) | | --via web\|imap\|auto | Default web | | --json | Machine-readable output |

Present a short list: From, Date, Subject, ID. Expand full body with --full or --uid when replying.

2. Draft reply (AI)

  • Match the user's language (中文/English) to the original unless told otherwise.
  • Be concise, professional, and address the sender's asks.
  • Subject: if original has no Re:, use Re: {original subject}; keep existing Re: / 回复: as-is.
  • Quote lightly only when needed; default to a clean reply body.
  • If intent is unclear, ask the user before drafting.

Output format:

## Draft reply
- **To:** ...
- **Subject:** Re: ...
- **In-Reply-To:** <message-id>
- **Body:**

...

Reply「确认发送」to send, or say what to change.

3. Send (only after confirm)

python scripts/send_reply.py \
  --to "sender@example.com" \
  --subject "Re: original subject" \
  --body-file reply.txt \
  --in-reply-to "<message-id@mail.streamax.com>" \
  --references "<message-id@mail.streamax.com>" \
  --mark-read-uid "1:xxxx"

Or:

python scripts/send_reply.py --to "..." --subject "Re: ..." --body "谢谢,已收到。" --mark-read-uid "1:xxxx"

4. Supported filters

  • Unread only
  • Date range / since date (IMAP)
  • Sender and subject keywords
  • After reply: mark read + Re: subject + threading headers

Safety checklist before send

  • [ ] User confirmed this exact draft
  • [ ] To / Cc match the intended recipients
  • [ ] No secrets accidentally included
  • [ ] Correct thread headers if this is a reply

Additional resources