使用 SolEmail 自动化系统读取和发送邮件;当被要求检查邮件、通过邮件发送附件、回复邮件或设置邮件自动化时使用。
Sol Email Skill. 自动电子邮件读取和发送方式为 hidealaya( 本地 Maildir) 和 SMTP. 脚本位置是一项面向实际任务的技能,主要用于所有脚本都生活在 ~/. openclaw/ workspace/ spits/ :. agentmail- send. py – 发送电子邮件. ag。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;
涉及批量任务时,还应保存进度,避免中断后重复操作。该技能适合用于一次性任务,也可以接入自动化工作流,与其他技能或上层代理配合完成更完整的业务链路;在组合使用时,应明确每一步的输入输出关系,并避免不同步骤之间出现参数冲突。
通过 himalaya(本地 Maildir)和 SMTP 实现邮件的自动读取与发送。
所有脚本均位于 ~/.openclaw/workspace/scripts/ 目录下:
agentmail-send.py — 发送邮件agentmail-inbox.py — 读取邮件find-zip-email.py — 查找文件、打包为 ZIP 并邮件发送brew install himalaya~/.config/himalaya/config.toml 中配置邮箱账户.env.example):SMTP_HOST、SMTP_PORT、SMTP_USER、SMTP_PASSWORD、FROM_NAMEpython3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --limit 10
python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --unread-only
python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --read 42
python3 ~/.openclaw/workspace/scripts/agentmail-send.py
--to "recipient@example.com"
--subject "Subject here"
--body "Email body text"
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"
python3 ~/.openclaw/workspace/scripts/find-zip-email.py
--find "*.pdf"
--search-dir ~/Downloads
--to "recipient@example.com"
--subject "Your PDFs"
--body "As requested."
himalaya sync && python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --limit 10
~/.config/himalaya/config.toml 示例:
[[accounts]] name = "icloud" [accounts.icloud.imap] host = "imap.mail.me.com" # Gmail 可使用 imap.gmail.com port = 993 username = "yourname@icloud.com" password = "xxxx-xxxx-xxxx-xxxx" # 应用专用密码,非您的主密码 ssl = true [accounts.icloud.smtp] host = "smtp.mail.me.com" port = 587 username = "yourname@icloud.com" password = "xxxx-xxxx-xxxx-xxxx" starttls = true
在 ~/.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
应用专用密码错误或已过期。请前往 appleid.apple.com 重新生成。
请先运行 himalaya sync,从服务器下载邮件。
尝试将端口由 587(STARTTLS)更换为 465(SSL)。
请安装: brew install himalaya
可通过 OpenClaw cron 设置自动邮件检查:
name: Email check schedule: "*/15 * * * *" command: "himalaya sync && python3 ~/.openclaw/workspace/scripts/agentmail-inbox.py --unread-only"
或添加至工作区的 HEARTBEAT.md 文件中,以实现基于心跳机制的检查。
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.1万人学习
共49课时 | 82.6万人学习
最新文章