Skip to content

Ingest mail

Read this if you want OMem to ingest your email. On macOS it reads Apple Mail’s local store (mail-app) — which already holds the mail your Exchange / IMAP accounts sync down — so there’s no browser automation and no Graph API.

Mail lives in a protected location, so OMem needs Full Disk Access — and macOS never prompts for it automatically:

Terminal window
omem setup --grant-tcc

This opens System Settings → Privacy & Security → Full Disk Access and reveals the omem binary so you can add it. Add omem itself, not Terminal — see the setup wizard’s permission note for why this matters for scheduled runs.

  1. Accounts — which mail accounts to ingest (empty = all configured):

    Terminal window
    omem config set kinds.mail.source_config.accounts '["you@company.com"]'
  2. Folders — defaults to inbox + sent; widen if you want:

    Terminal window
    omem config set kinds.mail.scope.folders '["inbox", "sent", "archive"]'
  3. Time window — how far back to reach (default 3 months):

    Terminal window
    omem config set kinds.mail.scope.time_window.since 6m_ago
  4. Enable and ingest:

    Terminal window
    omem config set kinds.mail.enabled true
    omem ingest --kind mail

OMem aggregates an entire email thread into a single wiki page — not one page per message. A 6-message back-and-forth becomes one coherent page with the full exchange, which is both cheaper (one curation call) and far more useful to query than six fragments. Attachments inside the thread are parsed too, each through its format’s parser.

SettingDefaultWhat it does
kinds.mail.scope.max_messages_per_account5000Cap per account.
kinds.mail.scope.max_message_size_mb50Skip messages larger than this (a metadata-only line is kept).
kinds.mail.scope.include_attachmentstrueIngest attachments.
kinds.mail.scope.max_attachment_size_mb50Skip larger attachments (metadata-only line kept).
Terminal window
omem query "something you remember discussing" --kind mail
omem wiki ls --kind mail

Getting zero results? See mail returns nothing — usually FDA, a too-narrow time window, or a folder name mismatch.