A simple web app for viewing and navigating the contents of .mbox or .zip (containing .mbox files) email archives. Built for privacy, all parsing is done in memory and no email content or attachments are stored on disk.
- Getting Started
- Example/Test Mbox Files
- Features & Requirements
- Privacy & Security
- Technical Details
- Credits
- Model
- License
- To Do
- Node.js (v18+ recommended)
- npm
-
Clone the repository:
git clone https://github.com/chrsptn/mbox-viewer.git cd mbox-viewer -
Install all dependencies (root, server, client) with one command:
npm run install-all
-
Start both backend and frontend together:
npm run dev
This will run both the Express backend and the Vite React frontend concurrently.
-
Open the app:
- Visit http://localhost:5173 in your browser.
- Drag and drop a
.mboxor.zipfile (max 30MB) or use the file picker. - Wait for the server to process and return the parsed emails.
- Browse threads in the left column; view and download attachments in the right panel.
- Collapse/expand individual emails for easier navigation.
- Print or export to PDF for a clean, single-column output.
- Optional: Enable "Cache emails in browser storage" before uploading to store parsed threads in IndexedDB. On refresh, the app will load cached threads and skip the upload UI.
Sample mbox files for testing are provided in the example/ directory:
example/sample.mbox: A sample mbox file containing 100 emails with a variety of subjects.example/sample.mbox.zip: A zip archive containing the same sample mbox file, for testing zip upload support.
You can generate a sample mbox file using the provided script:
cd example
node generate.jsThis will create a sample.mbox file with 100 emails and a sample.mbox.zip archive. You can use these files to test the application's upload and parsing features.
- On the app's upload screen, drag and drop
sample.mboxorsample.mbox.zip, or use the file picker to select one of these files. - The app will process and display the emails for navigation and testing.
- First Use State:
- Full-viewport drag-and-drop or file picker for .mbox or .zip upload.
- 30MB file size limit enforced on upload.
- Processing:
- Server parses the .mbox file (directly or extracted from .zip) using
mailparser. - All parsing is in-memory; no data is written to disk.
- Emails are grouped by subject, ignoring prefixes like
Re:,Fw:,Fwd:, andAutomatic reply:(recursively). - Special handling for Google Calendar notifications: if an email has an attachment named
invite.ics, the subject is normalized by removing the prefix up to the first:and the last string within parentheses. - JSON response includes:
- Subject
- Sender
- Recipients (to, cc, bcc)
- Body (escaped HTML, including embedded attachments)
- All attachments (with mime-type, filename, and base64-encoded content)
- Server parses the .mbox file (directly or extracted from .zip) using
- Client UI:
- Left column lists all subject groups, ordered by the most recent email in each group.
- Paperclip icon indicates threads with downloadable attachments.
- Clicking a subject shows the thread in the right panel.
- Each email in the thread is shown in a card, with sender, date, recipients, body, and downloadable attachments.
- Cards can be collapsed/expanded to show only sender and date.
- Emoji indicators (🖼️ for embedded images, 📎 for downloadable attachments) appear after the email date in each card.
- "Expand all" and "Collapse all" controls (with icons) are available in the thread header for quick navigation.
- The attachment count is a clickable link; clicking it expands a list of all attachments in the thread, each with a download link and an envelope emoji (✉️) that scrolls to the corresponding email card.
- Long strings (such as URLs) automatically wrap for better readability on narrow screens.
- Print/export to PDF hides the left column, header controls, and tooltips for clean output.
- All parsing is performed in memory only; no email content or attachments are written to disk on the server or client.
- No persistent storage or database is used on the backend.
- Optional browser caching (IndexedDB) is available, but only if the user enables it before upload. Cached data remains local to the user's browser and is never transmitted elsewhere.
- No email data is ever sent to third-party services; all processing is local to your environment.
- Intended for internal/private use only. Use with sensitive data at your own discretion.
-
Backend:
- Node.js + Express (in
server/) - Uses
mailparserfor robust .mbox parsing - Supports .mbox files directly or .zip files containing .mbox files
- No use of abandonware (e.g.,
mboxnpm package) - CORS enabled for local development
- 30MB upload limit enforced via
multer - All parsing and grouping logic is in-memory
- Node.js + Express (in
-
Frontend:
- React + Vite + TypeScript (in
client/) - Material UI (MUI) for layout and components
- Drag-and-drop and file picker for .mbox or .zip upload
- Threaded email navigation with attachment download
- Print styles for PDF export
- Uses IndexedDB (via
idb) for optional large-data caching
- React + Vite + TypeScript (in
- mailparser: Used on the backend to robustly parse .mbox files and extract email content, metadata, and attachments.
- multer: Handles multipart form uploads (file uploads) in the Express backend, enforcing the 30MB file size limit and providing easy access to uploaded files in memory.
- concurrently: Allows running both the backend and frontend servers with a single command for streamlined development.
- Material UI (MUI): Provides a modern, accessible, and responsive component library for building the desktop-focused user interface.
- idb: A small library for IndexedDB, used to cache large parsed email data in the browser.
- adm-zip: Used on the backend to extract .mbox files from uploaded .zip archives, enabling support for zipped email exports.
- GitHub Copilot: Assisted in vibe-coding this awesome and useful tool, helping with code, design, and documentation throughout the project.
This project was developed with the assistance of GitHub Copilot, powered by OpenAI's GPT-4 model. Copilot provided code suggestions, design ideas, and documentation support throughout the development process.
This project is licensed under the MIT License. See the LICENSE file for details.
- Pre-upload options such as (all on by default):
- Normalise subject (removing reply and forward prefixes)
- Normalise Google Calendar notification (removing state change and calendar name)
- Include inline attachments
- Include downloadable attachments
- Export as JSON
- Better removal/collapsing of quoted thread emails
🖨️ button in thread viewList all included downloadable attachments
