Shared IMAP email sync to SQLite — email store for multiple projects
- Python 98.5%
- Dockerfile 1.5%
_decode_header decoded each header part with its declared charset and
no guard, so a header like `=?unknown-8bit?q?...?=` raised LookupError
out of parse_email and the whole message was skipped ("Failed to
process UID N: unknown encoding: unknown-8bit"). The body decoders were
already try/except-wrapped; the header path was not. 18 messages were
lost this way in the 2026-09-25 Gmail backfill.
Fall back to utf-8 with replacement on LookupError, and return the raw
header if decode_header itself raises. Adds tests/test_sync_headers.py
(unknown-8bit, iso-8859-1 still decodes, ASCII, empty, end-to-end raw
RFC822 parse).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|---|---|---|
| bridge | ||
| config | ||
| docs | ||
| email_sync | ||
| tests | ||
| .gitignore | ||
| CLAUDE.md | ||
| Dockerfile | ||
| pyproject.toml | ||
Email Sync — Documentation
Standalone tool for downloading emails from IMAP accounts into a SQLite database. Shared email store for multiple projects (FINANCIALS receipt pipeline, content intelligence, etc.).
Contents
- Setup & Configuration — Installation, account config, storage paths
- Database Reference — Schema, tables, indexes, FTS5, finance fields
- CLI Reference — Commands: sync, search, stats, backup
- Querying for Financial Documents — SQL recipes for receipts, invoices, subscriptions
- Deployment & Portability — Rsync, path remapping, running on other machines