返回顶部
e

email-manager

Complete email management for Postfix/Dovecot

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
722
下载量
0
收藏
概述
安装方式
版本历史

email-manager

# Email Manager Skill This skill provides complete email management using your Postfix/Dovecot infrastructure. ## 📋 Configuration Edit `config.json` in the skill directory: ```json { "email_address": "your-email@domain.com", "email_password": "your-password", "imap_server": "mail.yourdomain.com", "smtp_server": "mail.yourdomain.com" } ``` ## 📨 Available Operations ### List folders ```bash python3 scripts/imap_utils.py list-folders python3 scripts/imap_utils.py list-folders --output json ``` **Example output:** ``` 📁 Available folders: • Drafts 📝 DRAFTS • Sent 📤 SENT • Trash 🗑️ TRASH • Junk 📧 SPAM • INBOX 📥 INBOX • Archive • Projects/ClientA ``` ### List emails ```bash python3 scripts/imap_utils.py list --folder INBOX --limit 10 python3 scripts/imap_utils.py list --flagged-only --output json ``` ### Read email ```bash python3 scripts/imap_utils.py read --message-id 1234 python3 scripts/imap_utils.py read --message-id 1234 --output json ``` ### Save draft ```bash python3 scripts/imap_utils.py save-draft \ --to "user@example.com" \ --subject "Draft subject" \ --body "Draft content" ``` ### List drafts ```bash python3 scripts/imap_utils.py list-drafts python3 scripts/imap_utils.py list-drafts --output json ``` ### Update draft ```bash python3 scripts/imap_utils.py update-draft \ --draft-id 1234 \ --subject "Updated subject" \ --body "Updated content" ``` ### Send email ```bash python3 scripts/smtp_utils.py send \ --to "user@example.com" \ --subject "Test" \ --body "Hello" ``` ### Send draft ```bash python3 scripts/smtp_utils.py send-draft --draft-id 1234 ``` ### Flag/star email ```bash python3 scripts/imap_utils.py flag --message-id 1234 --add python3 scripts/imap_utils.py flag --message-id 1234 --remove python3 scripts/imap_utils.py list --flagged-only ``` ### Move email ```bash python3 scripts/imap_utils.py move \ --message-id 1234 \ --from-folder INBOX \ --to-folder Projects ``` ### Create folder ```bash python3 scripts/imap_utils.py create-folder --name "NewFolder" ``` ### Delete email ```bash python3 scripts/imap_utils.py delete --message-id 1234 ``` ### Empty trash ```bash python3 scripts/imap_utils.py empty-trash ``` ### Search emails ```bash python3 scripts/imap_utils.py search --query "FROM user@example.com" python3 scripts/imap_utils.py search --query "subject:meeting" --output json ``` ### Spam operations ```bash # List spam python3 scripts/imap_utils.py list-spam python3 scripts/imap_utils.py list-spam --output json # Mark as spam python3 scripts/imap_utils.py mark-spam --message-id 1234 python3 scripts/imap_utils.py mark-spam --message-id 1234 --from-folder INBOX # Mark as not spam python3 scripts/imap_utils.py mark-ham --message-id 1234 python3 scripts/imap_utils.py mark-ham --message-id 1234 --from-folder Junk # Empty spam folder python3 scripts/imap_utils.py empty-spam ``` ## 🔍 Folder Auto-Detection The skill automatically detects folder names for: - **Inbox:** INBOX, Inbox - **Drafts:** Drafts, INBOX.Drafts, Draft - **Sent:** Sent, Sent Messages, INBOX.Sent - **Trash:** Trash, Deleted, INBOX.Trash - **Junk/Spam:** Junk, Spam, INBOX.Junk, INBOX.Spam, Bulk - **Archive:** Archive, Archives, INBOX.Archive ## 📁 Folder Name Handling The skill cleans up folder names for display by removing IMAP flags like `\HasNoChildren` and quotes. For raw folder data with flags: ```bash python3 scripts/imap_utils.py list-folders --output json ``` **Example JSON output:** ```json [ { "name": "Drafts", "delimiter": "/", "flags": ["\\HasNoChildren", "\\Drafts"] } ] ``` ## 🤖 AI Usage Examples Always use `--output json` when parsing results: ```bash # List drafts and find specific one drafts=$(python3 scripts/imap_utils.py list-drafts --output json) # Parse JSON to find draft by subject # Send the draft python3 scripts/smtp_utils.py send-draft --draft-id $ID # Check spam count spam=$(python3 scripts/imap_utils.py list-spam --output json) # Get folder metadata folders=$(python3 scripts/imap_utils.py list-folders --output json) ``` ## ✅ Testing Test your configuration: ```bash python3 scripts/imap_utils.py list-folders python3 scripts/imap_utils.py list --limit 5 python3 scripts/imap_utils.py list-spam ``` All operations are non-interactive and suitable for automation. ## 🚀 Setup Instructions ```bash # 1. Create skill directory mkdir -p ~/OpenClaw-Workspace/skills/email-manager/scripts cd ~/OpenClaw-Workspace/skills/email-manager # 2. Create config.json cat > config.json << 'EOF' { "email_address": "your-email@yourdomain.com", "email_password": "your-password", "imap_server": "mail.yourdomain.com", "imap_port": 993, "smtp_server": "mail.yourdomain.com", "smtp_port": 465, "folders": { "drafts": "Drafts", "sent": "Sent", "trash": "Trash", "junk": "Junk" } } EOF # 3. Make scripts executable chmod +x scripts/*.py # 4. Test it! python3 scripts/imap_utils.py list-folders ``` ## 📝 Common Spam Folder Names Different Dovecot configurations use different spam folder names: - Junk (most common) - Spam - INBOX.Junk - INBOX.Spam - Bulk - Junk E-mail Set it explicitly in `config.json` if auto-detection doesn't work: ```json { "folders": { "junk": "INBOX.Junk" } } ``` ## 🎯 Key Benefits - ✅ Zero dependencies - Uses only Python standard library - ✅ No virtualenv needed - Works with system Python - ✅ JSON config - Easy to edit, no parsing libraries needed - ✅ Non-interactive - Perfect for AI automation - ✅ Full feature set - Drafts, send, folders, flags, move, delete, spam - ✅ Debian/Ubuntu compatible - No "externally-managed-environment" errors

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 email-manager-1776319388 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 email-manager-1776319388 技能

通过命令行安装

skillhub install email-manager-1776319388

下载 Zip 包

⬇ 下载 email-manager v1.0.0

文件大小: 12.76 KB | 发布时间: 2026-4-16 18:39

v1.0.0 最新 2026-4-16 18:39
Initial release of email-manager 1.0.0 — complete email management for Postfix/Dovecot.

- Manage emails, drafts, folders, flags, spam, and more using Python3 scripts.
- Fully supports listing, reading, composing, flagging, deleting, moving, and searching emails.
- Includes robust handling for drafts, spam, and folder auto-detection (Inbox, Sent, Trash, Junk, Archive).
- Requires only Python standard library, no external dependencies or virtualenv setup.
- All operations are non-interactive — ideal for automation.
- Simple JSON-based configuration; supports customization of folder names for various Dovecot setups.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部