/SKILL.md
# Email Channel Plugin for OpenClaw This plugin enables OpenClaw to send and receive emails as a communication channel, similar to Telegram or Discord channels. ## Features - **IMAP Integration**: Monitor email inbox for new messages in real-time - **SMTP Integration**: Send emails with attachments and HTML support - **Thread Support**: Handle email conversations with proper threading (in-reply-to, references) - **Attachment Handling**: Process and save email attachments - **IMAP IDLE Support
npx skillsauth add aibot505/openclaw-email-channel openclaw-email-channelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This plugin enables OpenClaw to send and receive emails as a communication channel, similar to Telegram or Discord channels.
Ensure Node.js 22 or higher is installed:
node --version # Should be 22.x or higher
Install dependencies:
npm install imap mailparser nodemailer
Configure environment variables (see Configuration section)
Run the plugin:
node email-channel-plugin.js
Add to your OpenClaw configuration file (~/.openclaw/config.json):
{
"channels": {
"email": {
"enabled": true,
"type": "external",
"command": "node",
"args": ["/path/to/email-channel-plugin.js"],
"env": {
"IMAP_HOST": "imap.gmail.com",
"IMAP_PORT": "993",
"IMAP_USER": "[email protected]",
"IMAP_PASSWORD": "your-app-password",
"SMTP_HOST": "smtp.gmail.com",
"SMTP_PORT": "587",
"SMTP_USER": "[email protected]",
"SMTP_PASSWORD": "your-app-password",
"EMAIL_ADDRESS": "[email protected]",
"MARK_SEEN": "true",
"SAVE_ATTACHMENTS": "false",
"ATTACHMENTS_DIR": "./attachments",
"IMAP_KEEPALIVE_INTERVAL": "300000",
"IMAP_IDLE_INTERVAL": "60000",
"IMAP_FORCE_NOOP": "true"
}
}
}
}
| Variable | Description | Default | Example |
|----------|-------------|---------|---------|
| IMAP_HOST | IMAP server hostname | - | imap.gmail.com |
| IMAP_PORT | IMAP server port | 993 | 993 |
| IMAP_USER | Email username | - | [email protected] |
| IMAP_PASSWORD | Email password/app password | - | your-app-password |
| IMAP_TLS | Use TLS for IMAP | true | true |
| SMTP_HOST | SMTP server hostname | - | smtp.gmail.com |
| SMTP_PORT | SMTP server port | 587 | 587 |
| SMTP_USER | SMTP username | - | [email protected] |
| SMTP_PASSWORD | SMTP password/app password | - | your-app-password |
| SMTP_SECURE | Use SSL/TLS for SMTP | false | false |
| EMAIL_ADDRESS | Sender email address | - | [email protected] |
| MARK_SEEN | Mark emails as read | true | true |
| SAVE_ATTACHMENTS | Save attachments to disk | false | true |
| ATTACHMENTS_DIR | Directory for attachments | ./attachments | /tmp/email-attachments |
| IMAP_KEEPALIVE_INTERVAL | Keepalive interval in ms (NOOP) | 300000 | 300000 |
| IMAP_IDLE_INTERVAL | IDLE timeout in ms | 60000 | 60000 |
| IMAP_FORCE_NOOP | Force NOOP instead of IDLE | true | true |
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
[email protected]
IMAP_PASSWORD=your-app-password # Use app password, not regular password
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
[email protected]
SMTP_PASSWORD=your-app-password
[email protected]
# IMAP IDLE settings for real-time notifications
IMAP_KEEPALIVE_INTERVAL=300000
IMAP_IDLE_INTERVAL=60000
IMAP_FORCE_NOOP=true
IMAP_HOST=outlook.office365.com
IMAP_PORT=993
SMTP_HOST=smtp.office365.com
SMTP_PORT=587
IMAP_HOST=imap.mail.yahoo.com
IMAP_PORT=993
SMTP_HOST=smtp.mail.yahoo.com
SMTP_PORT=587
The plugin automatically monitors your inbox and forwards emails to OpenClaw as messages with channel: "email".
Example received message format:
{
"channel": "email",
"type": "email",
"data": {
"id": "[email protected]",
"from": {
"address": "[email protected]",
"name": "John Doe"
},
"to": [
{
"address": "[email protected]",
"name": "Jane Smith"
}
],
"subject": "Test Email",
"text": "Hello, this is a test email.",
"html": "<p>Hello, this is a test email.</p>",
"date": "2026-01-01T12:00:00.000Z",
"attachments": [],
"headers": {},
"inReplyTo": null,
"references": null
}
}
From within an OpenClaw agent session:
await message({
action: "send",
channel: "email",
to: "[email protected]",
subject: "Hello from OpenClaw",
text: "This is a test email sent via OpenClaw",
html: "<p>This is a test email sent via <b>OpenClaw</b></p>"
});
await message({
action: "send",
channel: "email",
to: "[email protected]",
cc: ["[email protected]", "[email protected]"],
bcc: "[email protected]",
subject: "Meeting Notes",
text: "Here are the meeting notes from today."
});
await message({
action: "send",
channel: "email",
to: "[email protected]",
subject: "Report with attachment",
text: "Please find the report attached.",
attachments: [
{
filename: "report.pdf",
path: "/path/to/report.pdf"
},
{
filename: "data.csv",
content: "name,age\nJohn,30\nJane,25"
}
]
});
await message({
action: "send",
channel: "email",
to: "[email protected]",
subject: "Re: Previous conversation",
text: "Here's my response to your email.",
inReplyTo: "<[email protected]>",
references: "<[email protected]> <[email protected]>"
});
// Auto-respond to help requests
if (message.channel === "email" && message.data.text.includes("help")) {
await message({
action: "send",
channel: "email",
to: message.data.from.address,
subject: `Re: ${message.data.subject}`,
text: "Thanks for your message! Here's how I can help...",
inReplyTo: message.data.id
});
}
// Send system notifications via email
async function sendEmailAlert(alert) {
await message({
action: "send",
channel: "email",
to: "[email protected]",
subject: `ALERT: ${alert.type}`,
text: `Alert detected: ${alert.message}\nTime: ${new Date().toISOString()}`,
html: `<h2>Alert: ${alert.type}</h2><p>${alert.message}</p><p>Time: ${new Date().toISOString()}</p>`
});
}
// Forward important emails to Telegram
if (message.channel === "email" && message.data.subject.includes("URGENT")) {
await message({
action: "send",
channel: "telegram",
to: "chat:123456789",
text: `📧 URGENT Email from ${message.data.from.address}:\n\nSubject: ${message.data.subject}\n\n${message.data.text.substring(0, 200)}...`
});
}
telnet host portDEBUG=*Enable detailed logging:
DEBUG=* node email-channel-plugin.js
Or set specific debug categories:
DEBUG=imap*,smtp* node email-channel-plugin.js
Check OpenClaw logs:
openclaw logs --follow
Or check plugin logs (if configured to log to file):
tail -f /var/log/openclaw-email-channel.log
git clone https://github.com/aibot505/openclaw-email-channel.git
cd openclaw-email-channel
npm install
npm run build # If TypeScript version exists
# Run unit tests
npm test
# Run integration tests (requires test email account)
npm run test:integration
MIT License - See LICENSE file for details.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.