feat(mail): add Microsoft 365 Graph sync source with delta state - #39
Closed
eSlider wants to merge 1 commit into
Closed
feat(mail): add Microsoft 365 Graph sync source with delta state#39eSlider wants to merge 1 commit into
eSlider wants to merge 1 commit into
Conversation
Adds a GET-only Microsoft Graph source to bin/mail/sync (client-credentials, delta query). Wires it into the CLI (--source m365), the worker pool and the compose stack: - m365.go: M365Client (token cache, delta pagination, message normalization, attachment download) + m365Source adapter (per-mailbox folders + delta link) - sync.go: M365Credentials in SyncConfig; Committer interface so delta links only advance after a fully successful run (no skips on failure) - cli.go: --source m365 with M365_/MS_ env passthrough - Dockerfile: mail-build stage produces /mail-sync into the index image - docker-entrypoint: mail-sync loop (sync -> import -> index, default 10s) - compose.yaml: mail-sync service (index image, kb-var volume, secrets ro)
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Owner
Author
|
Superseded by #38 (identical M365 source already merged upstream). Closing as duplicate; local work is reconciled via upstream main. |
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.
What
Adds a GET-only Microsoft Graph source to
bin/mail/syncusing the client-credentials flow (app registration withMail.Readapplication permission). Pulls inbox mail for a list of users without ever marking it read, and persists a per-mailbox delta link so incremental syncs only fetch what's new.This is a faithful port of a locally-built M365 source onto the current
main(57 commits ahead of the fork snapshot).Changes
bin/mail/sync/m365.go—M365Client(token cache with expiry, delta-query pagination, message normalization to the sharedMessagecontract, attachment$valuedownload) +m365Sourceadapter (folderm365/<localpart>/, delta state file).bin/mail/sync/m365_test.go— httptest-based unit tests (token caching, tombstones skipped, delta pagination, message normalization, delta-state commit).bin/mail/sync/sync.go—M365CredentialsinSyncConfig;Committerinterface so a delta link only advances after every listed message downloads (a killed/failed run stays retryable without gaps).bin/mail/sync/cli.go—--source m365withM365_/MS_env passthrough.Dockerfile—mail-buildstage builds/mail-syncinto theindeximage.bin/docker-entrypoint—mail-sync [N]loop (sync → import → index, default 10s, index only whennew>0).compose.yaml—mail-syncservice (index image, sharedkb-varvolume, secrets read-only from~/.config/brain/m365.env).Verification
go test ./bin/mail/sync/ ./internal/...all green.new=0on subsequent runs; read flags unchanged on the server.indexed 8146/8146;bin/kb/searchreturns mail results.