Skip to content

About

macOS email archive explorer: MBOX/EML/MSG/Gmail import, threads, semantic search, AI Ask/summaries/analysis via NovaAIKit (Ollama, MLX, OpenRouter, OpenAI…) with built-in fallbacks and Keychain-only keys

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

 

History

94 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MBox Explorer

Build Version Platform Swift License Tests

Email archive explorer for macOS: multi-format import, threaded browsing, semantic search, and optional AI (Ask, summaries, extraction, analysis) that always has a built-in fallback.

MBox Explorer parses MBOX, EML, EMLX, MSG and Gmail Takeout archives into a fast, searchable, threaded interface, and keeps a library of archives that re-import only what is new. On top of that sit a retrieval-augmented "Ask" pipeline whose answers cite the exact emails they used, search inside attachments (PDF, OCR, Office), a People view, AI summaries and a set of analysis tools. AI is powered by NovaAIKit, the shared AI layer of Jordan's macOS apps: local backends first, Keychain-only keys, and a built-in (non-AI) result for every feature when AI is off or unreachable.

Written by Jordan Koch.


See it in action

A narrated tour of MBox Explorer (Nova's AI voice; all data on screen is synthetic sample data).

MBox Explorer 2.5: search inside email attachments and ask your archive, with citations

MBox Explorer 2.5: search inside email attachments and ask your archive, with citations

Architecture

graph TD
    subgraph Import
        A[MBOX / EML / EMLX / MSG / Gmail Takeout] --> B[MultiFormatImporter]
        B --> C[Streaming MboxParser]
        C --> CA[(Parse cache)]
        A --> LIB[ArchiveLibrary: skip unchanged files, add unseen messages]
        LIB --> LDB[(library.db)]
    end

    subgraph Attachments
        C --> MD[MIMEDecoder] --> TX[PDFKit / Vision OCR / Office XML]
        TX --> ADB[(attachments.db FTS5)]
    end

    subgraph Core
        C --> D[MboxViewModel]
        D --> E[Email model + thread detection]
        LDB --> D
        D --> G[Smart filters / tags / search]
        ADB --> G
        D --> PPL[PeopleIndex: timelines, who emails whom]
    end

    subgraph Search["Search & retrieval"]
        H[Question] --> I[Question router]
        I --> K[EmbeddingManager]
        I --> L[FTS5 keyword search]
        K --> N[(VectorDatabase SQLite)]
        L --> N
        ADB --> N
        N --> P[Context: statistics + numbered emails 1..n + history]
    end

    subgraph AI["AI (NovaAIKit)"]
        P --> AA[AppAI]
        F1[Summaries / extractors / analysis / chat] --> AA
        AA -->|AI on| NK[NovaAI: Auto failover, retries, validation]
        AA -->|AI off or down| FB[Built-in result]
        NK --> V{Validator}
        V -->|ok, citations valid| OUT[Answer + source label + clickable citations]
        V -->|rejected twice| FB
        FB --> OUT
    end

    subgraph Export
        D --> W[ExportEngine: CSV / JSON / Markdown / TXT]
        D --> RX[RedactedExporter: PDF / EML] --> AU[redaction-audit.json + library.db]
    end

    subgraph Widget["macOS Widget"]
        D --> Y[SharedDataManager] --> Z[WidgetKit S / M / L]
    end
Loading

AI backends and failover

graph LR
    R[Request] --> T{Use AI?}
    T -->|off| B[Built-in result]
    T -->|on| AUTO{Backend}
    AUTO -->|Auto| O[Ollama] --> M[MLX] --> TC[TinyChat] --> TL[TinyLLM] --> OW[OpenWebUI] --> NG[Nova Gateway] --> OR[OpenRouter*] --> OA[OpenAI*]
    AUTO -->|fixed| ONE[Chosen backend]
    OA -->|all failed| B
    ONE -->|failed| B
Loading

* keyed backends join the chain only when a key is stored in the Keychain; keys are only ever sent over https.


Features

New in 2.5

Feature What it does
Cited answers in Ask Every answer cites the retrieved emails as [1], [2], ...; click a citation (or a source row) to open that exact email. Citations to emails that were not sent are rejected. Works with AI off too (the built-in answer cites its matches).
Archive Library Point it at a folder, a mail file or a Gmail Takeout (folder or .zip). "Import New" reads only changed files and adds only unseen messages (Message-ID or content hash). Stored in SQLite; archives open instantly.
Attachment search Text from PDFs (PDFKit), images (Vision OCR), Word/RTF and Excel/PowerPoint (Office Open XML) is indexed on this Mac and found by the main search, Ask, and the Attachments view's "Inside attachments" list. Export saves the real files.
People Per-contact sent/received counts, first and last contact, a monthly timeline, who they email and who emails them, and their messages. Optional AI profile.
Duplicates and redacted export Duplicates across library archives; redacted export to PDF or EML with redaction-audit.json (rules and per-email counts, never the redacted values).

Email parsing and browsing

Capability Details
Formats MBOX, EML, EMLX, Outlook MSG, Gmail Takeout ZIP
Archive Library Named archives from folders, files or Takeouts; incremental re-import (unchanged files skipped, only new messages added)
Streaming parser One email per From boundary, peak memory about one message; honors mbox >From quoting
Parse cache Keyed by path + size + mtime; reopening an unchanged archive is near-instant
Auto-reopen The last archive reopens on launch; indexing is resumable and cancellable
Threads Message-ID / In-Reply-To / References
Filters and search Smart filters, saved searches, regex search, command palette, quick open
Attachments Browse, export the real files, and search inside them (PDF, OCR, Office, RTF)
People Per-contact timelines, who emails whom, first/last contact
Tools Duplicate finder (per mailbox and across archives), PII redaction with PDF/EML export and audit trail, mailbox merger, tags and collections, email diff

AI (NovaAIKit)

Settings › AI (or the gear next to the AI status dot in the toolbar):

  • Use AI on/off. Off means nothing is sent anywhere and every feature uses its built-in result.
  • Backend: Auto (Ollama → MLX → TinyChat → TinyLLM → OpenWebUI → Nova Gateway → OpenRouter → OpenAI), or one fixed backend. Per-backend URL and model (listed from the server), timeout, Test connection.
  • Keys (OpenRouter, OpenAI, optional OpenWebUI) go only to the macOS Keychain under com.jkoch.mboxexplorer.<backend>; a stored key shows as "stored", never as text.
  • Status indicator (toolbar, Ask, Conversations): green online with backend and model, orange offline, grey off; click to re-check.
  • Validation: replies are cleaned of reasoning blocks, must be non-empty and length-capped; summaries and statistics answers are rejected if they contain figures that are not in the emails. A rejected reply is re-asked once, then the built-in result is used.
Feature With AI Built-in result (AI off / unreachable / rejected)
Summarize email / thread 2-4 sentence summary, labelled with its source First lines of the message, with the reason
Ask (RAG Q&A) Answer grounded in mailbox statistics and retrieved emails, with clickable [n] citations to the exact emails The reason plus the top matching emails, each cited and clickable
Conversations Multi-turn chat over the archive with citations and follow-ups The reason plus the matching emails (cited)
Action items, meetings, natural-language filter, topic labels Parsed from the AI reply Keyword/rule results or empty
Digests, person profiles, executive summary AI narrative plus computed statistics Computed statistics with a short "AI unavailable" note
Smart replies, follow-ups, meeting responses Drafted by AI Templates
Persona chat, hypotheticals, time travel, decisions, commitments, relationships, drafts, forwarding, daily briefing AI analysis The analysis says why AI was not used; rule-based parts still run

Semantic search (embeddings)

Embeddings are separate from chat AI (Settings › AI › Semantic Search). Keyword (FTS5) search always works.

Provider Type Notes
Ollama Local Uses the Ollama URL from the AI settings
Balanced (all local models) Local Round-robins bulk indexing across every local Ollama model
MLX Local Apple Silicon
Sentence Transformers Local pip install sentence-transformers
TinyChat / OpenWebUI Local / self-hosted OpenAI-compatible endpoints; OpenWebUI key in the Keychain
OpenAI Cloud Uses the OpenAI key from the AI settings (Keychain)

Analysis, export and visualization

  • Sentiment dashboard (NaturalLanguage), phishing/threat detection, email forensics, relationship map, People view
  • Export: TXT, CSV, JSON, Markdown, per email or per thread, AI-ready chunked export, contacts (vCard/CSV), redacted PDF/EML with an audit trail
  • Spotlight indexing, Quick Look, follow-up notifications
  • Statistics dashboard (Swift Charts), network graph, timeline, heatmap, word cloud

macOS widget and Nova API

  • WidgetKit small/medium/large widgets; data shared through App Group group.com.jkoch.mboxexplorer.
  • Loopback-only status API on port 37434: curl http://127.0.0.1:37434/api/status.

Requirements

  • macOS 14.0 or later
  • For AI: any one backend, e.g. Ollama (brew install ollama && ollama pull qwen3:8b). Everything works without AI.

Installation

From DMG

  1. Open MBox Explorer-v2.5.0-build5.dmg and drag MBox Explorer onto Applications.
  2. Local builds are ad hoc signed. If macOS blocks the first launch: System Settings › Privacy & Security › Open Anyway (or xattr -dr com.apple.quarantine "/Applications/MBox Explorer.app").

Developer-ID signed, notarized releases are produced by scripts/release.sh (see RELEASE.md).

From source

Requires Xcode 16 or later:

git clone git@github.com:kochj23/MBox-Explorer.git
cd MBox-Explorer
open "MBox Explorer.xcodeproj"     # resolves NovaAIKit

Usage

  1. Open an archive (File › Open), or add folders and Takeouts to the Archive Library and use Import New whenever new mail arrives.
  2. Browse in list, three-column, timeline, heatmap, network or People view.
  3. Optionally index emails for semantic search, then use Ask or Conversations; click a [n] citation to open the email it came from.
  4. In Attachments, use Index Attachment Text once; after that the main search finds text inside attachments.
  5. Use Summarize in the email detail toolbar; the sheet shows whether the summary came from AI or is built-in.

Tests

259 tests, all passing, including the 2.5 suites (CitedAnswerTests, ArchiveLibraryTests, AttachmentSearchTests, PeopleIndexTests, RedactedExportTests) and AIKitAdoptionTests in seven categories (security, performance, retry, unit, integration, functional, frame/UI state). AI tests use in-memory settings and key stores and a local URL protocol: no Keychain or network access.

xcodebuild -project "MBox Explorer.xcodeproj" -scheme "MBox Explorer" -destination "platform=macOS" test

Security and privacy

  • Local-first: Ollama/MLX/TinyChat/TinyLLM/OpenWebUI run on your machine or LAN; cloud backends are opt-in.
  • API keys only in the macOS Keychain (com.jkoch.mboxexplorer.*), only sent over https.
  • Upgrading from 2.3 or earlier migrates once: old settings are imported; plaintext OpenAI keys (UserDefaults or cloud_credentials.json) move to the Keychain and the plaintext copies are deleted; secrets of the removed Google Cloud / Azure / AWS / IBM backends are deleted.
  • Parameterized SQL everywhere; loopback-only API server; no telemetry.
  • Email-derived stores (vectors.db, library.db, attachments.db) are owner-only (0600). Attachment text is extracted on this Mac; nothing is uploaded.
  • Path safety: library discovery ignores symlinks that leave the archive folder; Takeout and Office zips are extracted with ditto into private temporary folders; exported attachment names are sanitized so they cannot escape the chosen folder. Answers can only link to cited emails, never to web pages or files.
  • Redaction audits record counts and hashed message keys only, never the redacted values.

Changelog

See CHANGELOG.md. 2.5.0: cited answers, Archive Library, attachment search, People view, redacted PDF/EML export with audit trail. 2.4.0: AI migrated to NovaAIKit 1.0.0.

License

MIT License, Copyright 2026 Jordan Koch. See LICENSE.


Written by Jordan Koch (@kochj23)

About

macOS email archive explorer: MBOX/EML/MSG/Gmail import, threads, semantic search, AI Ask/summaries/analysis via NovaAIKit (Ollama, MLX, OpenRouter, OpenAI…) with built-in fallbacks and Keychain-only keys

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages