# platform-mail-mcp

Draft-first / guarded email MCP adapter for Hermes and LongClaw.

This connector sends emails from a user-provided spreadsheet through SMTP
authorization codes. It is intended for legitimate user-owned 163 Mail and QQ
Mail accounts.

Tools:

- `mail_health_check`
- `mail_preview_table`
- `mail_open_webmail`
- `mail_send_batch`

Safety defaults:

- `execute=false` only previews work.
- Real sending requires `execute=true`, `confirm_text="SEND_EMAILS"`, and
  `sending.enabled=true` in `config/mail.config.json`.
- Per-run limits and interval throttling are enforced by config.
- Passwords / authorization codes are never returned in tool output.

## Setup

1. Copy `config/mail.config.example.json` to `config/mail.config.json`.
2. Fill one account:
   - 163 Mail: SMTP host `smtp.163.com`, SSL port `465`.
   - QQ Mail: SMTP host `smtp.qq.com`, SSL port `465`.
   - Use the mailbox authorization code, not the normal login password.
3. Add this folder as a Process MCP server in Hermes.

## Spreadsheet columns

Accepted column aliases:

- Recipient: `to`, `email`, `recipient`, `收件人`, `邮箱`, `邮箱号`
- Subject: `subject`, `title`, `主题`, `标题`
- Body: `body`, `content`, `message`, `正文`, `邮件内容`, `内容`
- CC: `cc`, `抄送`
- BCC: `bcc`, `密送`
- Attachments: `attachments`, `files`, `附件`

Supported file types:

- `.csv`
- `.tsv`
- `.xlsx` when `openpyxl` is installed

## Example tool call

Preview only:

```json
{
  "table_path": "D:/mail/tasks.xlsx",
  "execute": false
}
```

Real send:

```json
{
  "table_path": "D:/mail/tasks.xlsx",
  "execute": true,
  "confirm_text": "SEND_EMAILS"
}
```

