Skip to content

feat(mail): M365 Graph sync + bot ETL loop (OO+Gmail) - #38

Merged
eSlider merged 2 commits into
mainfrom
feat/m365-mail-etl
Aug 14, 2026
Merged

feat(mail): M365 Graph sync + bot ETL loop (OO+Gmail)#38
eSlider merged 2 commits into
mainfrom
feat/m365-mail-etl

Conversation

@eSlider

@eSlider eSlider commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Merge Microsoft 365 Graph mail source (--source m365, delta commit-after-success) from feat/m365-sync-port.
  • Adapt compose/entrypoint ETL for bots: default onlyoffice,gmail, 300s poll, import on new>0, full --rebuild only with MAIL_SYNC_INDEX=1.
  • Fix Dockerfile mail-build stage order; add bin/stack/start-mail-sync + docs.

Test plan

  • go test ./bin/mail/sync/
  • python -m unittest bin.tools.test_stack
  • CI green on this PR
  • Optional: bin/stack/start-mail-sync with ~/.config/brain/mail.env + ~/.gmail-mcp

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)
Default compose mail-sync to onlyoffice,gmail every 300s with import on new
mail; gate full --rebuild behind MAIL_SYNC_INDEX. Fix mail-build stage order
and add bin/stack/start-mail-sync.
@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

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.

@eSlider
eSlider merged commit e28fb9f into main Aug 14, 2026
3 checks passed
@eSlider
eSlider deleted the feat/m365-mail-etl branch August 14, 2026 17:02
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