OpenClaw Email Manager for Postfic and Dovecot
/install email-manager
\r \r
Email Manager Skill\r
\r This skill provides complete email management using your Postfix/Dovecot infrastructure.\r \r
📋 Configuration\r
\r
Edit config.json in the skill directory:\r
\r
{\r
"email_address": "[email protected]",\r
"email_password": "your-password",\r
"imap_server": "mail.yourdomain.com",\r
"smtp_server": "mail.yourdomain.com"\r
}\r
```\r
\r
## 📨 Available Operations\r
\r
### List folders\r
```bash\r
python3 scripts/imap_utils.py list-folders\r
python3 scripts/imap_utils.py list-folders --output json\r
```\r
\r
**Example output:**\r
```\r
📁 Available folders:\r
• Drafts 📝 DRAFTS\r
• Sent 📤 SENT\r
• Trash 🗑️ TRASH\r
• Junk 📧 SPAM\r
• INBOX 📥 INBOX\r
• Archive\r
• Projects/ClientA\r
```\r
\r
### List emails\r
```bash\r
python3 scripts/imap_utils.py list --folder INBOX --limit 10\r
python3 scripts/imap_utils.py list --flagged-only --output json\r
```\r
\r
### Read email\r
```bash\r
python3 scripts/imap_utils.py read --message-id 1234\r
python3 scripts/imap_utils.py read --message-id 1234 --output json\r
```\r
\r
### Save draft\r
```bash\r
python3 scripts/imap_utils.py save-draft \\r
--to "[email protected]" \\r
--subject "Draft subject" \\r
--body "Draft content"\r
```\r
\r
### List drafts\r
```bash\r
python3 scripts/imap_utils.py list-drafts\r
python3 scripts/imap_utils.py list-drafts --output json\r
```\r
\r
### Update draft\r
```bash\r
python3 scripts/imap_utils.py update-draft \\r
--draft-id 1234 \\r
--subject "Updated subject" \\r
--body "Updated content"\r
```\r
\r
### Send email\r
```bash\r
python3 scripts/smtp_utils.py send \\r
--to "[email protected]" \\r
--subject "Test" \\r
--body "Hello"\r
```\r
\r
### Send draft\r
```bash\r
python3 scripts/smtp_utils.py send-draft --draft-id 1234\r
```\r
\r
### Flag/star email\r
```bash\r
python3 scripts/imap_utils.py flag --message-id 1234 --add\r
python3 scripts/imap_utils.py flag --message-id 1234 --remove\r
python3 scripts/imap_utils.py list --flagged-only\r
```\r
\r
### Move email\r
```bash\r
python3 scripts/imap_utils.py move \\r
--message-id 1234 \\r
--from-folder INBOX \\r
--to-folder Projects\r
```\r
\r
### Create folder\r
```bash\r
python3 scripts/imap_utils.py create-folder --name "NewFolder"\r
```\r
\r
### Delete email\r
```bash\r
python3 scripts/imap_utils.py delete --message-id 1234\r
```\r
\r
### Empty trash\r
```bash\r
python3 scripts/imap_utils.py empty-trash\r
```\r
\r
### Search emails\r
```bash\r
python3 scripts/imap_utils.py search --query "FROM [email protected]"\r
python3 scripts/imap_utils.py search --query "subject:meeting" --output json\r
```\r
\r
### Spam operations\r
```bash\r
# List spam\r
python3 scripts/imap_utils.py list-spam\r
python3 scripts/imap_utils.py list-spam --output json\r
\r
# Mark as spam\r
python3 scripts/imap_utils.py mark-spam --message-id 1234\r
python3 scripts/imap_utils.py mark-spam --message-id 1234 --from-folder INBOX\r
\r
# Mark as not spam\r
python3 scripts/imap_utils.py mark-ham --message-id 1234\r
python3 scripts/imap_utils.py mark-ham --message-id 1234 --from-folder Junk\r
\r
# Empty spam folder\r
python3 scripts/imap_utils.py empty-spam\r
```\r
\r
## 🔍 Folder Auto-Detection\r
\r
The skill automatically detects folder names for:\r
- **Inbox:** INBOX, Inbox\r
- **Drafts:** Drafts, INBOX.Drafts, Draft\r
- **Sent:** Sent, Sent Messages, INBOX.Sent\r
- **Trash:** Trash, Deleted, INBOX.Trash\r
- **Junk/Spam:** Junk, Spam, INBOX.Junk, INBOX.Spam, Bulk\r
- **Archive:** Archive, Archives, INBOX.Archive\r
\r
## 📁 Folder Name Handling\r
\r
The skill cleans up folder names for display by removing IMAP flags like `\HasNoChildren` and quotes. For raw folder data with flags:\r
\r
```bash\r
python3 scripts/imap_utils.py list-folders --output json\r
```\r
\r
**Example JSON output:**\r
```json\r
[\r
{\r
"name": "Drafts",\r
"delimiter": "/",\r
"flags": ["\\HasNoChildren", "\\Drafts"]\r
}\r
]\r
```\r
\r
## 🤖 AI Usage Examples\r
\r
Always use `--output json` when parsing results:\r
\r
```bash\r
# List drafts and find specific one\r
drafts=$(python3 scripts/imap_utils.py list-drafts --output json)\r
# Parse JSON to find draft by subject\r
\r
# Send the draft\r
python3 scripts/smtp_utils.py send-draft --draft-id $ID\r
\r
# Check spam count\r
spam=$(python3 scripts/imap_utils.py list-spam --output json)\r
\r
# Get folder metadata\r
folders=$(python3 scripts/imap_utils.py list-folders --output json)\r
```\r
\r
## ✅ Testing\r
\r
Test your configuration:\r
\r
```bash\r
python3 scripts/imap_utils.py list-folders\r
python3 scripts/imap_utils.py list --limit 5\r
python3 scripts/imap_utils.py list-spam\r
```\r
\r
All operations are non-interactive and suitable for automation.\r
\r
## 🚀 Setup Instructions\r
\r
```bash\r
# 1. Create skill directory\r
mkdir -p ~/OpenClaw-Workspace/skills/email-manager/scripts\r
cd ~/OpenClaw-Workspace/skills/email-manager\r
\r
# 2. Create config.json\r
cat > config.json \x3C\x3C 'EOF'\r
{\r
"email_address": "[email protected]",\r
"email_password": "your-password",\r
"imap_server": "mail.yourdomain.com",\r
"imap_port": 993,\r
"smtp_server": "mail.yourdomain.com",\r
"smtp_port": 465,\r
"folders": {\r
"drafts": "Drafts",\r
"sent": "Sent",\r
"trash": "Trash",\r
"junk": "Junk"\r
}\r
}\r
EOF\r
\r
# 3. Make scripts executable\r
chmod +x scripts/*.py\r
\r
# 4. Test it!\r
python3 scripts/imap_utils.py list-folders\r
```\r
\r
## 📝 Common Spam Folder Names\r
\r
Different Dovecot configurations use different spam folder names:\r
- Junk (most common)\r
- Spam\r
- INBOX.Junk\r
- INBOX.Spam\r
- Bulk\r
- Junk E-mail\r
\r
Set it explicitly in `config.json` if auto-detection doesn't work:\r
\r
```json\r
{\r
"folders": {\r
"junk": "INBOX.Junk"\r
}\r
}\r
```\r
\r
## 🎯 Key Benefits\r
\r
- ✅ Zero dependencies - Uses only Python standard library\r
- ✅ No virtualenv needed - Works with system Python\r
- ✅ JSON config - Easy to edit, no parsing libraries needed\r
- ✅ Non-interactive - Perfect for AI automation\r
- ✅ Full feature set - Drafts, send, folders, flags, move, delete, spam\r
- ✅ Debian/Ubuntu compatible - No "externally-managed-environment" errors\r
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install email-manager - After installation, invoke the skill by name or use
/email-manager - Provide required inputs per the skill's parameter spec and get structured output
What is OpenClaw Email Manager for Postfic and Dovecot?
Complete email management for Postfix/Dovecot. It is an AI Agent Skill for Claude Code / OpenClaw, with 852 downloads so far.
How do I install OpenClaw Email Manager for Postfic and Dovecot?
Run "/install email-manager" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is OpenClaw Email Manager for Postfic and Dovecot free?
Yes, OpenClaw Email Manager for Postfic and Dovecot is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does OpenClaw Email Manager for Postfic and Dovecot support?
OpenClaw Email Manager for Postfic and Dovecot is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created OpenClaw Email Manager for Postfic and Dovecot?
It is built and maintained by soderholmm (@soderholmm); the current version is v1.0.0.