auto: sync OpenClaw config 2026-07-15 14:00

This commit is contained in:
2026-07-15 14:00:48 +08:00
parent 54c9c9f07a
commit a9b8497b9d
34 changed files with 715 additions and 370 deletions
+2 -56
View File
@@ -35,65 +35,11 @@
- **HTML 版**:无顶部周报标题(不重复主题)、无签名;仅项目名称/主要任务表格 → 本周工作内容(emoji 每日列表) → 存在问题
- **注意**:纯文本和 HTML **都不含主题标题行、不含签名**
- **发送方式**:存草稿箱,用邮件客户端发送多段邮件(同时含纯文本和 HTML)
- **发送工具**
```bash
# 用 Python 构造多段邮件(同时含纯文本和 HTML)
python3 << 'PYEOF'
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
msg = MIMEMultipart('related')
msg['From'] = Header('杨轩', 'utf-8').encode() + ' <yangxuan@witsoft.cn>'
msg['To'] = Header('刘强', 'utf-8').encode() + ' <liuqiang@witsoft.cn>'
msg['Cc'] = Header('吴睿东', 'utf-8').encode() + ' <wurd@witsoft.cn>, ' + Header('陈明', 'utf-8').encode() + ' <chenm@witsoft.cn>, ' + Header('曾莉', 'utf-8').encode() + ' <zengli@witsoft.cn>'
msg['Subject'] = Header('...', 'utf-8').encode()
alt = MIMEMultipart('alternative')
alt.attach(MIMEText(plain_text, 'plain', 'utf-8'))
alt.attach(MIMEText(html_text, 'html', 'utf-8'))
msg.attach(alt)
with open('/tmp/weekly-report.eml', 'w') as f:
f.write(msg.as_string())
PYEOF
himalaya message save --folder "草稿" < /tmp/weekly-report.eml
```
- **发送方式**通过 Python IMAP 存入钉邮草稿箱(`workspace-resume/send_weekly_report.py`
- **流程**:
1. 收集本周每日工作内容
2. 按标准格式生成正文(纯文本 + HTML)
3. 通过 himalaya 存入草稿箱
4. 通知用户去钉钉邮箱草稿箱确认并发送
- **发送工具**
```bash
# 用 Python 构造多段邮件(同时含纯文本和 HTML)
python3 << 'PYEOF'
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
msg = MIMEMultipart('related')
msg['From'] = Header('杨轩', 'utf-8').encode() + ' <yangxuan@witsoft.cn>'
msg['To'] = Header('刘强', 'utf-8').encode() + ' <liuqiang@witsoft.cn>'
msg['Cc'] = Header('吴睿东', 'utf-8').encode() + ' <wurd@witsoft.cn>, ' + Header('陈明', 'utf-8').encode() + ' <chenm@witsoft.cn>, ' + Header('曾莉', 'utf-8').encode() + ' <zengli@witsoft.cn>'
msg['Subject'] = Header('...', 'utf-8').encode()
alt = MIMEMultipart('alternative')
alt.attach(MIMEText(plain_text, 'plain', 'utf-8'))
alt.attach(MIMEText(html_text, 'html', 'utf-8'))
msg.attach(alt)
with open('/tmp/weekly-report.eml', 'w') as f:
f.write(msg.as_string())
PYEOF
himalaya message save --folder "草稿" < /tmp/weekly-report.eml
```
- **流程**:
1. 收集本周每日工作内容
2. 按标准格式生成正文(纯文本 + HTML)
3. 通过 himalaya 存入草稿箱
3. 通过 Python 脚本(IMAP APPEND)存入钉邮草稿箱
4. 通知用户去钉钉邮箱草稿箱确认并发送
## 周报主题格式(标准)
+30
View File
@@ -0,0 +1,30 @@
# 2026-07-15 周三
## 系统配置
### Docker MySQL
- 本地 Docker 运行 MySQL 8(端口 3306),已创建数据库:
- `resume` — 简历库(3 张空表)
- `finances` — 家庭财务管理(8 张表)
- `fitness` — 健康/健身追踪(14 张表,已有数据)
- `travel` — 旅行规划(3 张表)
- `main` — 通用(3 张空表)
- 已有备份文件 `db/resume_latest.sql`
### himalaya 邮件客户端
- 安装 v1.2.0musl 静态编译)
- 配置存入 `~/.config/himalaya/config.toml`,含 IMAP/SMTP 连接信息
- musl 版本缺运行时 imap/smtp feature,不可用
- 系统 Rust 版本 1.63(apt 安装),太旧无法编译 himalaya
### 代理
- Docker 部署了 Clash 代理:`http://proxy:***@127.0.0.1:7443`
### 周报发送流程变更
- **之前**himalaya message save → 草稿箱
- **现在**Python IMAP APPEND(更稳定)
- 脚本位置:`workspace-resume/send_weekly_report.py`
- 使用 `imaplib.IMAP4_SSL` 连接阿里邮箱(imap.mxhichina.com:993
- 构造多段邮件(纯文本 + HTML)
- 存入草稿箱(阿里邮箱编码:`&g0l6Pw-`
- 已在 MEMORY.md 和 weekly-report-g5/SKILL.md 中更新文档
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env python3
"""
G5 周报发送脚本
用法:构造多段邮件(纯文本 + HTML),存入钉邮草稿箱
"""
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
import imaplib
import time
import sys
def send_to_drafts(plain_body: str, html_body: str, date_range: str):
"""构造多段邮件并存入钉邮草稿箱"""
msg = MIMEMultipart('related')
msg['From'] = Header('杨轩', 'utf-8').encode() + ' <yangxuan@witsoft.cn>'
msg['To'] = Header('刘强', 'utf-8').encode() + ' <liuqiang@witsoft.cn>'
msg['Cc'] = (
Header('吴睿东', 'utf-8').encode() + ' <wurd@witsoft.cn>, '
+ Header('陈明', 'utf-8').encode() + ' <chenm@witsoft.cn>, '
+ Header('曾莉', 'utf-8').encode() + ' <zengli@witsoft.cn>'
)
msg['Subject'] = Header(f'G5开发周报 ({date_range})', 'utf-8').encode()
alt = MIMEMultipart('alternative')
alt.attach(MIMEText(plain_body, 'plain', 'utf-8'))
alt.attach(MIMEText(html_body, 'html', 'utf-8'))
msg.attach(alt)
raw_bytes = msg.as_bytes()
conn = imaplib.IMAP4_SSL('imap.mxhichina.com', 993)
conn.login('yangxuan@witsoft.cn', '5gynj20J')
drafts = '"&g0l6Pw-"'
result = conn.append(drafts, None, imaplib.Time2Internaldate(time.time()), raw_bytes)
conn.logout()
return result
if __name__ == '__main__':
# 测试
plain = """项目名称: 维云智造G5
主要任务: 测试
本周工作内容
周一(2026-07-13
- 测试
存在问题
"""
html = "<p>test</p>"
result = send_to_drafts(plain, html, "2026-07-13 ~ 2026-07-17")
print(result)
@@ -57,40 +57,17 @@ https://minio.climbcube.cn/img/202606260843249.jpg
### 3. 发送方式
使用 Python 构造**多段邮件**(同时含纯文本和 HTML),然后通过 himalaya 存入草稿箱。
使用 Python 构造**多段邮件**(同时含纯文本和 HTML),然后通过 IMAP APPEND 存入钉邮草稿箱。
HTML 版签名区应该包含 `<img>` 标签嵌入签名图片
```html
<img src="https://minio.climbcube.cn/img/202606260843249.jpg" alt="签名" style="max-width:200px; height:auto;">
调用脚本
```bash
python3 /home/yangxuan/.openclaw/workspace-resume/send_weekly_report.py
```
**生成命令模板**
```bash
python3 << 'PYEOF'
import email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.header import Header
plain_body = """..."""
html_text = """..."""
msg = MIMEMultipart('related')
msg['From'] = Header('杨轩', 'utf-8').encode() + ' <yangxuan@witsoft.cn>'
msg['To'] = Header('刘强', 'utf-8').encode() + ' <liuqiang@witsoft.cn>'
msg['Cc'] = Header('吴睿东', 'utf-8').encode() + ' <wurd@witsoft.cn>, ' + Header('陈明', 'utf-8').encode() + ' <chenm@witsoft.cn>, ' + Header('曾莉', 'utf-8').encode() + ' <zengli@witsoft.cn>'
msg['Subject'] = Header('G5开发周报 (...)', 'utf-8').encode()
alt = MIMEMultipart('alternative')
alt.attach(MIMEText(plain_body, 'plain', 'utf-8'))
alt.attach(MIMEText(html_text, 'html', 'utf-8'))
msg.attach(alt)
with open('/tmp/weekly-report-YYYY-MM-DD.eml', 'w') as f:
f.write(msg.as_string())
PYEOF
himalaya message save --folder "草稿" < /tmp/weekly-report-YYYY-MM-DD.eml
或直接执行 Python 代码
```python
from send_weekly_report import send_to_drafts
send_to_drafts(plain_body, html_body, "YYYY-MM-DD ~ YYYY-MM-DD")
```
### 4. 最后通知