Skip to content

feat(mail): catch verification codes that land in junk - #13

Merged
gopkg-dev merged 1 commit into
mainfrom
feat/junk-verification
Nov 25, 2026
Merged

gopkg-dev merged 1 commit into
mainfrom
feat/junk-verification

Conversation

@gopkg-dev

Copy link
Copy Markdown
Owner

Why

Providers such as Outlook often file one-time codes (e.g. TikTok sign-in codes) as junk. DaMail only analyzed new inbox mail, so those codes were never extracted, never pushed, and didn't show up under the Verification category. There was also no place to see junk across all mailboxes.

What

Analysis and push

  • New junk mail (dated within 3 days) is analyzed like inbox mail, but only pushes message.verification: no inbox rules run and no message.received / message.important notifications go out for junk.

Sync

  • Junk is synced alongside the inbox every minute instead of waiting for pollInterval (default 5 min).
    • Graph: polled together with the inbox.
    • IMAP: a 60 s STATUS check on UIDNEXT; the folder is synced only when it changed, so the account doesn't flip to "syncing" every minute.

Views and counts

  • The Verification category count and list include junk; other categories and cross-folder views still leave junk out.
  • New cross-mailbox Junk view in the sidebar (view=junk, junkTotal in stats); REST /api/v1/threads accepts view=junk.

Move to Inbox

  • In junk (per-mailbox folder or the Junk view), the list toolbar and thread context menu show Move to Inbox instead of Archive.
  • The reader toolbar and message context menu show it whenever a message is in junk.
  • threads/batch accepts action: inbox and only moves the junk messages of each thread; merged cross-mailbox copies move too.

Docs

  • zh/en docs updated: analysis, rules, notifications, mailboxes, mail and REST API.

Testing

  • pnpm typecheck passes.
  • pnpm test passes: server 183, web 18.
  • New server/test/junk-verification.test.ts covers:
    • junk analysis pushes only codes and skips rules
    • the inbox behaves as before
    • Verification counts and lists include junk; other categories don't
    • the Junk view and junkTotal
    • threadMessageIds(…, 'inbox') picks only junk messages
  • Checked locally in the browser: the Junk view lists junk from all mailboxes, and the toolbar shows Move to Inbox when threads are selected. Clicking it was not exercised against a real mailbox.

🤖 Generated with Claude Code

Providers such as Outlook often file one-time codes as junk, where
DaMail never analyzed them and no notification went out.

- Analyze new junk mail like the inbox, but only push
  message.verification: no inbox rules and no received or important
  notifications for junk
- Sync junk alongside the inbox every minute: Graph polls it with the
  inbox, IMAP checks UIDNEXT with STATUS and syncs only on change
- Count and list junk mail under the Verification category; other
  categories and cross-folder views still leave junk out
- Add a cross-mailbox Junk view (view=junk) with a junkTotal count
- Add "Move to Inbox" to the junk list toolbar, thread and message
  context menus and the reader; threads/batch accepts action=inbox
  and only moves the junk messages of each thread

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gopkg-dev
gopkg-dev merged commit 54b0ce1 into main Nov 25, 2026
1 check passed
@gopkg-dev
gopkg-dev deleted the feat/junk-verification branch November 25, 2026 00:20
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.

1 participant