MailBackup connects to your IMAP accounts and keeps a local, offline copy of your
mail as standard .eml files, indexed for fast full-text search. Everything stays
on your Mac — nothing is sent anywhere else.
- Multiple IMAP accounts with provider presets (Gmail, iCloud, Outlook, Fastmail, Yahoo, Purelymail, or any custom server). SSL/TLS and STARTTLS supported.
- Incremental, headers-first sync — UID-based; fetches envelopes first so the list fills instantly, then streams bodies. Uses
BODY.PEEK[], so mail is never marked read on the server, and handlesUIDVALIDITYresets. - Background sync & scheduling — runs as an app-level task on a WAL-backed database (browse while syncing); optional per-account interval (hourly/daily). Pause globally or per account.
- Local storage — each message saved as a portable
.emlon disk; metadata + a full-text index in SQLite. Paged loading keeps very large mailboxes fast. - Search, sort & filter — full-text search per-folder or across all accounts; sort by date/relevance, filter by unread / with-attachments / date range, and saved searches in the sidebar.
- Conversation view — optional grouping into threads by subject.
- Reading — three-pane UI with an HTML viewer that blocks all remote content (no tracking pixels), Rich/Plain toggle, and savable attachments.
- Spotlight — archived messages are indexed so macOS system search finds them.
- Dashboard, Jobs & Log — sync status and stats, a live view of sync runs, and a persistent activity log.
- Menu bar — mirrors the dashboard and shows a sync icon while syncing; toggle off in Settings.
- Import — bring in existing
.mbox,.eml, or ZIP-of-.emlarchives (into a local, never-synced account). - Export & print — a message as
.emlor PDF, print it, or export a folder/account as a zip or Maildir. - Notifications when a sync finishes or fails.
- Maintenance — verify archive integrity (and remove orphaned entries).
- Account management — edit connection details, change the password, pick which folders to archive, and remove an account (with its local archive).
- Privacy first — credentials in the macOS Keychain; optional at-rest encryption of
.emlfiles (pair with FileVault for full coverage).
Download the latest MailBackup-x.y.z.dmg from the Releases page, open it, and drag MailBackup into your Applications folder. Requires macOS 14 or later (Apple Silicon).
These builds are not notarized (not signed with an Apple Developer certificate), so macOS Gatekeeper blocks them on first launch with a message like "MailBackup can't be opened because Apple cannot check it for malicious software." This is expected — open it once using any of these, and macOS remembers the choice:
-
Right-click (or Control-click) MailBackup.app → Open, then click Open in the dialog.
-
On macOS 15 (Sequoia) the right-click option may not appear. Try to open the app, then go to System Settings → Privacy & Security, scroll to the Security section, and click Open Anyway.
-
Or, from Terminal, clear the quarantine flag:
xattr -dr com.apple.quarantine /Applications/MailBackup.app
Prefer to verify the code yourself? Build from source (below) instead.
Requires Xcode 16+ (developed against Xcode 26 / Swift 6.3) and XcodeGen. The Xcode project is generated from project.yml and is not checked in.
brew install xcodegen # once
xcodegen generate # creates MailBackup.xcodeproj
open MailBackup.xcodeproj # then press Run in XcodeOr build from the command line:
xcodebuild -project MailBackup.xcodeproj -scheme MailBackup -configuration Debug buildOn first launch, an onboarding flow walks you through adding an account, picking folders, choosing an archive location, and running the initial sync.
Tip: for Gmail / iCloud / Outlook / Yahoo / Purelymail, use an app-specific password rather than your main account password.
- SwiftUI + the Observation framework, macOS-native.
- swift-nio-imap + swift-nio-ssl for a pure-Swift async IMAP client over TLS.
- GRDB for SQLite with an FTS5 full-text index, in WAL mode.
- A small built-in MIME / RFC 2047 parser for extracting searchable text, HTML bodies, and attachments.
Sources/MailBackup/
├── App/ AppModel (root state), ActivityLog, RootView
├── Onboarding/ Multi-step setup wizard
├── Main/ 3-pane window: Dashboard, Search, Jobs, Log, message viewer
├── IMAP/ Async IMAP client built on swift-nio-imap
├── Sync/ SyncEngine — incremental UID sync orchestration
├── Mail/ MIME + RFC 2047 parsing
├── Storage/ GRDB database, repository, .eml ArchiveStore, Keychain
└── Models/ Account, Folder, Message, and view models
The app stores its database and .eml archive under
~/Library/Application Support/MailBackup (the archive location is configurable
during onboarding).
A few self-checks are wired into the binary behind environment variables and exit after running:
APP="$(find ~/Library/Developer/Xcode/DerivedData/MailBackup-*/Build/Products/Debug -name MailBackup -path '*MacOS*' | head -1)"
MAILBACKUP_STORAGE_TEST=1 "$APP" # migrations, .eml roundtrip, FTS, Keychain
MAILBACKUP_MIME_TEST=1 "$APP" # MIME / RFC 2047 parsing
MAILBACKUP_EXPORT_TEST=1 "$APP" # .eml + zip export
# Read-only end-to-end IMAP check (uses your own credentials, nothing is stored):
MAILBACKUP_IMAP_HOST=imap.fastmail.com \
MAILBACKUP_IMAP_USER=you@example.com \
MAILBACKUP_IMAP_PASS='app-password' \
"$APP"- All mail is stored locally; nothing is uploaded or shared.
- Passwords live in the macOS Keychain.
- The HTML viewer blocks every network request, so remote/tracking content never loads.
This is an early, actively developed project. Contributions and issues are welcome.
