Send and receive emails via QQ or 163 mailbox.
Configuration
Edit skills/email/scripts/config.json, fill in the email address and authorization code (not the login password).
Obtaining the authorization code:
- QQ Mail: Settings > Account > Enable IMAP/SMTP > Generate authorization code
- 163 Mail: Settings > POP3/SMTP/IMAP > Enable service > Set authorization password
You can use the default_mailbox field to set the default mailbox ("qq" or "163")。
Command-line invocation
# 发送邮件
python3 skills/email/scripts/mail.py send --to user@example.com --subject "主题" --content "内容"
Send with attachment
python3 skills/email/scripts/mail.py send --to user@example.com --subject "报告" --content "请查收" --attach report.pdf
Receive latest emailspython3 skills/email/scripts/mail.py receive --limit 5
Receive emails (JSON output, recommended for AI use)python3 skills/email/scripts/mail.py receive --limit 5 --json
Check for new emails (last N days)python3 skills/email/scripts/mail.py check-new --since 1
Check for new emails (JSON output)python3 skills/email/scripts/mail.py check-new --since 1 --json
Delete emails (move to Deleted folder, recoverable for QQ Mail)python3 skills/email/scripts/mail.py delete --ids 123
Batch deletepython3 skills/email/scripts/mail.py delete --ids 123 124 125
Permanently delete (irrecoverable)python3 skills/email/scripts/mail.py delete --ids 123 --permanent
Specify mailbox typepython3 skills/email/scripts/mail.py --mailbox 163 send --to user@example.com --subject "测试"
## 删除邮件说明
- QQ 邮箱(IMAP):默认移到「已删除」文件夹,可以从已删除中恢复。加 `--permanent` 彻底删除。
- 163 邮箱(POP3):POP3 协议不支持文件夹操作,删除始终是永久的,不可恢复。