A modern, desktop-optimized email viewer for MBOX files built with Next.js and NextUI.
- Modern UI: Clean, responsive interface optimized for desktop use
- Multiple MBOX Support: Load and browse multiple MBOX files
- Rich Email Display: View all email metadata, headers, and content
- Content Rendering: Support for both plain text and HTML emails
- Attachment Handling: Preview and download email attachments
- Search & Filter: Powerful search and filtering capabilities
- Theme Support: Light and dark theme modes
- Three-Panel Layout: File browser, email list, and detail view
- Node.js 18.0 or higher
- npm or yarn package manager
-
Clone or download this repository
-
Install dependencies:
npm install
-
Place your MBOX files in the
mbox-filesdirectory (created automatically) -
Start the development server:
npm run start:dev
-
Open your browser and navigate to
http://localhost:4000
npm run build
npm start:prodBy default, the application looks for MBOX files in the ./mbox-files directory. You can change this by setting the MBOX_DIRECTORY environment variable:
# In .env.local
MBOX_DIRECTORY=/path/to/your/mbox/filesThe application runs on port 4000 by default. You can change this in the package.json scripts or by setting the PORT environment variable.
MBOX is a standard mailbox format where:
- Messages are stored in a single text file
- Each message starts with a "From " line
- Messages are separated by blank lines
- Standard MBOX format
- Files with
.mboxextension - Files with
.mbxextension - Files without extension (detected by content)
- Next.js 14: React framework with App Router
- NextUI: Modern React UI library
- Tailwind CSS: Utility-first CSS framework
- Lucide React: Beautiful icon library
- TypeScript: Type-safe development
- Next.js API Routes: Server-side email parsing
- Mailparser: Robust email parsing library
- iconv-lite: Character encoding support
- Node.js fs: File system operations
- FileList: Browse and select MBOX files
- EmailList: Display paginated email list with search
- EmailDetail: Rich email content viewer with tabs
- MboxParser: Server-side MBOX parsing utility
The application extracts and displays:
- Headers: From, To, CC, BCC, Subject, Date, Message-ID
- Content: Plain text and HTML body content
- Attachments: Files with preview and download support
- Metadata: Message size, priority, thread information
- Raw Data: Complete email source when needed
- Pagination: Large MBOX files are loaded in chunks
- Lazy Loading: Email content loaded on demand
- Caching: Parsed email metadata is cached
- Streaming: Large files processed incrementally
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
- Path Validation: Prevents directory traversal attacks
- Content Sanitization: XSS protection for email content
- File Type Validation: Restricts access to MBOX files only
- Error Boundaries: Graceful error handling
-
No MBOX files found
- Check that files are in the correct directory
- Verify file extensions (.mbox, .mbx, or no extension)
- Ensure files contain valid MBOX format
-
Parsing errors
- Check file encoding (UTF-8 recommended)
- Verify MBOX format compliance
- Look for corrupted message boundaries
-
Performance issues
- Reduce email batch size in settings
- Check available system memory
- Consider splitting large MBOX files
Enable debug logging by setting:
NODE_ENV=developmentmbox-viewer/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── components/ # React components
│ ├── types/ # TypeScript definitions
│ └── globals.css # Global styles
├── lib/ # Utility libraries
├── mbox-files/ # MBOX files directory
└── public/ # Static assets
npm run start:dev: Development servernpm run build: Production buildnpm run start:prod: Production servernpm run cq:lint: Code lintingnpm run cq:type-check: TypeScript checkingnpm run cq:format: Prettier formattingnpm run cq: Code quality operations
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is open source and available under the MIT License.
- NextUI team for the beautiful component library
- Mailparser contributors for robust email parsing
- Next.js team for the excellent React framework
- Lucide for the clean icon set
Note 1: This application is designed for viewing email archives and does not support sending emails or connecting to live email servers. It's perfect for analyzing exported email data, migrating between email systems, or forensic email analysis.
Note 2: The fundamentals of this application have been generated with GitHub Copilot Agent Mode using Claude Sonnet 4. Parts of the code have been revised and manually upgraded, however, most of it has been generated as the goal of this tool is to serve a very specific functionality in a straightforward manner. Future contributions to this repository must take this notice into account in order (if the time comes) to make a robust web application out of this.