email-diagnose
Diagnose and fix OpenClaw email channel issues by analyzing logs, matching failure patterns, and guiding users through fixes. Use when user reports: email not received, email not sent/replied, connection errors, SMTP failures, IMAP disconnects, whitelist issues, A2A filtering problems, or asks to troubleshoot/debug email channel. Triggers on /email-diagnose and phrases like 'email broken', 'email not working', 'why no email reply', 'email channel down'. Covers log analysis, auto-fix suggestions, performance metrics, and feedback escalation via mail-cli to claw.feedback@claw.163.com.
How do I install this agent skill?
npx skills add https://claw.163.com --skill email-diagnoseIs this agent skill safe to install?
No partner audit is available yet. Read the source before installing.
What does this agent skill do?
Email Channel Diagnostics
Stage 1: Collect data
Run the diagnostic script against OpenClaw logs:
node scripts/diagnose.mjs --date YYYY-MM-DD [--account id] [--verbose] [--logdir path]
Parameters:
--date— Log date (default: today). Format:YYYY-MM-DD--account— Filter to a specific account ID (e.g.,default,worker)--verbose— Include full timeline in output--logdir— Log directory (default:/tmp/openclaw)
Stage 2: Analyze report
Read the JSON output and analyze in this priority order:
-
errors[]— Check each error entry. Matchtagandmessageagainst the patterns inreferences/troubleshooting.md. -
byTag— High error/warn counts identify the broken subsystem:Common (both transports):
EMAIL-ACCOUNT→ config issuesEMAIL-MONITOR→ monitoring/receiving issuesEMAIL-CHANNEL→ routing/dispatch issuesEMAIL-A2A→ agent filtering issuesEMAIL-PARSER→ attachment issues
IMAP transport:
EMAIL-IMAP→ connection/auth issuesEMAIL-SMTP→ sending issuesUID-STORE→ state tracking issues
WS transport:
EMAIL-WS→ WebSocket connection issuesEMAIL-IM→ IM protocol issuesEMAIL-TOKEN→ token auth issuesEMAIL-SDK→ SDK fetch/send issues
-
warns[]— May indicate developing problems (reconnects, whitelist rejections) -
perf— Performance anomalies:IMAP transport:
smtpFailCount > 0→ SMTP sending brokenimapReconnectCount > 5→ unstable IMAP connection
WS transport:
wsReconnectCount > 5→ unstable WebSocket connectiontokenFailCount > 0→ token auth brokensdkFetchFailCount > 0→ SDK fetch brokenimAuthFailCount > 0→ IM authentication broken
Both transports:
emailsRejected / emailsProcessed > 50%→ whitelist too strict
-
timeline(verbose only) — Trace the full event flow for a specific email
Match the issue to a troubleshooting pattern. Read references/troubleshooting.md for the matching pattern number.
Stage 3: Present findings and guide fix
Present the diagnosis to the user:
- Summarize what's wrong in plain language (not log tags)
- Identify which troubleshooting pattern applies
- Walk through fix steps from
references/troubleshooting.md - For common fixes, offer to execute (with user confirmation):
- Config field missing → show exact JSON path and field to add
- UID store reset →
rm ~/.openclaw/email/uid-store/<accountId>.json - Whitelist adjustment → show the
allowFromconfig to modify - Restart gateway →
systemctl --user restart openclaw-gateway
Stage 4: Escalate if unresolved
If the user confirms the issue is not resolved after fix attempts:
- Ask: "Would you like to package the diagnostic logs and send them to claw.feedback@claw.163.com for the support team?"
- Warn: "The log package may contain email addresses and account IDs. Review before sending."
- If user agrees — try mail-cli first:
# Package logs TIMESTAMP=$(date +%Y%m%d-%H%M%S) tar czf /tmp/email-diag-${TIMESTAMP}.tar.gz \ /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log # Send via mail-cli (use absolute paths for --attach) mail-cli compose send \ --to "claw.feedback@claw.163.com" \ --subject "[Email-Diag] <brief issue summary>" \ --body "<diagnosis summary and steps tried>" \ --attach /tmp/email-diag-${TIMESTAMP}.tar.gz - If mail-cli not available or send fails:
- Tell user the tar.gz path:
/tmp/email-diag-<timestamp>.tar.gz - Ask them to manually email it to
claw.feedback@claw.163.com - Include the diagnosis summary in the email body
- Tell user the tar.gz path:
Quick reference: log tags
| Tag | Subsystem | Key events | Transport |
|---|---|---|---|
EMAIL-ACCOUNT | Config resolution | Account resolved, missing fields | Both |
EMAIL-MONITOR | Email monitoring | Starting monitoring, new email, processing | Both |
EMAIL-CHANNEL | Message dispatch | Received email, route resolved, reply sent | Both |
EMAIL-A2A | Agent detection | Agent detected, filtered, turn exceeded | Both |
EMAIL-PARSER | Email parsing | Attachment filename rejected, save failed | Both |
EMAIL-IMAP | IMAP connection | Connected, disconnected, markSeen | IMAP only |
EMAIL-SMTP | Email sending | Send started/succeeded/failed, duration | Both |
UID-STORE | State tracking | UID read/write, directory errors | IMAP only |
EMAIL-WS | WebSocket connection | Connected, disconnected, auth failed | WS only |
EMAIL-IM | IM protocol | CONNECT, RECV, encryption, heartbeat | WS only |
EMAIL-TOKEN | Token management | Fetching, success, failed, expired | WS only |
EMAIL-SDK | SDK mail fetch | Fetching, parsed, attachment download | WS only |
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/claw.163.com/email-diagnose">View email-diagnose on skillZs</a>