Anthony 56bd92787b Recover .eml from disk even when the metadata row says has_details=0
After a SQLite schema migration the `mails` table is dropped and
recreated empty; the encrypted `.eml.enc` files on disk survive that
migration (they are keyed by element id, not by row id). Phase 0 of the
syncer was gating the body recovery on `meta.has_details`, so the post-
migration boot would deliver a `mail_to_rfc2822(mail, None)`
headers-only body to IMAP even though the full body sat right there on
disk — a real mail's content quietly showed up as a placeholder in
Thunderbird until something forced a refetch.

Try `read_eml` unconditionally. When it returns the body, also flip
`has_details = 1` on the row so subsequent prefetch sweeps skip the
mail and the heal is permanent. Mismatch → still falls back to
headers-only as before. The extra read at boot is a `Path::exists()`
plus an AES decrypt per mail, negligible vs the network costs we
already pay.

While here, demote the misleading IMAP-fetch log: when `details` is
None but `rfc2822` is populated we *do* serve the real body, so log
"placeholder" only when `rfc2822` is also missing.

166 bridge lib tests pass.
2026-05-28 16:07:15 +02:00
Languages
Rust 89.5%
TypeScript 5.9%
CSS 2.5%
Python 1.2%
Shell 0.7%
Other 0.1%