gomail Skill (OpenClaw)
Use the gomail sender CLI to send emails (with optional attachments and templates) from OpenClaw. This skill wraps the prebuilt Linux sender binary from the gomail project and exposes its flags as structured parameters.
Installation
Download the latest prebuilt Linux AMD64 release that contains the sender binary:
CODEBLOCK0
- - Recommended: Place
sender on your PATH (e.g. /usr/local/bin/sender) or keep it in the gomail skill directory and invoke it with ./sender. - This skill assumes a Linux environment compatible with the gomail Linux AMD64 builds.
Configuration
The sender tool reads mail server and sender configuration from a JSON file passed via --config. This skill includes a starter config template at sender.json (in the gomail skill directory). It includes:
- - SMTP server settings (host, port, TLS, auth)
- Authentication credentials
- A
sender email address (the actual From address)
For OpenClaw, you can:
- - Use the bundled config template in the gomail skill directory,
sender.json (recommended). - Or point
--config to any other JSON file you manage.
Important: skill/sender.json is a template. Replace the placeholder values with real SMTP credentials and keep secrets out of source control.
Important: The --header flag only controls the human‑readable display name. The actual From email address is read from the sender field in the config file, as described in the gomail README.
Parameters (CLI)
This skill uses the sender command exactly as documented in the gomail README:
CODEBLOCK1
| Argument / Flag | Required | Description |
|---|
| INLINECODE17 / INLINECODE18 | ✅ | Path to config JSON file, e.g. sender.json. Defines SMTP/server settings and the actual sender address. |
| INLINECODE20 / INLINECODE21 |
✅ | Recipients list, format:
alen@example.com,cc:bob@example.com. Supports
cc: prefix for CC recipients. |
|
--attachment /
-a | ❌ | Comma‑separated attachment files, e.g.
attach1.txt,attach2.txt. Paths are resolved relative to the working directory. |
|
--body /
-b | ❌ | Body text or path to a body file, e.g.
body.txt. |
|
--content_type /
-e| ❌ | Content type:
HTML or
PLAIN_TEXT (default). |
|
--header /
-r | ❌ | Sender display name, combined with
sender from config to form the From header (e.g.
"Your Name" <noreply@example.com>). |
|
--title /
-t | ❌ | Subject/title text for the email. |
|
--dry-run /
-n | ❌ | If set, only outputs recipient validation JSON and exits;
does not send the email. |
|
--help | ❌ | Show help. |
|
--version | ❌ | Show application version. |
Basic usage
From inside the gomail skill directory (with a bundled config and body file):
CODEBLOCK2
When integrated in OpenClaw, construct the command with the appropriate flags based on user input. Use --dry-run during testing or when you only need to validate recipients without sending mail:
CODEBLOCK3
When to use
- - Send email: When the user asks to send an email, notification, or message (optionally with attachments) via SMTP.
- Validate recipients: When the user wants to validate or preview recipients without sending (use
--dry-run). - gomail specific: When the user mentions gomail, gomail sender, or wants to use the gomail CLI for mail delivery from OpenClaw.
gomail 技能 (OpenClaw)
使用 gomail sender CLI 从 OpenClaw 发送电子邮件(支持可选附件和模板)。此技能封装了 gomail 项目中预构建的 Linux sender 二进制文件,并将其标志暴露为结构化参数。
安装
下载包含 sender 二进制文件的最新预构建 Linux AMD64 版本:
bash
从 PATH 目录或技能目录执行
LATEST
URL=$(curl -sL -o /dev/null -w %{urleffective} https://github.com/craftslab/gomail/releases/latest)
VERSION=${LATEST_URL##*/} # 例如 v2.7.2
VERSION
NOV=${VERSION#v} # 例如 2.7.2
注意:发布标签包含前导 v,但压缩包文件名不包含。
wget https://github.com/craftslab/gomail/releases/download/${VERSION}/gomail
${VERSIONNO
V}linux_amd64.tar.gz
tar -xf gomail
${VERSIONNO
V}linux_amd64.tar.gz
确保二进制文件可执行
chmod +x sender parser
- - 推荐:将 sender 放在 PATH 中(例如 /usr/local/bin/sender),或保留在 gomail 技能目录中并使用 ./sender 调用。
- 此技能假设环境与 gomail Linux AMD64 构建兼容。
配置
sender 工具通过 --config 传入的 JSON 文件读取邮件服务器和发件人配置。此技能在 gomail 技能目录中包含一个初始配置模板 sender.json,包括:
- - SMTP 服务器设置(主机、端口、TLS、认证)
- 认证凭据
- 发件人电子邮件地址(实际的发件人地址)
对于 OpenClaw,您可以:
- - 使用 gomail 技能目录中捆绑的配置模板 sender.json(推荐)。
- 或将 --config 指向您管理的任何其他 JSON 文件。
重要:skill/sender.json 是一个模板。请将占位符值替换为真实的 SMTP 凭据,并将机密信息排除在版本控制之外。
重要:--header 标志仅控制人类可读的显示名称。实际的发件人电子邮件地址从配置文件的 sender 字段读取,如 gomail README 所述。
参数(CLI)
此技能使用 sender 命令,完全按照 gomail README 中的文档说明:
bash
用法:sender --recipients=RECIPIENTS []
| 参数/标志 | 必需 | 描述 |
|---|
| --config / -c | ✅ | 配置 JSON 文件的路径,例如 sender.json。定义 SMTP/服务器设置和实际发件人地址。 |
| --recipients / -p |
✅ | 收件人列表,格式:alen@example.com,cc:bob@example.com。支持 cc: 前缀表示抄送收件人。 |
| --attachment / -a | ❌ | 逗号分隔的附件文件,例如 attach1.txt,attach2.txt。路径相对于工作目录解析。 |
| --body / -b | ❌ | 正文文本或正文文件的路径,例如 body.txt。 |
| --content
type / -e| ❌ | 内容类型:HTML 或 PLAINTEXT(默认)。 |
| --header / -r | ❌ | 发件人显示名称,与配置中的 sender 组合形成发件人标头(例如 Your Name
)。 |
| --title / -t | ❌ | 电子邮件的主题/标题文本。 |
| --dry-run / -n | ❌ | 如果设置,仅输出收件人验证 JSON 并退出;不发送电子邮件。 |
| --help | ❌ | 显示帮助。 |
| --version | ❌ | 显示应用程序版本。 |
基本用法
在 gomail 技能目录内(使用捆绑的配置和正文文件):
bash
./sender \
--config=sender.json \
--attachment=attach1.txt,attach2.txt \
--body=body.txt \
--contenttype=PLAINTEXT \
--header=Your Name \
--recipients=alen@example.com,bob@example.com,cc:catherine@example.com \
--title=TITLE
当集成到 OpenClaw 中时,根据用户输入使用适当的标志构建命令。在测试期间或仅需验证收件人而不发送邮件时使用 --dry-run:
bash
sender \
--config=sender.json \
--recipients=test@example.com \
--dry-run
使用时机
- - 发送电子邮件:当用户要求通过 SMTP 发送电子邮件、通知或消息(可选附件)时。
- 验证收件人:当用户想要验证或预览收件人而不发送时(使用 --dry-run)。
- gomail 特定:当用户提到 gomail、gomail sender 或想要从 OpenClaw 使用 gomail CLI 进行邮件投递时。