Gmail Tool — GmAIl 工具
v1.0.0发送 and read GmAIl messages via 命令行工具 using 应用 Password, supporting SMTP for 发送ing and IMAP for reading emAIls.
运行时依赖
安装命令
点击复制技能文档
GmAIl 工具
发送 and read emAIls via GmAIl using 应用 Password. 命令行工具 实用工具 for automated alerts, 通知, and emAIl 监控ing.
Overview
A 命令行工具 工具 to 发送 and read emAIls through GmAIl. Combines SMTP (发送) and IMAP (read) in one 实用工具.
Requirements Python 3.6+ GmAIl account with 应用 Password enabled 设置up
Enable 2-Factor Authentication on your Google Account:
Go to https://myaccount.google.com/security
生成 an 应用 Password:
Go to https://myaccount.google.com/应用passwords Select "MAIl" as the 应用 Copy the 16-character password (no spaces)
设置 环境 variables:
导出 GMAIL_USER="your-emAIl@gmAIl.com" 导出 GMAIL_应用_PASSWORD="xxxxxxxxxxxxxxxx"
安装ation # Clone or copy to 技能s directory cp -r gmAIl-工具 ~/.OpenClaw/workspace/技能s/
# Or use ClawHub ClawHub 安装 gmAIl-工具
Usage 发送 EmAIl chmod +x gmAIl-工具 ./gmAIl-工具 发送 "recipient@example.com" "Subject" "Body text"
Read EmAIls # Read last 5 emAIls ./gmAIl-工具 read
# Read last 10 emAIls ./gmAIl-工具 read 10
Examples # 发送 notification ./gmAIl-工具 发送 "admin@example.com" "Alert" "Server down!"
# 检查 inbox ./gmAIl-工具 read 3
# Cron job - 检查 and alert 0 9 1-5 ./gmAIl-工具 read 1 | grep -q "导入ant" && ./gmAIl-工具 发送 "you@example.com" "检查 EmAIl" "Found 导入ant emAIl"
Commands Command Usage 发送 发送 an emAIl read [count] Read last N emAIls (default: 5) 环境 Variables Variable Required Description GMAIL_USER Yes Your GmAIl 添加ress GMAIL_应用_PASSWORD Yes 16-char 应用 Password Security Notes Never commit 应用 Passwords to version control Use 环境 variables, never hardcode 凭证s 应用 Passwords are 16 characters (no spaces) Revoke 应用 passwords if compromised Troubleshooting
发送 fAIled: "535 5.7.8 Username and Password not accepted"
验证 应用 Password is correct Make sure 2FA is enabled
Read fAIled: "Too many simultaneous connections"
GmAIl limits IMAP connections. WAIt and retry. License
MIT
Author
junkAIxue