Shared IMAP email sync to SQLite — email store for multiple projects
  • Python 98.5%
  • Dockerfile 1.5%
Find a file
Ben Reed f2ea80cf88
fix(sync): tolerate unknown header charsets instead of dropping the message
_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>
2026-09-24 23:15:58 -06:00
bridge Initial commit: extract email_sync package from FINANCIALS 2026-09-22 08:16:23 -06:00
config Initial commit: extract email_sync package from FINANCIALS 2026-09-22 08:16:23 -06:00
docs docs: update for Gmail labels support and 4x/day sync schedule 2026-09-22 11:01:02 -06:00
email_sync fix(sync): tolerate unknown header charsets instead of dropping the message 2026-09-24 23:15:58 -06:00
tests fix(sync): tolerate unknown header charsets instead of dropping the message 2026-09-24 23:15:58 -06:00
.gitignore fix(build): add hatch packages directive for email_sync namespace 2026-09-22 08:16:54 -06:00
CLAUDE.md docs: update for Gmail labels support and 4x/day sync schedule 2026-09-22 11:01:02 -06:00
Dockerfile Initial commit: extract email_sync package from FINANCIALS 2026-09-22 08:16:23 -06:00
pyproject.toml fix(build): add hatch packages directive for email_sync namespace 2026-09-22 08:16:54 -06:00

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