Repository navigation
feat: secure Purelymail history setup - #81
Draft
github-actions[bot] wants to merge 9 commits into
Draft
github-actions[bot] wants to merge 9 commits into
github-actions[bot] wants to merge 9 commits into
Conversation
lumenstech
marked this pull request as draft
October 13, 2026 15:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.