Add JMAP push through EventSource #66
No reviewers
Labels
No labels
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/mail-mind-mcp!66
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/jmap-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #56. Part of epic #51 (phase 6).
Stacked on #65. This branch includes the Stalwart commit, because the push test runs on Stalwart. Merge #65 first; this PR then shows one commit.
What this adds
PushStreamruns in a daemon thread per JMAP account. It opens the session'seventSourceUrlwithtypes=Email,Mailbox,closeafter=noandping=30.apiUrl, and the stream sends the same bearer token.StateChangethat namesEmailorMailboxfor this account setschanged. Other accounts and other types are ignored.changedtoo, including each reconnect, so mail that arrived while the stream was down is mirrored by the next pass.JmapSource.waitstarts the stream and then callssource.sleep, which now takes an optionalchangedevent. The wait still checks the outbox everyoutbox_poll_secondsand still ends atinterval_seconds. While the stream is down, it is the old sleep.sync.idle = falseturns push off, as it turns off IMAP IDLE. The config comment, README,config.example.toml, SECURITY.md (push is one more outbound request, with no inbound port), ADR 0006 §9 and CLAUDE.md are updated.checkreportspush=yes|no.httpx-sseis now a direct dependency (0.4.3, already in the lock through mcp).Tests
idle = falseopens no stream;closestops reconnects;make check: 172 passed; ruff, mypy and pip-audit are clean.make test-integration: 12 passed.Not covered
🤖 Generated with Claude Code