Since 0.20.0, import-emlx re-ingested every archived .partial.emlx message
whose Apple Mail attachment cache was still present, on every run, because
any parse-time restoration sent the message down the re-ingest path.
Restore cached attachments into the stored raw first and skip the message
when the result is byte-identical. Skipped messages still get the mailbox
label and header repair; a failed label add still falls through to
ingestion so the label is retried. AttachmentsRestored now counts
attachments a run added to the archive, once per message, after ingestion
succeeds.
Closes kenn-io#957
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What changed
import-emlxnow restores cached attachments into the stored raw of an archived partial message first, and skips the message when that changes nothing. Only messages that gain a newly cached attachment are re-ingested.Why
Since 0.20.0, every rerun rewrote each archived
.partial.emlxmessage whose attachments are still in Apple Mail'sAttachments/cache, whether or not the archive already had them. With a large Mail library, a nightly incremental import went from about an hour to 6–10 hours, logged slow-transaction warnings, and rebuilt the analytics cache from all the rewritten rows while adding only a few hundred new messages.Usage
No usage change. A rerun over an unchanged Mail tree now reports
Updated: 0and counts those messages underSkipped (dup).Closes #957
🤖 Generated with Claude Code