email-manager

Original🇨🇳 Chinese
Translated
5 scriptsChecked / no sensitive code detected

Unified multi-email management and intelligent assistant. Supports IMAP email services such as Gmail and QQ Mail, scheduled email checking, AI-generated summaries and reply drafts, and requires user confirmation before sending.

7installs
Added on

NPX Install

npx skill4agent add aaaaqwq/claude-code-skills email-manager

SKILL.md Content (Chinese)

View Translation Comparison →

Email Manager - Smart Email Assistant

When to Use This Skill

  • Manage multiple email accounts (Gmail, QQ Mail, Outlook, etc.)
  • Scheduled email checking and summary generation
  • Intelligently generate reply drafts (requires confirmation before sending)
  • Instant alerts for important emails

Core Features

1. Multi-account Management

  • Supports any IMAP email service
  • Uses
    pass
    for secure credential storage
  • Configuration file:
    config/accounts.json

2. Scheduled Tasks

  • Automatic checks at 8:00 and 17:00 daily
  • Scheduled via OpenClaw cron
  • Instant notifications when important emails are detected

3. Intelligent Summary

  • Uses AI to extract key email points
  • Classified by priority
  • Pushed to WhatsApp/Telegram

4. Secure Sending

  • AI-generated reply drafts
  • Preview displayed before sending
  • Only sent after user confirmation

Trigger Phrases

  • "Check emails"
  • "Email summary"
  • "Reply to email"
  • "Add email account"
  • "Email settings"

Configuration Steps

1. Add Email Accounts

bash
# Gmail (Enable IMAP and generate an app-specific password first)
pass insert email/gmail/your-email@gmail.com
pass insert email/gmail/your-email@gmail.com-app-pass

# QQ Mail (Enable IMAP service and obtain an authorization code first)
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
:
json
{
  "accounts": [
    {
      "name": "Main Gmail Account",
      "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 Mail Account",
      "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

Using OpenClaw cron:
bash
# Check emails at 8:00
openclaw cron add --name "Morning Email Check" --schedule "0 8 * * *" --script "~/clawd/skills/email-manager/scripts/check_email.py"

# Check emails at 17:00
openclaw cron add --name "Evening Email Check" --schedule "0 17 * * *" --script "~/clawd/skills/email-manager/scripts/check_email.py"

Security Policy

OperationPermission Level
Read email list🟢 Automatic
Read email content🟢 Automatic
Generate summary🟢 Automatic
Create reply draft🟢 Automatic
Send email🟡 Requires Confirmation
Delete email🔴 Forbidden

Related Files

  • scripts/check_email.py
    - Email checking and summary generation
  • scripts/send_email.py
    - Send email (requires confirmation)
  • scripts/reply_draft.py
    - Generate reply drafts
  • config/accounts.json
    - Account configuration
  • config/providers.json
    - Email provider configuration

Common IMAP Configurations for Email Services

Email ServiceIMAP ServerPort
Gmailimap.gmail.com993
QQ Mailimap.qq.com993
Outlookoutlook.office365.com993
163 Mailimap.163.com993
126 Mailimap.126.com993

Usage Examples

View Email Summary

User: Check emails
AI: [Reads all configured emails and generates summary]
    
    📧 Today's Email Summary (2026-02-19 08:00)
    
    Main Gmail Account (3 unread):
    1. [Important] Project Progress Update - Zhang San
    2. Meeting Invitation: Weekly Friday Meeting - Li Si
    3. Order Shipment Notification - Taobao
    
    QQ Mail Account (1 unread):
    1. Verification Code Notification - A Service

Reply to Email

User: Reply to the first email, tell him the project is on track
AI: [Generates reply draft]

    📝 Reply Draft:
    
    Recipient: Zhang San <zhangsan@example.com>
    Subject: Re: Project Progress Update
    
    Content:
    ---
    Hi Zhang San,
    
    Thank you for your update. The project is progressing smoothly as planned.
    
    Please feel free to contact me if you have any other questions.
    
    Best regards,
    Daniel
    ---
    
    Confirm sending? (Reply "Confirm" to send, "Modify" to adjust, "Cancel" to abort)

Troubleshooting

SSL/Connection Issues

  • Symptoms:
    Connection reset by peer
    ,
    SSL: UNEXPECTED_EOF_WHILE_READING
  • Root Cause: Unstable IMAP long connections due to Mihomo/Clash TUN mode hijacking
  • Solutions:
    • Overseas email services like Gmail: Add
      DOMAIN-SUFFIX,imap.gmail.com,DIRECT
      to Mihomo
      Merge.yaml
    • Domestic email services like QQ/163: Must use domestic proxy exit, direct connection not allowed (for overseas VPS)
    • Code includes built-in ssl_context + 3 retries + 2s backoff

Encoding Issues

  • Symptoms:
    LookupError: unknown encoding: unknown-8bit
  • Solution:
    _parse_email
    has try/except fallback to decode with utf-8

Timeout Issues

  • Symptoms:
    check_email.py
    is killed by SIGKILL
  • Solutions: Skip
    test_connection
    , reduce limit to 10, use
    headers_only=True
Created: 2026-02-19 Updated: 2026-02-24 Version: 1.1.0