📦 Email Excel Transfer

v1.0.0

通过 IMAP 从邮件下载附件并用 PowerShell 填充 Excel 文件。当用户请求从邮件下载文件并插入值时使用。

0· 6·0 当前·0 累计
0
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
可疑
medium confidence
该技能的描述目的(通过 PowerShell 下载 IMAP 附件并填充 Excel)与其指令基本相符,但它要求用户提供凭据,并将文件发送至内部 MCP bridge,而元数据中未声明这些要求——这种不匹配以及基于 bridge 的远程 PowerShell 执行令人担忧。
评估建议
安装前,请确认你信任该 skill 作者,并清楚凭据与文件的去向。具体注意事项: - 要求维护者在元数据中声明所需环境变量(USER_EMAIL、USER_APP_PASSWORD),以便提前知晓需提供的信息。 - 优先使用应用专用 IMAP 密码或一次性账户,而非主邮箱密码。 - 确认 MCP bridge 端点(http://172.17.0.1:3001/mcp)是你环境中可信的内部服务——该端点可在 Windows 主机写文件并执行 PowerShell,权限极高。 - 如可能,先在隔离虚拟机中用非敏感邮件/附件测试,再提供真实凭据或允许远程执行。 - 审查并限制待执行的 PowerShell 命令;避免允许任意 shell_ps 调用,以防运行意外代码。 若无法验证 bridge 或不愿共享邮箱凭据,请勿安装或使用此 skill。...
详细分析 ▾
用途与能力
名称/描述与说明相符:SKILL.md 展示了 IMAP 下载、XLSX 解析和基于 PowerShell 的 Excel 编辑。然而,该技能需要用户邮箱凭据(USER_EMAIL、USER_APP_PASSWORD)并访问 Windows 主机进行 COM 自动化,而注册元数据中未列出任何必需的环境变量或主要凭据——声称用途与声明要求不一致。
指令范围
运行time instructions tell the 代理 to 记录 into IMAP with user-supplied 凭证s, save attachments to /tmp, 解析 XLSX, then transfer files to a Windows host and 运行 PowerShell COM to edit Excel. The 技能.md also demonstrates 发送ing base64 payloads to an internal MCP bridge (http://172.17.0.1:3001/mcp) and invoking a remote shell_ps 工具. That bridge/JSON-RPC execution path grants the ability to write files and 运行 arbitrary PowerShell on another host — legitimate for the 状态d transfer task but high-impact and not restricted or explAIned.
安装机制
这是一个纯指令型技能,没有安装配置,也没有代码文件。技能本身在运行前不会写入任何磁盘内容,从而降低了安装时的风险。
凭证需求
The instructions require sensitive secrets (emAIl 添加ress and 应用 password) and 访问 to an internal MCP bridge that can 执行 PowerShell — yet the 技能 metadata declares no required env vars or primary 凭证. Requiring these 凭证s is reasonable for IMAP 访问, but the omission in metadata is a transparency issue. The MCP bridge 端点 (172.17.0.1) is an internal 添加ress and using it to 执行 PowerShell increases the trust and privilege needed.
持久化与权限
该技能未标记 always:true,也没有安装时持久化。它确实指示使用远程执行桥,但未请求永久包含或修改其他技能/配置。
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

安装命令

点击复制
官方npx clawhub@latest install email-excel-transfer
镜像加速npx clawhub@latest install email-excel-transfer --registry https://cn.longxiaskill.com

技能文档

Email → Excel 传输 完整工作流:从 WP 邮箱下载附件 → 读取数据 → 填充 Excel 文件。

  • 从邮件下载附件(IMAP)
import imaplib, ssl, os, base64, time import email m = imaplib.IMAP4_SSL('imap.wp.pl', 993, ssl_context=ssl.create_default_context()) m.login('USER_EMAIL', 'USER_APP_PASSWORD') m.select('INBOX') time.sleep(0.5) _, messages = m.search(None, 'FROM "adres@wp.pl" SUBJECT "fraza"') ids = messages[0].split() uid = ids[-1] # 最新 _, msg_data = m.fetch(uid, '(RFC822)') msg = email.message_from_bytes(msg_data[0][1]) os.makedirs('/tmp/mail_attachments', exist_ok=True) for part in msg.walk(): if part.get_content_disposition() == 'attachment': filename = part.get_filename() data = part.get_payload(decode=True) if data and 'xlsx' in filename: if '=?utf-8?b?' in filename: fname = base64.b64decode(filename.split('?')[3]).decode('utf-8') else: fname = filename with open(f'/tmp/mail_attachments/{fname}', 'wb') as f: f.write(data) m.logout()

  • 从 xlsx 文件读取数据
xlsx 文件本质是 ZIP。无需外部库: import zipfile, re def read_xlsx(path): with zipfile.ZipFile(path) as z: with z.open('xl/worksheets/sheet1.xml') as f: content = f.read().decode('utf-8') with z.open('xl/sharedStrings.xml') as f: ss = f.read().decode('utf-8') strings = re.findall(r']>([^<]+)', ss) cells = re.findall(r'])>(.*?)', content, re.DOTALL) data = {} for cell_ref, attrs, cell_content in cells: v = re.search(r'([^<]+)', cell_content) if v: val = v.group(1) if 't="s"' in attrs: idx = int(val) val = strings[idx] if idx < len(strings) else val data[cell_ref] = val return data

  • 填充 Excel 文件(PowerShell + COM)
Add-Type -AssemblyName Microsoft.Office.Interop.Excel $excel = New-Object -ComObject Excel.Application $excel.Visible = $false $excel.DisplayAlerts = $false $wb = $excel.Workbooks.Open("C:\sciezka\do\pliku.xlsx") $ws = $wb.ActiveSheet # 插入值(行, 列)——Excel 列:B=2, C=3, D=4, E=5, F=6, G=7, H=8 $ws.Cells.Item(6,5).Value2 = 2450000 # E6 $ws.Cells.Item(6,6).Value2 = 2380000 # F6 $ws.Cells.Item(6,7).Value2 = 2520000 # G6 $ws.Cells.Item(6,8).Value2 = 7350000 # H6 $wb.Save() $wb.Close($false) $excel.Quit()

  • 向 Windows 传文件(MCP bridge)
MCP bridge: http://172.17.0.1:3001/mcp(仅 Linux VM 可访问) 小文件(<200 KB): import base64, json with open('/tmp/plik.xlsx', 'rb') as f: b64 = base64.b64encode(f.read()).decode() payload = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "shell_ps", "arguments": { "cmd": f'[IO.File]::WriteAllBytes("C:\\sciezka\\plik.xlsx", [Convert]::FromBase64String("{b64}"))' } } } 大文件——分步: fs_write → 将 base64 写入 TEMP shell_ps → [IO.File]::WriteAllBytes 从 TEMP 读取

登录信息(用户填写) Email: USER_EMAIL(例:pentom6@wp.pl) 应用密码: USER_APP_PASSWORD IMAP: imap.wp.pl:993

PowerShell 模板 批量插入值: $ws.Cells.Item(row, col).Value2 = value # 行 6-20 为数据行,列 E(5), F(6), G(7), H(8) 完整工作流(读取 → 修改 → 保存): Add-Type -AssemblyName Microsoft.Office.Interop.Excel $excel = New-Object -ComObject Excel.Application $excel.Visible = $false $excel.DisplayAlerts = $false $wb = $excel.Workbooks.Open("C:\sciezka\wejsciowa.xlsx") $ws = $wb.ActiveSheet # 插入值 $ws.Cells.Item(6,5).Value2 = 2450000 # …更多单元格 $wb.SaveAs("C:\sciezka\wyjsciowa.xlsx", 51) # 51 = xlsx $wb.Close($false) $excel.Quit()

数据来源ClawHub ↗ · 中文优化:龙虾技能库