๐ŸŽ Get the FREE AI Skills Starter Guide โ€” Subscribe โ†’
BytesAgainBytesAgain
๐Ÿฆ€ ClawHub

Email Bridge

by @ryanchan720

Email management skill for AI assistants with real-time notifications, smart categorization (7 categories), verification code extraction, and HTML content sa...

TERMINAL
clawhub install email-bridge

๐Ÿ“– About This Skill


name: email-bridge description: Email management skill for AI assistants with real-time notifications, smart categorization (7 categories), verification code extraction, and HTML content sanitization. Supports Gmail, QQ Mail, and NetEase. homepage: https://github.com/ryanchan720/email-bridge source: https://github.com/ryanchan720/email-bridge version: 0.6.3

Email Bridge Skill

Email management skill for OpenClaw. Provides real-time email monitoring with smart categorization and clean notifications for AI assistants.

Features

  • Real-time notifications: IMAP IDLE (QQ/NetEase) + polling (Gmail)
  • Smart categorization: 7 categories with subject-only classification
  • Verification code extraction: Context-aware, low false positive rate
  • HTML content sanitization: Clean text from HTML emails, remove invisible chars
  • Prompt injection protection: Safe email content for AI processing
  • Multi-provider support: Gmail (API), QQ Mail (IMAP), NetEase (IMAP)
  • Installation

    cd skills/email-bridge
    pip install -e .
    

    Setup (Manual CLI Required)

    โš ๏ธ Security Note: Do NOT share authorization codes in chat. Configure accounts via CLI only.

    # Add account (prompts for authorization code securely)
    email-bridge accounts add your@qq.com -p qq

    Sync emails

    email-bridge sync

    Start daemon for real-time notifications

    email-bridge daemon start -d

    Getting Authorization Codes

    QQ Mail: https://service.mail.qq.com/detail/0/75 (send SMS, get 16-char code)

    NetEase (163/126): Settings โ†’ POP3/SMTP/IMAP โ†’ Enable โ†’ Get code

    Gmail: Requires OAuth setup (see README.md)

    Capabilities

  • Receive emails: Sync and read emails from configured accounts
  • Send emails: Send emails via SMTP
  • Real-time notifications: Push to OpenClaw via openclaw system event
  • Smart categorization: 7 categories with keyword-based classification
  • Verification code extraction: Context-aware extraction with low false positives
  • Link extraction: Extract action links from emails
  • HTML sanitization: Clean text extraction with invisible char removal
  • Prompt injection protection: Sanitize email content for safe AI processing
  • Email Categories

    Subject-only classification for fast, reliable categorization:

    | Category | Icon | Description | Example Keywords | |----------|------|-------------|------------------| | verification | ๐Ÿ” | Verification codes, activation | ้ชŒ่ฏ็ , OTP, activate, ็ป‘ๅฎš้‚ฎ็ฎฑ | | security | โš ๏ธ | Security alerts, login warnings | ๅฎ‰ๅ…จๆ้†’, security alert, ๅฏ†็ ไฟฎๆ”น | | transactional | ๐Ÿ“ฆ | Orders, payments, shipping | ่ฎขๅ•็กฎ่ฎค, receipt, ๅ‘่ดง้€š็Ÿฅ | | promotion | ๐ŸŽ | Marketing, promotions, rewards | ๅฅ–ๅŠฑ, ไผ˜ๆƒ , promo, discount | | subscription | ๐Ÿ“ฐ | Newsletters, digests | newsletter, ่ฎข้˜…, weekly digest | | spam_like | ๐Ÿšซ | Suspected spam | ไธญๅฅ–, FREE, click here now | | normal | โ€” | Regular email | (default) |

    Trigger Keywords

    Chinese: ้‚ฎ็ฎฑใ€้‚ฎไปถใ€ๅ‘้‚ฎไปถใ€ๆŸฅ็œ‹้‚ฎไปถใ€้ชŒ่ฏ็ ใ€QQ้‚ฎ็ฎฑใ€Gmail

    English: email, mail, send email, check email, verification code

    Common Commands

    # List recent emails
    email-bridge messages list -n 10

    Get verification codes from recent emails

    email-bridge codes

    Send email

    email-bridge send -a -t recipient@example.com -s "Subject" -b "Body"

    Daemon management

    email-bridge daemon status email-bridge daemon stop

    Configuration

    Configuration file: ~/.email-bridge/config.json

    Default configuration (auto-generated, minimal):

    {
      "daemon": {
        "poll_interval": 300,
        "notify_openclaw": true
      }
    }
    

    Full configuration with all options (customize as needed):

    {
      "daemon": {
        "poll_interval": 300,
        "notify_openclaw": true,
        "notification": {
          "include_body": false,
          "body_max_length": 500,
          "include_verification_codes": true,
          "include_links": false
        }
      }
    }
    

    Notification Options

    | Option | Default | Description | |--------|---------|-------------| | include_body | false | Include email body preview in notifications | | body_max_length | 500 | Max characters for body preview | | include_verification_codes | true | Auto-extract and show verification codes | | include_links | false | Include action links (verify/reset) |

    Notifications

    When new emails arrive, the daemon sends formatted notifications:

    ๐Ÿ“ง ๆ–ฐ้‚ฎไปถ: account@qq.com

    1. ๐Ÿ” Google ๆ‚จ็š„้ชŒ่ฏ็  โœจ ้ชŒ่ฏ็ : 123456

    2. โš ๏ธ Microsoft ็™ปๅฝ•ๆ้†’ ๐Ÿ“ We noticed a new sign-in...

    3. ๐ŸŽ OKX 150 USDT ๅฅ–ๅŠฑ็ญ‰ๆ‚จๆ‹ฟ ๐Ÿ“ ไบฒ็ˆฑ็š„ๆฌงๆ˜“็”จๆˆท๏ผŒๆฌงๆ˜“่ฏš้‚€ๆ‚จๅŠ ๅ…ฅ้‚€่ฏทๅฅฝๅ‹่ฎกๅˆ’...

    HTML Content Processing

    HTML-only emails are processed through:

    1. Tag stripping: Remove