estimate: size an Exchange (EWS) mailbox #70

Merged
jcoffey-dev merged 1 commits from feat/estimate-ews into main 2026-11-12 16:45:23 +00:00
Owner

Stacks on #69 (merge order #67 → #68 → #69 → this).

import --estimate now covers an Exchange (EWS) source. A dry run already reports the per-folder counts; with --estimate it enumerates each folder's items with FindItem, which carries item:Size, so mail, calendar events and contacts are counted and sized straight from the enumeration — no body fetch, no writes.

The new-item count is taken against the archive with the same diff the import uses, so re-estimating a part-filled archive reports only what is left to fetch.

Changes

  • run_dry gains source_id + want_sizes; under --estimate it builds an ItemRunCtx with use_syncfolderitems: false (FindItem, not SyncFolderItems delta, so sizes are present) and pushes email/calendarevent/contactcard rows.
  • New pure helper items::new_count_and_bytes — diffs the enumeration against the local rows and sums the new items' reported sizes (an item the server returned without a size still counts, it just adds no bytes). Unit-tested directly in mock_exchange_ews.rs.
  • estimate_available adds ImportExchangeEws; help/README/fallback note updated to list exchange (EWS).

Verification

  • cargo fmt, cargo clippy --all-targets -D warnings, cargo test --locked (1197 lib + all integration, incl. the new estimate_counts_new_items_and_sums_their_sizes) all green.

Estimate stack so far: imap+maildir (#67) → caldav+carddav (#68) → takeout mail (#69) → EWS (this).

Stacks on #69 (merge order #67 → #68 → #69 → this). `import --estimate` now covers an Exchange (EWS) source. A dry run already reports the per-folder counts; with `--estimate` it enumerates each folder's items with **FindItem**, which carries `item:Size`, so mail, calendar events and contacts are counted and sized straight from the enumeration — no body fetch, no writes. The new-item count is taken against the archive with the same diff the import uses, so re-estimating a part-filled archive reports only what is left to fetch. ### Changes - `run_dry` gains `source_id` + `want_sizes`; under `--estimate` it builds an `ItemRunCtx` with `use_syncfolderitems: false` (FindItem, not SyncFolderItems delta, so sizes are present) and pushes `email`/`calendarevent`/`contactcard` rows. - New pure helper `items::new_count_and_bytes` — diffs the enumeration against the local rows and sums the new items' reported sizes (an item the server returned without a size still counts, it just adds no bytes). Unit-tested directly in `mock_exchange_ews.rs`. - `estimate_available` adds `ImportExchangeEws`; help/README/fallback note updated to list exchange (EWS). ### Verification - `cargo fmt`, `cargo clippy --all-targets -D warnings`, `cargo test --locked` (1197 lib + all integration, incl. the new `estimate_counts_new_items_and_sums_their_sizes`) all green. Estimate stack so far: imap+maildir (#67) → caldav+carddav (#68) → takeout mail (#69) → **EWS (this)**.
jcoffey-dev changed target branch from feat/estimate-takeout to main 2026-11-12 16:42:42 +00:00
jcoffey-dev added 1 commit 2026-11-12 16:42:42 +00:00
estimate: count and size an Exchange (EWS) mailbox
ci / test (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 6m12s
ci / announce (pull_request) Skipped
d4dec7ea70
--estimate now works for an EWS source. A dry run already reports the
folder counts; with --estimate it goes one step further and enumerates
each folder's items with FindItem, which carries item:Size, so mail,
calendar events and contacts are counted and sized without fetching a
body and without writing anything.

The new count is taken against the archive with the same diff the import
uses, so a re-estimate of a part-filled archive reports only what is
left. A pure helper, new_count_and_bytes, sums the new items' reported
sizes (an item the server returned without a size still counts) and is
unit-tested directly.
jcoffey-dev merged commit b8b6906ae7 into main 2026-11-12 16:45:23 +00:00
jcoffey-dev deleted branch feat/estimate-ews 2026-11-12 16:45:23 +00:00
Sign in to join this conversation.