Skip to content

Harden Outlook mailbox pool polling and health checks - #90

Merged
AaronL725 merged 19 commits into
mainfrom
feature/outlook-mailbox-hardening
Sep 14, 2026
Merged

AaronL725 merged 19 commits into
mainfrom
feature/outlook-mailbox-hardening

Conversation

@AaronL725

Copy link
Copy Markdown
Owner

Summary

Strengthen the Outlook mailbox-pool implementation across protocol correctness, retry behavior, lifecycle management, and diagnostics.

Mail polling

  • Replace IMAP message-count/sequence tracking with UIDVALIDITY + UID cursors.
  • Parse IMAP special-use folders and modified UTF-7 names, quote mailbox names safely, and cache the prepared folder set/connection during the OTP window.
  • Monitor Microsoft Graph Inbox and JunkEmail with immutable message IDs plus received-time frontiers instead of totalItemCount.
  • Keep Graph listing lightweight and fetch message bodies only for newly crossed frontier items.
  • Keep uninspected Graph messages retryable after transient detail-fetch failures and guard against cross-folder replay.

Reliability and security

  • Tighten verification-code extraction to explicit OTP context or trusted xAI/Grok sender domains.
  • Reuse preflight access tokens and IMAP connections instead of immediately refreshing again.
  • Add bounded Microsoft HTTP concurrency, Retry-After handling, exponential backoff, jitter, and transient retry coverage.
  • Make Outlook opaque mailbox handles one-shot and release credential-bearing mailbox state immediately after polling finishes or is cancelled.
  • Preserve independent pre-send channel baselines: a channel without a safe baseline remains disabled for that registration attempt.

Diagnostics and UI

  • Add safe Outlook mailbox-pool health checks to both GUI and WebUI.
  • Health checks validate IMAP/Graph access without starting an xAI registration and return only safe account/channel metadata.
  • Keep the Web health endpoint local-only, non-cacheable, and serialized against registration/maintenance work.

Validation

  • Expanded Outlook regression coverage for UID cursor behavior, UIDVALIDITY changes, Graph JunkEmail, cross-folder moves, transient detail-fetch failures, OTP false positives, token reuse, Retry-After, one-shot handles, cancellation cleanup, health APIs, and secret hygiene.
  • Full test suite passes on Python 3.9 and 3.13 (290 tests), along with compile checks, JavaScript syntax checks, diff hygiene, and Outlook-specific invariant checks.

Copilot AI lite review requested due to automatic review settings September 14, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AaronL725
AaronL725 merged commit 6b7f032 into main Sep 14, 2026
2 checks passed
@AaronL725
AaronL725 deleted the feature/outlook-mailbox-hardening branch September 14, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants