Skip to content

sstanovnik/mailbox-pdf

Repository files navigation

MailboxPDF

CI Release License Documentation Web App Platforms Rust

Turn saved email archives into PDFs you can read, share, and keep.

MailboxPDF helps you take a saved email archive and turn it into a clean PDF. It is designed to feel safe and predictable: it works on your own machine, it does not pull in content from the internet, and the same main choices are available in the desktop app, the command-line tool, and the web app.

What MailboxPDF Does

  • Open saved email archives such as .mbox files.
  • Save one PDF, one PDF per email, or one PDF per conversation.
  • Check the result before saving it, including the file names MailboxPDF plans to use.
  • Start with built-in presets instead of setting everything by hand.
  • Keep plain-text email, formatted email, pictures, attached PDFs, and common office files such as Word and spreadsheet documents together in one export.
  • Keep your mail on your own machine while it is opened, previewed, and turned into PDFs, with no internet connection required.
  • Use it on Linux, macOS, Windows, and on the web.
  • Choose from English, Slovenian, German, French, Macedonian, Russian, Japanese, Swedish, Spanish, Portuguese (Brazil), Italian, Dutch, Polish, Simplified Chinese, and Korean.

Quick Start

If you want the simplest path, start with the desktop app or the web app.

Desktop App

Download the latest desktop app that matches your computer:

Typical flow:

  1. Open or drag in a saved mailbox file such as an .mbox file.
  2. Pick a preset or change the export options.
  3. Check the preview and the file names it will save.
  4. Save the PDFs.

Web App

If you do not want to install anything, use the hosted web app:

Open MailboxPDF in your browser

The web app uses normal file picking, drag and drop, and browser downloads.

Command Line

If you prefer a terminal, downloadable CLI builds are available for:

You can also run the command-line tool directly from this repository.

Preview a mailbox without saving files:

cargo run -p mbox-pdf-cli -- inbox.mbox

Save one PDF:

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out

Save one PDF per conversation with a preset:

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out \
  --preset thread-digest

Show the built-in presets:

cargo run -p mbox-pdf-cli -- --list-presets

Command-line notes:

  • Without --write, MailboxPDF only shows you what it plans to save.
  • --preset thread-digest is a good starting point if you want one PDF per conversation.

Common Ways to Use It

Save One Whole Mailbox as One PDF

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out \
  --export-mode single

Save One PDF Per Email

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out \
  --export-mode per-message

Read Emails by Conversation

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out \
  --preset thread-digest

Make a Smaller Review Copy

cargo run -p mbox-pdf-cli -- inbox.mbox \
  --write \
  --output-dir out \
  --preset compact-review

Things to Know

  • Conversation grouping depends on the reply information saved in the emails themselves, so messy archives can still group imperfectly.
  • Hiding long quoted replies is intentionally cautious.
  • Formatted emails may not look exactly the same as they did in the original mail app.
  • The preview is close to the final result, but complex email layouts and attached PDFs can still look slightly different after export.
  • In the web app, saving one PDF per email or conversation can trigger several download prompts.
  • Very large mailboxes or mailboxes with many attachments can take noticeable time and memory.

For Developers

MailboxPDF is a Rust workspace with three crates:

  • crates/core for shared parsing, preview, planning, rendering, and PDF export
  • crates/cli for the command-line interface
  • crates/gui for the native and browser-based GUI

The static project site is rendered by xtask from shared Rust page templates plus site-specific .po catalogs under site/locales/. The app UI continues to use .po catalogs under crates/core/locales/.

Common development commands:

  • make validate runs formatting checks, linting, tests, and check-only validation
  • make build builds native, wasm, and packaged web outputs
  • make gh-pages builds the GitHub Pages bundle under target/gh-pages/ and prepares the local publish branch
  • cargo run -p xtask -- gh-pages-minify target/gh-pages runs the Pages bundle minifier directly
  • cargo run -p xtask -- gh-pages-prepare prepares the local Pages worktree and single-commit branch directly
  • cargo run -p xtask -- serve-gh-pages target/gh-pages serves the staged Pages bundle locally
  • make serve-web builds and serves the local GitHub Pages site from target/gh-pages/
  • make test-visual runs visual regression tests
  • make benchmark runs the benchmark harness

Planning and implementation tracking live in PLAN.md and IMPLEMENTATION_CHECKLIST.md.

Manual GitHub Pages Packaging

To prepare and locally commit a project site for a gh-pages branch without maintaining a custom GitHub Actions build workflow:

make gh-pages

That command:

  • stages a deployable static site under target/gh-pages/
  • minifies the staged HTML, inline CSS/JS, generated JavaScript, and strips removable WebAssembly custom sections for a smaller Pages bundle
  • syncs a dedicated local worktree at .worktrees/gh-pages/
  • rebuilds gh-pages as a single-commit local branch for force-push-based publishing

The staged site has this shape:

  • target/gh-pages/index.html for the project landing page
  • target/gh-pages/app/ for the WebAssembly GUI bundle
  • target/gh-pages/.nojekyll so GitHub Pages serves the files directly

The intended branch-publish flow is:

  1. Run make gh-pages.
  2. Review the prepared branch in .worktrees/gh-pages/ if you want.
  3. Push gh-pages with force when you are ready.

make gh-pages refuses to overwrite uncommitted changes in .worktrees/gh-pages/, so manual edits on that branch stay protected until you commit or clean them yourself. Each successful run then rewrites the branch back down to one fresh publish commit.

That keeps the public project URL available for a landing page while the browser app lives at /app/.

For a local preview of the built Pages site, run make serve-web. The server listens on http://127.0.0.1:8080/ by default, and you can override the port with SERVE_WEB_PORT=<port>.

License

MailboxPDF is licensed under the GNU Affero General Public License v3.0 only. See LICENSE.

About

Flexible .mbox to PDF conversion for saved email archives.

Resources

License

Stars

Watchers

Forks

Contributors

Languages