When to use this skill
- Manage multiple email accounts (Gmail, QQ, Outlook, etc.)
- Check emails on a schedule and generate summaries
- Intelligently generate reply drafts (sent after confirmation)
- Instant alerts for important emails
Core Features
1. Multi-account Management
- Supports any IMAP mailbox
- Use
passto securely store credentials - Configuration file:
config/accounts.json
2. Scheduled Tasks
- Automatic check daily at 8:00 and 17:00
- Scheduled via OpenClaw cron
- Instant notification when important emails are found
3. Intelligent Summaries
- Use AI to extract email key points
- Categorize by priority
- Push to WhatsApp/Telegram
4. Secure Sending
- AI generates reply drafts
- Show a preview before sending
- Send only after user confirmation
Trigger Words
- "Check emails"
- "Email summary"
- "Reply to email"
- "Add email account"
- "Email settings"
Configuration Steps
1. Add Email Account
# Gmail(需先开启 IMAP 并生成应用专用密码)
pass insert email/gmail/your-email@gmail.com
pass insert email/gmail/your-email@gmail.com-app-pass
# QQ 邮箱(需先开启 IMAP 服务并获取授权码)
pass insert email/qq/your-qq@qq.com
pass insert email/qq/your-qq@qq.com-auth-code
2. Update Account Configuration
Edit config/accounts.json:
{
"accounts": [
{
"name": "Gmail 主邮箱",
"email": "your-email@gmail.com",
"provider": "gmail",
"imap_server": "imap.gmail.com",
"imap_port": 993,
"smtp_server": "smtp.gmail.com",
"smtp_port": 587,
"enabled": true
},
{
"name": "QQ 邮箱",
"email": "your-qq@qq.com",
"provider": "qq",
"imap_server": "imap.qq.com",
"imap_port": 993,
"smtp_server": "smtp.qq.com",
"smtp_port": 587,
"enabled": true
}
]
}
3. Set Up Scheduled Tasks
Use OpenClaw cron:
# 8:00 检查邮件
openclaw cron add --name "早间邮件检查" --schedule "0 8 * * *" --script "~/clawd/skills/email-manager/scripts/check_email.py"
# 17:00 检查邮件
openclaw cron add --name "晚间邮件检查" --schedule "0 17 * * *" --script "~/clawd/skills/email-manager/scripts/check_email.py"
Security Policy
| Operation | Permission Level |
|---|---|
| Read email list | 🟢 Automatic |
| Read email content | 🟢 Automatic |
| Generate summary | 🟢 Automatic |
| Create reply draft | 🟢 Automatic |
| Send email | 🟡 Confirmation required |
| Delete email | 🔴 Prohibited |
Related Files
scripts/check_email.py- Email check and summaryscripts/send_email.py- Send email (confirmation required)scripts/reply_draft.py- Generate reply draftconfig/accounts.json- Account configurationconfig/providers.json- Email provider configuration
Common Email IMAP Configuration
| IMAP Server | Port | |
|---|---|---|
| Gmail | imap.gmail.com | 993 |
| QQ Mail | imap.qq.com | 993 |
| Outlook | outlook.office365.com | 993 |
| 163 Mail | imap.163.com | 993 |
| 126 Mail | imap.126.com | 993 |
Usage Examples
Check email summary
用户: 查看邮件
AI: [读取所有配置邮箱,生成摘要]
📧 今日邮件摘要 (2026-02-19 08:00)
Gmail 主邮箱 (3 封未读):
1. [重要] 项目进度更新 - 张三
2. 会议邀请:周五例会 - 李四
3. 订单发货通知 - 淘宝
QQ 邮箱 (1 封未读):
1. 验证码通知 - 某服务
Reply to email
用户: 回复第1封邮件,告诉他项目进度正常
AI: [生成回复草稿]
📝 回复草稿:
收件人: 张三 <zhangsan@example.com>
主题: Re: 项目进度更新
内容:
---
张三,你好!
感谢你的关注。项目进度一切正常,目前按计划推进中。
如有其他问题,随时联系。
祝好,
Daniel
---
确认发送吗?(回复"确认"发送,"修改"调整,"取消"放弃)
Troubleshooting
SSL/Connection Issues
- Symptom:
Connection reset by peer,SSL: UNEXPECTED_EOF_WHILE_READING - Root Cause: Mihomo/Clash TUN mode hijacks IMAP long connections, causing instability
- Solution:
- Overseas mailboxes such as Gmail: add in Mihomo
Merge.yamlAddDOMAIN-SUFFIX,imap.gmail.com,DIRECT - Domestic mailboxes such as QQ/163: must go through a domestic proxy egress, cannot connect directly (overseas VPS)
- The code has built-in ssl_context + 3 retries + 2s backoff
- Overseas mailboxes such as Gmail: add in Mihomo
Encoding Issues
- Symptom:
LookupError: unknown encoding: unknown-8bit - Solution:
_parse_emailAdded try/except fallback using utf-8 decoding
Timeout Issues
- Symptom:
check_email.pykilled by SIGKILL - Solution: Skip
test_connection, lower limit to 10, useheaders_only=True
Created date: 2026-02-19 Updated date: 2026-02-24 Version: 1.1.0