Skip to content

fix(exchange): load Encrypted Email Count from the input CSV - #227

Merged
NityamPareek merged 1 commit into
exchange-litigation-holdfrom
eo-fix-encrypted-csv-load
Nov 20, 2026
Merged

NityamPareek merged 1 commit into
exchange-litigation-holdfrom
eo-fix-encrypted-csv-load

Conversation

@NityamPareek

Copy link
Copy Markdown
Collaborator

Problem

When a CSV containing an Encrypted Email Count column was used as input with Encrypted Emails ticked:

  • _resolve_target_users detected the column (have_encrypted_email = True), so it treated encrypted data as present: no live scan was considered necessary for it and Mail.Read wasn't requested.
  • _prepare_batch_list never copied the column, so every row kept the default Encrypted Email Count = 0 and stats["encrypted_emails"] was 0.
  • In _run_scan_phases, has_encrypted_email_data was therefore False:
    • without credentials the phase was skipped, and the report, dashboard tile and ETA silently showed 0 encrypted emails;
    • with credentials the encrypted scan re-ran against the tenant even though the CSV already had the data.

Since encrypted emails are much slower to migrate, losing the counts also made batch ETAs too optimistic (all emails were treated as unencrypted).

Fix

Load the column like every other count column: have_encrypted_email = "Encrypted Email Count" in sample, then safe_int(src.get(...)) for user rows when scan_encrypted_email is ticked. Shared and group rows are unchanged (the encrypted scan only covers user mailboxes today).

Testing

  • Ad-hoc check (CSV with Encrypted Email Count 7 and 0): after the fix rows load 7/0, stats.encrypted_emails = 7 and the encrypted phase logs Skipping Encrypted Email Scan (Data present...); unticked doesn't load it. Before the fix rows were 0/0.
  • Offline suites: 225 tests pass.
_resolve_target_users detected the column, so it skipped auth and the
encrypted scan, but _prepare_batch_list never copied the values, so every
row kept 0. Load it like the other count columns.
@NityamPareek
NityamPareek merged commit 3fd4377 into exchange-litigation-hold Nov 20, 2026
1 check passed
@NityamPareek
NityamPareek deleted the eo-fix-encrypted-csv-load branch November 20, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant