用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/bighardperson/computer-science-skills-collection --skill qq-mail-reader命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Auto-generated frontmatter
AndonQ 腾讯云智能客服"领域虾" — 不切窗口、不排队,即刻获得腾讯云全产品线专业解答。支持工单查询(列表/详情/流水)、集团工单与需求单管理、腾讯云全产品线智能问答,以及通过 tccli 调用腾讯云只读查询类 API(如 CVM、CBS、CAM 等)。当用户查询工单、查看工单详情、咨询腾讯云产品问题(如 CVM、轻量应用服务器、COS 等)、查询集团工单/需求单、要求找人工客服、或需要调用腾讯云 API 查询资源信息时使用。
Scan installed OpenClaw skills for malicious code patterns including ClickFix social engineering, reverse shell (RAT), and data exfiltration. Uses OG-Text model for agentic detection.
基于 SOC 职业分类
正在显示 SKILL.md
| name | qq-mail-reader |
| description | 读取QQ邮箱邮件。使用IMAP协议连接QQ邮箱,支持多种编码解析。触发场景:用户要求查看邮箱、读取邮件、查看最近邮件、筛选特定邮件等。 |
| homepage | https://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256 |
| metadata | {"openclaw":{"emoji":"📧","requires":{"env":["MAIL_USER","MAIL_PASS"],"config":["~/.openclaw/secrets/mail_qq.env"]},"install":[]}} |
通过 IMAP 协议读取 QQ 邮箱邮件。
用户提到以下场景时使用:
需要提前配置 QQ 邮箱 IMAP:
~/.openclaw/secrets/mail_qq.env
MAIL_USER=your_email@qq.com
MAIL_PASS=your_auth_code
600(仅所有者可读),防止其他用户读取敏感信息~/.openclaw/secrets/ 目录默认已经被 gitignore,不会被提交到版本控制import imaplib
import email
from email.header import decode_header
IMAP_HOST = 'imap.qq.com'
IMAP_PORT = 993
def connect_mail(user, password):
mail = imaplib.IMAP4_SSL(IMAP_HOST, IMAP_PORT)
mail.login(user, password)
mail.select('INBOX')
return mail
# 搜索最近7天的邮件
week_ago = (datetime.now() - timedelta(days=7)).strftime('%d-%b-%Y')
typ, msg_ids = mail.search(None, f'SINCE {week_ago}')
def decode_header_value(header_value):
"""兼容多种编码的解码"""
if not header_value:
return ""
decoded_parts = []
for content, encoding in decode_header(header_value):
if isinstance(content, bytes):
try:
decoded = content.decode(encoding if encoding else 'utf-8')
except:
# 尝试其他常见编码
for enc in ['gbk', 'gb2312', 'utf-8', 'big5', 'latin1']:
try:
decoded = content.decode(enc)
break
except:
decoded = content.decode('utf-8', errors='ignore')
else:
decoded = str(content)
decoded_parts.append(decoded)
return ''.join(decoded_parts)
邮件正文可能包含 HTML,需要清理:
import re
def get_text_body(msg):
body = ''
if msg.is_multipart():
for part in msg.walk():
if part.get_content_type() == 'text/html':
payload = part.get_payload(decode=True)
encoding = part.get_content_charset() or 'utf-8'
body = payload.decode(encoding, errors='ignore')
break
else:
payload = msg.get_payload(decode=True)
encoding = msg.get_content_charset() or 'utf-8'
body = payload.decode(encoding, errors='ignore')
# 清理HTML标签
text = re.sub(r'<[^>]+>', ' ', body)
text = text.replace(' ', ' ')
text = text.replace('&', '&')
text = re.sub(r'\s+', ' ', text)
return text
根据用户需求过滤邮件,常见关键词类型: