Skip to content

feat: secure Purelymail history setup - #81

Draft
github-actions[bot] wants to merge 9 commits into
mainfrom
codex/purelymail-secure-setup
Draft

github-actions[bot] wants to merge 9 commits into
mainfrom
codex/purelymail-secure-setup

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

Add an owner-only Purelymail setup flow for encrypted, paused-by-default Sent history import.

Problem

The importer used deployment-level mailbox credentials and lacked a safe browser setup flow. Cursor state also needed folder and UIDVALIDITY evidence to prevent repeated or cross-folder batches.

Solution

Store the owner credential with versioned AES-256-GCM encryption. Require the authenticated owner and a real browser session. Keep save and replace paused. Require explicit enable confirmation before read-only IMAP sync. Add pause and remove controls that preserve imported history. Sanitize sync errors and add strict cursor progress tests.

Preserve failed-message progress for retry. Preserve the sync lease during direct timer polls. Pass the already-claimed row from the mailbox tick to avoid resetting or duplicating the lease.

UX Flow

Enter password and Sent folder
└─ Save encrypted credential; sync stays paused
   └─ Explicit enable confirmation
      └─ Initial Sent import, 60-second polling, batches of 50

Verification

Focused credential, identity, onboarding, mobile action, and mailbox lease tests pass: 48 tests, 0 failures.

Prisma schema validation, changed-file Biome checks, diff checks, and API bundling pass. Full repository typecheck remains blocked by unrelated missing workspace dependencies in this isolated checkout. The branch uses the documented draft/WIP no-verify push path for GitHub CI.

No production database, mailbox, credential, CRM write, schema deploy, or release branch changed.

@lumenstech
lumenstech marked this pull request as draft October 13, 2026 15:13
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.

0 participants