Files
FamReynaBrain/areas/operations/apple_mail_local_read_research_2026-08-03.md
T
Adolfo Reyna 0f84463a9f housekeeping 2026-08-05: organize PARA, clean inbox, archive travel, restore paper-apps
- Inbox -> archives/inbox_processed: ari_followup (Sardius), remarkable_inbox, tic_tac_toe_state
- Inbox images -> resources/kids-os (KidsOS UI 2026-07-28)
- Archives/travel/2026: Aeromexico HCYDNU confirmation + Hertz BOS L670EDC05D8
- Exports/calendars: all_flights, chiapas TGZ, maine BOS ICS
- Areas: chiapas_trip_2026-09 (HCYDNU booked), trump_accounts_and_emi_board_2026 (Trump accounts + EMI FL board), operations audits (hermes migration + Apple Mail local research)
- Projects new (enriched stubs from MEMORY.md): xiao_epaper 400x300 (5-pass grayscale), mac_privacy_migrations (Xcode signing), remarkable_pro workflow (132 + watchdog + art), tactility_humation_avatars (320x240 pre-render), voice_dev_infra (network map .102/.110/.150)
- Paper-apps: restored detailed README (181 lines porting guide) + enriched paper_apps_golf_galaxy_zero project with full mechanics cross-ref
- Maine wedding: Hertz rental 63 L670EDC05D8 + tolls (PlatePass vs SunPass PRO) — intentional addition kept
- 220 Emerald: removed duplicate consolidated junk appended at end (142 lines clean)
- Removed runtime logs: chrome.err (288 lines), chrome.log tracked -> now ignored per .gitignore
- Clean empty inbox
2026-08-05 14:33:41 -04:00

5.2 KiB

title, date, status, scope, sources
title date status scope sources
Apple Mail local-store reader — research only 2026-08-03 deferred potential workflow improvement; no implementation authorized
https://github.com/hexrw/mailgrep
https://github.com/imdinu/apple-mail-mcp
https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html

Apple Mail local-store reader — research only

Decision

Potential improvement to the MacMiniMCP/Hermes email workflow. Do not implement, install, grant permissions, or alter the current Mail/MCP setup without renewed user approval.

The desired end state includes all accounts configured in macOS Mail, including personal, EMI, and the assistant's own Mail account, subject to what is locally cached and the account protocol permits.

Why it was explored

Apple Mail automation/JXA can enumerate accounts and work for a selected Exchange inbox item, but it performs poorly against the large combined inbox (about 25k messages observed), timing out during account-scoped traversal. It is not a dependable full-history search backend.

Candidate approach: direct local Mail store, read-only

mailgrep is the preferred design reference:

  • MIT-licensed, read-only by construction; no code path to send, move, delete, or flag messages.
  • Reads Apple Mail's local Envelope Index SQLite database for metadata and .emlx files for locally materialized bodies/attachments.
  • Uses a snapshot copy of the SQLite database plus -wal and -shm sidecars, then opens the copy read-only. Reading the primary database alone may omit recent data in WAL mode.
  • Performs metadata filtering in SQLite and parses local messages for bodies/attachments.
  • Has a doctor/coverage concept: explicitly report messages that are indexed without a body file, body files not indexed, unreadable items, and potential staleness instead of silently pretending coverage is complete.
  • Mail database schemas are undocumented and can vary by macOS release, so runtime schema discovery/validation is required. Message database row IDs are not durable identifiers; an RFC Message-ID is safer for persistent references.

The apple-mail-mcp project independently confirms the operational model: direct Envelope-Index reads and an FTS5 index avoid AppleScript timeouts on large mailboxes. It is GPL-3.0, so it is research-only/reference-only for our codebase; do not copy its implementation.

Account/protocol implications

  • Personal Gmail / IMAP / iCloud / On My Mac: likely good candidates for a local-store reader when Mail has downloaded the messages. Direct local reads can support fast read-only list/search/read flows.
  • EMI Exchange / EWS: local body coverage may be incomplete or absent because messages can remain server-resident and be fetched on demand. Direct local storage should not be treated as a complete EMI historical-email solution.
  • Assistant Mail account: include it in account discovery and the same read-only eligibility/coverage report. Do not special-case its credentials or access another credential store.
  • Attachments: local readers must distinguish inline, locally externalized, and never-downloaded attachments; never report an empty file as a successful extraction.

Permission and safety model

macOS protects the Mail store with TCC. A future local reader needs Full Disk Access granted to the application/process that launches it (for example, the MacMiniMCP service context), not just its executable. This is a broad system privacy permission, so it must be explicitly approved first.

A read-only local-store implementation should deliberately avoid AppleScript synchronization. Synchronizing Mail via Apple Events would additionally require Automation access and creates a broader control surface than this workflow needs.

  1. Add a small read-only adapter to MacMiniMCP using the public MIT-compatible design principles above.
  2. First run a non-mutating doctor/coverage probe after explicit Full Disk Access approval.
  3. Expose account discovery, mailbox discovery, bounded metadata list/search, selected-message read, and attachment-state reporting.
  4. Retain Apple Mail automation only as an explicitly labeled fallback for Exchange/current-message access.
  5. Evaluate Microsoft Graph delegated OAuth separately if reliable full EMI/Exchange historical search becomes necessary.
  6. Test with synthetic Mail-store fixtures plus opt-in live read-only checks; do not persist Apple database row IDs across sessions.

Original evidence / sources

Local observation, 2026-08-03

An ordinary file scan did not reveal candidate Mail database/message files. This is not evidence that the store is absent: it is consistent with protected-directory visibility under macOS privacy controls. No Full Disk Access was requested or changed.