360 Secure SkillHub
360 安全技能中心

SolEmail

基于本地 himalaya Maildir 与 SMTP 的邮件处理 Skill,提供读取收件箱、查看未读与指定邮件、发送带附件邮件,以及查找文件、打包并发送的 Python 脚本,可通过定时任务或心跳机制定期检查邮件。依赖 himalaya、Python 3 及 SMTP 环境变量,脚本路径绑定 OpenClaw 工作区。

amrree
amrree
热度 16.16
最近更新 2026-06-25 04:01:11
分类:协作依赖:代码执行 / 读写文件 / 第三方 API应用场景:邮件起草 / 自动化脚本 / 工作流 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add sol-email
Metadata
name
sol-email
description
Read and send emails using the SolEmail automation system. Use when asked to check emails, send files via email, respond to an email, or set up email automation.

Sol Email Skill

Automated email reading and sending via himalaya (local Maildir) and SMTP.

Scripts Location

All scripts live in ~/.openclaw/workspace/scripts/:

  • agentmail-send.py — send emails
  • agentmail-inbox.py — read emails
  • find-zip-email.py — find files, zip, email

Prerequisites

  1. himalaya installed — brew install himalaya
  2. Email account configured in ~/.config/himalaya/config.toml
  3. Environment variables set (see .env.example in SolEmail repo):
    • SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, FROM_NAME

Daily Use

Check recent emails

python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --limit 10

Check unread emails only

python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --unread-only

Read a specific email (by ID)

python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --read 42

Send an email

python3 ~/.openclaw/workspace/scripts/agentmail-send.py \
    --to "recipient@example.com" \
    --subject "Subject here" \
    --body "Email body text"

Send with attachments

python3 ~/.openclaw/workspace/scripts/agentmail-send.py \
    --to "recipient@example.com" \
    --subject "Your files" \
    --body "Please find the files attached." \
    --attachment "/path/to/file1.pdf" \
    --attachment "/path/to/file2.zip"

Find files, zip, and email

python3 ~/.openclaw/workspace/scripts/find-zip-email.py \
    --find "*.pdf" \
    --search-dir ~/Downloads \
    --to "recipient@example.com" \
    --subject "Your PDFs" \
    --body "As requested."

Sync emails before checking

himalaya sync && python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --limit 10

Configuration

himalaya account (IMAP + SMTP)

~/.config/himalaya/config.toml:

[[accounts]]
name = "icloud"

[accounts.icloud.imap]
host     = "imap.mail.me.com"  # or imap.gmail.com for Gmail
port     = 993
username = "yourname@icloud.com"
password = "xxxx-xxxx-xxxx-xxxx"  # App-specific password, NOT your real password
ssl      = true

[accounts.icloud.smtp]
host     = "smtp.mail.me.com"
port     = 587
username = "yourname@icloud.com"
password = "xxxx-xxxx-xxxx-xxxx"
starttls = true

Environment variables

Set in ~/.openclaw/workspace/.env:

SMTP_HOST=smtp.mail.me.com
SMTP_PORT=587
SMTP_USER=yourname@icloud.com
SMTP_PASSWORD=xxxx-xxxx-xxxx-xxxx
FROM_NAME=Your Name

Troubleshooting

"Authentication failed" when sending

App password is wrong or expired. Generate a new one at appleid.apple.com.

"No emails found"

Run himalaya sync first to download emails from the server.

SMTP timeout

Try port 465 (SSL) instead of 587 (STARTTLS).

himalaya not found

Install: brew install himalaya

Cron / Schedule

Set up automated email checks via OpenClaw cron:

name: Email check
schedule: "*/15 * * * *"
command: "himalaya sync && python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --unread-only"

Or add to HEARTBEAT.md in the workspace for heartbeat-based checking.

Related