
Qq Mail Reader
- 9 installs
- 33 repo stars
- Updated April 26, 2026
- bighardperson/computer-science-skills-collection
qq-mail-reader is a Claude skill that reads and searches a QQ Mail inbox over the IMAP protocol.
About
This skill reads email from a QQ Mail inbox over the IMAP protocol. A developer uses it when a user asks to view, search, or list recent mail from a QQ account inside an agent. It decodes multiple Chinese-friendly encodings and strips HTML to return plain-text bodies.
- Reads QQ Mail over IMAP (imap.qq.com:993) using an authorization code, not the login password
- Handles Chinese mail encodings by trying GBK/GB2312/UTF-8/Big5/latin1 in turn
- Searches by SINCE date then filters locally since IMAP search does not support Chinese
Qq Mail Reader by the numbers
- 9 all-time installs (skills.sh)
- Ranked #496 of 687 Office & Documents skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
qq-mail-reader capabilities & compatibility
Free; needs a QQ Mail authorization code stored in ~/.openclaw/secrets/mail_qq.env
- Works with
- gmail
- Use cases
- Pricing
- Free
What qq-mail-reader says it does
通过 IMAP 协议读取 QQ 邮箱邮件。
QQ 邮箱必须使用授权码登录,非登录密码
IMAP 搜索不支持中文,使用 SINCE 获取所有邮件后本地过滤
npx skills add https://github.com/bighardperson/computer-science-skills-collection --skill qq-mail-readerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 9 |
|---|---|
| repo stars | ★ 33 |
| Last updated | April 26, 2026 |
| Repository | bighardperson/computer-science-skills-collection ↗ |
What it does
Read and search QQ Mail inbox messages over IMAP from inside an agent, decoding Chinese mail encodings.
When should I use this skill?
User asks to view, read, search, or check recent messages in a QQ Mail inbox.
By the numbers
- Connects on IMAP port 993
- Tries 5 fallback encodings (gbk, gb2312, utf-8, big5, latin1)
Files
QQ邮箱读取
通过 IMAP 协议读取 QQ 邮箱邮件。
触发条件
用户提到以下场景时使用:
- "查看邮箱"
- "读取邮件"
- "查看最近邮件"
- "查看当天邮件"
- "搜索邮件"
- "有新的邮件吗"
配置
需要提前配置 QQ 邮箱 IMAP: 1. 在 QQ 邮箱设置中开启 IMAP 服务 2. 创建授权码(不是登录密码) 3. 配置 secrets 文件:~/.openclaw/secrets/mail_qq.env
MAIL_USER=your_email@qq.com
MAIL_PASS=your_auth_code安全注意事项
- 凭据文件必须设置权限为
600(仅所有者可读),防止其他用户读取敏感信息 ~/.openclaw/secrets/目录默认已经被 gitignore,不会被提交到版本控制- 不要将授权码提交到代码仓库或分享给他人
使用方法
1. 连接邮箱
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 mail2. 搜索邮件
# 搜索最近7天的邮件
week_ago = (datetime.now() - timedelta(days=7)).strftime('%d-%b-%Y')
typ, msg_ids = mail.search(None, f'SINCE {week_ago}')3. 解析邮件
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)4. 提取正文
邮件正文可能包含 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邮件过滤
根据用户需求过滤邮件,常见关键词类型:
- 通知类:通知、提醒、公告
- 业务类:订单、发货、支付
- 职位类:面试、邀请、邀约(仅当用户明确需要时)
注意事项
1. QQ 邮箱必须使用授权码登录,非登录密码 2. 邮件编码可能是 GBK/GB2312/UTF-8 等,需要多种编码尝试 3. IMAP 搜索不支持中文,使用 SINCE 获取所有邮件后本地过滤
{
"ownerId": "kn70fp7zgc7kg5m9z140p9sdhx839s54",
"slug": "qq-mail-reader",
"version": "1.0.5",
"publishedAt": 1774007661209
}{
"version": 1,
"registry": "https://clawhub.ai",
"slug": "qq-mail-reader",
"installedVersion": "1.0.5",
"installedAt": 1776069062727
}