Releases: notoriouslab/gmail-statement-fetcher
Releases · notoriouslab/gmail-statement-fetcher
v1.0.3
安全強化
- PDF/ZIP 密碼改由 env var 管理:新增
{BANKID}_PDF_PASSWORD/{BANKID}_ZIP_PASSWORD支援,優先於config.json中的設定。密碼不再需要寫入設定檔。詳見.env.example。 - 修正:寫入失敗時同時清除 temp 檔與
resolve_save_path留下的 0-byte placeholder,不再殘留空檔。 - 修正:date header 寫入 debug log 前先 sanitize,防止 log injection。
- 修正:
prune_processed_uids(retention_days=0)改為回傳副本,行為與有 retention 時一致。 - 改善:
--dry-run遇到同名檔時 log 會提示實際存檔名稱可能帶_N後綴。
文件
- README 改為繁體中文主版,新增
README.en.md英文版 SECURITY.md、SKILL.md、.env.example同步更新
測試
新增 tests/test_fetcher.py,51 個單元測試涵蓋核心邏輯。
v1.0.1 — Security Hardening / 安全強化
What's Changed / 變更內容
Security / 安全性
- Privacy-safe dedup / 隱私安全去重:
.processed_uids.jsonnow stores SHA-256 subject hashes instead of raw email subjects — no PII on disk
去重記錄改存主旨雜湊(SHA-256),不再儲存原始郵件主旨,磁碟上零 PII - Atomic PDF writes / 原子寫入: all file saves use
tempfile.mkstemp()+os.replace()— no partial files on crash or interruption
所有檔案寫入改用臨時檔 + 原子替換,中斷不會產生半殘檔案 - Username masking / 帳號遮蔽: Gmail address masked in logs (first 3 chars +
***)
日誌中 Gmail 帳號只顯示前 3 字元 - IMAP socket timeout: 300s timeout on IMAP socket to prevent indefinite hangs on network failure
IMAP 連線加入 300 秒逾時,防止網路中斷時無限等待 - Sender domain boundary / 寄件人域名邊界: sender matching now requires
@or.boundary — prevents partial domain false positives (e.g.notsinopac.comno longer matchessinopac.com)
寄件人比對加入域名邊界檢查,避免部分域名誤匹配 - Log path sanitisation / 日誌路徑清理: file paths in log output use
os.path.basename()only — no full paths leaked
日誌中的檔案路徑只顯示檔名,不洩漏完整路徑 - Config password warning / 密碼警告: startup warns if plaintext
pdf_passwordorzip_passwordfound in config
啟動時警告設定檔中的明文密碼
Improvements / 改善
- Python 3.9+ check: clear error message on unsupported Python versions
不支援的 Python 版本會顯示明確錯誤訊息 - SKILL.md: added OpenClaw agent integration file for AI agent frameworks
新增 OpenClaw agent 整合檔,供 AI agent 框架使用 - Docs refresh / 文件更新: README, SECURITY.md, CONTRIBUTING.md updated to reflect all v1.0.1 changes
README、SECURITY.md、CONTRIBUTING.md 同步更新
Upgrading / 升級方式
cd gmail-statement-fetcher && git pullNo config changes needed. Existing .processed_uids.json files remain compatible — new entries use hashed subjects, old entries are still recognized.
不需要改設定。現有的 .processed_uids.json 相容——新條目使用雜湊主旨,舊條目仍可辨識。
Full Changelog: v1.0.0...v1.0.1