Install
openclaw skills install @tobewin/emailbox职业邮箱收发与数据处理一体化工具。IMAP/SMTP protocol for 12+ providers (Gmail/Outlook/QQ/163/Yahoo/iCloud etc). Send/receive/search/schedule emails, HTML templates, attachments, forwarding, data integration. 邮件收发、搜索、定时发送、附件、HTML模板、转发、文档数据联动。
openclaw skills install @tobewin/emailboxIMAP/SMTP-based email toolkit supporting 12+ providers. Send, receive, search, forward, schedule emails with HTML templates, attachments, and document data integration.
⚠️ 数据外发提醒:邮件内容(收件人、主题、正文、附件)通过 IMAP/SMTP 协议直接发送至邮件服务商服务器。涉及发票、合同、简历等敏感数据时,请在发送前确认收件人正确。
⚠️ 凭据安全:邮箱授权码等同于密码。环境变量可能通过 shell history、进程列表、CI 日志泄露。每次使用完后建议
unset EMAIL_AUTH。
# Set 2 environment variables and you're ready
export EMAIL_ADDRESS="your@qq.com"
export EMAIL_AUTH="your_authorization_code"
⚠️
export设置的变量在当前 shell 及所有子进程可见(包括 ps 命令、CI 日志、崩溃报告)。 用完建议unset EMAIL_AUTH,或使用.env文件 +source替代一次性 export。
# QQ Mail
export EMAIL_QQ="your@qq.com"
export EMAIL_QQ_AUTH="qq_auth_code"
# 163 Mail
export EMAIL_163="your@163.com"
export EMAIL_163_AUTH="163_client_password"
# Gmail
export EMAIL_GMAIL="your@gmail.com"
export EMAIL_GMAIL_AUTH="gmail_app_password"
How to get authorization codes for each provider → references/providers.md
⚠️ 授权码等同于邮箱密码,拥有它可以收发你的所有邮件。不要分享给他人,不要在公共终端设置。
IMPORTANT: Never store email credentials in plaintext files. Use your system's secure credential manager or session-only environment variables.
# Option A: Session-only (recommended for security)
# Set environment variables in your current shell session only.
# Credentials will NOT persist after the session ends.
export EMAIL_ADDRESS="your@qq.com"
export EMAIL_AUTH="your_auth_code"
# Option B: Keychain / secret manager
# macOS: Use `security add-internet-password`
# Linux: Use `secret-tool store` (libsecret)
# Windows: Use Windows Credential Manager
# Option C: Restricted file (if persistent config is required)
# Create a file with restricted permissions that only you can read:
mkdir -p ~/.emailbox && touch ~/.emailbox/credentials
chmod 600 ~/.emailbox/credentials
# Then add your credentials:
# EMAIL_ADDRESS=your@qq.com
# EMAIL_AUTH=your_auth_code
#
# Before running emailbox commands:
# source ~/.emailbox/credentials
python3 scripts/send_mail.py \
--to "recipient@example.com" \
--subject "Project Update" \
--body "Hi, here is the project update..." \
--provider qq
python3 scripts/send_mail.py \
--to "boss@company.com,team@company.com" \
--cc "hr@company.com" \
--bcc "archive@company.com" \
--subject "Weekly Report" \
--body "Please find the weekly report attached." \
--provider 163
Choose a template from references/templates.md, fill in variables, save as HTML, then:
python3 scripts/send_mail.py \
--to "client@company.com" \
--subject "Sales Report - 2026W16" \
--body-file "${OPENCLAW_WORKSPACE:-$PWD}/.emailbox_body.txt" \
--html-file "${OPENCLAW_WORKSPACE:-$PWD}/.emailbox_body.html" \
--provider outlook
python3 scripts/send_mail.py \
--to "finance@company.com" \
--subject "Invoice - FP20260418001" \
--body "Please find the invoice attached." \
--attach "/path/to/invoice.jpg" "/path/to/detail.xlsx" \
--provider qq
python3 scripts/send_mail.py \
--to "manager@company.com" \
--subject "URGENT: Contract Review" \
--body "Please review the attached contract ASAP." \
--importance high \
--receipt \
--provider outlook
First get the Message-ID from reading an email (Step 3), then:
python3 scripts/send_mail.py \
--to "sender@example.com" \
--subject "Re: Original Subject" \
--body "Got it, confirmed." \
--reply-to "<msgid@example.com>" \
--provider qq
First get the original email metadata (Step 4), then:
python3 scripts/send_mail.py \
--to "colleague@company.com" \
--subject "Fwd: Original Subject" \
--body "Please see the forwarded message below." \
--forward-from "Original Sender <sender@example.com>" \
--forward-date "Mon, 18 Apr 2026 10:30:00 +0800" \
--forward-subject "Original Subject" \
--forward-to "me@company.com" \
--provider qq
python3 scripts/receive_mail.py --list
python3 scripts/receive_mail.py --list --count 20
python3 scripts/receive_mail.py --list --provider gmail
python3 scripts/receive_mail.py --list --folder "Sent Items"
python3 scripts/receive_mail.py --read 123 --provider qq
python3 scripts/receive_mail.py --read 123 --download-attachment 123 \
--save-dir "${OPENCLAW_WORKSPACE:-$PWD}/downloads"
# Search by keyword (searches subject, from, AND body)
python3 scripts/receive_mail.py --search "contract" --provider qq
# Search by sender
python3 scripts/receive_mail.py --search "" --from-filter "zhangsan@company.com"
# Search by date range
python3 scripts/receive_mail.py --search "report" --since "2026-04-01"
# Combined search
python3 scripts/receive_mail.py --search "invoice" --from-filter "finance@company.com" --since "2026-04-01" --count 5
Access folders beyond INBOX:
python3 scripts/receive_mail.py --list --folder "Sent Items"
python3 scripts/receive_mail.py --list --folder "Drafts"
python3 scripts/receive_mail.py --list --folder "Trash"
Common folder names:
[Gmail]/Sent Mail, [Gmail]/Drafts, [Gmail]/SpamSent Messages, Drafts, Deleted MessagesSent, Drafts, DeletedSentItems, Drafts, Deleted# Step 1: Get original email metadata
python3 scripts/receive_mail.py --forward 123 --provider qq
# Output includes FORWARD_META with From/To/CC/Date/Subject/Message-ID
# Step 2: Forward using the metadata
python3 scripts/send_mail.py \
--to "colleague@company.com" \
--subject "Fwd: Original Subject" \
--body "FYI, please see below." \
--forward-from "Original Sender <sender@example.com>" \
--forward-date "Mon, 18 Apr 2026 10:30:00 +0800" \
--forward-subject "Original Subject" \
--forward-to "me@company.com" \
--provider qq
Combine other Skills' output with email sending.
Detailed workflows → references/integrations.md
1. Excel → Email: Read data → HTML table → send
2. OCR → Email: Recognize invoice → extract key info → send
3. PDF → Email: Process PDF → summary + attachment → send
4. Data Analysis → Email: Analyze data → conclusions → send
5. Scheduled Report: Generate content → schedule → send
# Step 1: Read and format data (use excel-studio or python3)
# Step 2: Save HTML content using a template from references/templates.md
# Step 3: Send
python3 scripts/send_mail.py \
--to "boss@company.com" \
--subject "Sales Report $(date +%Y%m%d)" \
--body-file "${OPENCLAW_WORKSPACE:-$PWD}/.emailbox_body.txt" \
--html-file "${OPENCLAW_WORKSPACE:-$PWD}/.emailbox_body.html" \
--attach "/path/to/report.xlsx" \
--provider qq
| Skill | Integration | Scenario |
|---|---|---|
| china-doc-ocr | OCR → email content | Invoice/contract recognition then email |
| excel-studio | Excel → table email | Data reports, financial statements |
| pdf-studio | PDF → email attachment | PDF report sending |
| data-analyzer | Analysis → email conclusions | Data insight notifications |
python3 scripts/schedule_mail.py \
--schedule --at "2026-04-19 09:00" \
--to "boss@company.com" \
--subject "Daily Report - 2026-04-19" \
--body "Today's work summary..." \
--provider qq
python3 scripts/schedule_mail.py \
--schedule --in 30 \
--to "client@example.com" \
--subject "Follow up" \
--body "Following up on our meeting..." \
--provider 163
# View scheduled emails
python3 scripts/schedule_mail.py --list-scheduled
# Cancel a scheduled email
python3 scripts/schedule_mail.py --cancel SCHEDULE_ID
# Manually process due emails
python3 scripts/schedule_mail.py --process-queue
⚠️ The schedule script will NEVER modify your crontab automatically. You must manually confirm any crontab changes.
# Step 1: Check your current crontab first
crontab -l > ~/crontab_backup.txt
# Step 2: Add the emailbox processor manually (review before adding!)
# Add this line to your crontab ONLY if you want auto-processing:
# * * * * * python3 /path/to/emailbox/scripts/schedule_mail.py --process-queue
# Step 3: To remove later, edit your crontab and remove the line
7 professional templates available → references/templates.md
| Template | Use Case |
|---|---|
| Business Report | Data reports, financial summaries |
| Meeting Invitation | Meetings, events, interviews |
| Notification / Announcement | Company announcements, system alerts |
| Thank You Letter | Appreciation, follow-ups |
| Weekly/Daily Report | Work progress updates |
| Invoice Notification | Invoice/receipt processing |
| Formal Letter | Official correspondence |
12+ providers with IMAP/SMTP config and auth code guides → references/providers.md
| Provider | IMAP | SMTP | Port | Auth | China |
|---|---|---|---|---|---|
| QQ Mail | imap.qq.com | smtp.qq.com | 465 | Authorization code | Yes |
| 163 Mail | imap.163.com | smtp.163.com | 465 | Client password | Yes |
| 126 Mail | imap.126.com | smtp.126.com | 465 | Client password | Yes |
| Sina | imap.sina.com | smtp.sina.com | 465 | Enable IMAP | Yes |
| Outlook | outlook.office365.com | smtp.office365.com | 587 | App password | Yes |
| Gmail | imap.gmail.com | smtp.gmail.com | 587 | App password | VPN |
| Yahoo | imap.mail.yahoo.com | smtp.mail.yahoo.com | 587 | App password | VPN |
| iCloud | imap.mail.me.com | smtp.mail.me.com | 587 | App password | VPN |
| Tencent Exmail | imap.exmail.qq.com | smtp.exmail.qq.com | 465 | Enable IMAP | Yes |
| Ali Mail | imap.mxhichina.com | smtp.mxhichina.com | 465 | Enable IMAP | Yes |
| Huawei | imap.mail.hicloud.com | smtp.mail.hicloud.com | 465 | App password | Yes |
| 139 Mail | imap.mail.139.com | smtp.mail.139.com | 465 | Enable IMAP | Yes |
Error → Solution
──────────────────────────────────────────────────────────
SMTP auth failed → Check authorization code, see providers.md
IMAP connection failed → Verify IMAP enabled, check network
Connection timeout → Gmail/Yahoo/iCloud need VPN in China
SMTP auth code error (QQ/163) → Use authorization code, NOT login password
Sending rate limit → QQ: 1/min, 500/day; 163: 200/day; Gmail: 500/day
Attachment too large → QQ: 50MB; Gmail: 25MB; Outlook: 20MB
IMAP not enabled → Enable in email settings, see providers.md
163 requires phone verification → Verify via SMS, wait 5-10 minutes
ps aux)、CI 日志、崩溃报告泄露unset EMAIL_AUTH 清除当前 shell 的凭据~/.emailbox/queue/ — review and clean up regularly~/.emailbox/queue/; processing requires manual crontab setup