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...
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
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 qqSync emails
email-bridge syncStart 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
openclaw system eventEmail 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 10Get verification codes from recent emails
email-bridge codesSend 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.com1. ๐ 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 , , and all HTML tags
2. Entity decoding: Convert HTML entities to text
3. Invisible char removal: Remove zero-width spaces, BOM, etc.
4. Whitespace normalization: Clean up spacing
5. Prompt injection protection: Remove dangerous patterns
Example: HTML with invisible chars โ Clean readable text
Security Features
Data Storage
All data stored locally at ~/.email-bridge/:
~/.email-bridge/
โโโ email_bridge.db # SQLite database (accounts, messages)
โโโ config.json # Configuration file
โโโ daemon.pid # Daemon process ID
โโโ daemon.log # Logs
โโโ gmail/
โโโ credentials.json # OAuth credentials
โโโ token_*.json # OAuth tokens
โ ๏ธ Credentials are stored unencrypted. Protect this directory.
Revoking Access
# Stop daemon
email-bridge daemon stopRemove all stored data
rm -rf ~/.email-bridgeFor Gmail: revoke at https://myaccount.google.com/permissions
For QQ/NetEase: regenerate authorization codes in email settings
Dependencies
All from PyPI:
Security Notes
1. Never share authorization codes in chat - use CLI interactively
2. Credentials stored unencrypted - protect ~/.email-bridge/ directory
3. Email content is sanitized - prompt injection protection enabled
4. Daemon runs with user privileges - no elevated access needed
5. Subject-only classification - privacy-conscious processing
Changelog
v0.6.2
v0.6.1
v0.6.0
sanitize_for_notification()v0.5.7
โ๏ธ 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) |