A robust, standalone Python tool to convert Thunderbird mailbox (mbox) files or entire profiles into searchable, paginated HTML archives with embedded attachments.
- Profile Discovery: Automatically finds all mailboxes within a Thunderbird profile (searching
Mail/andImapMail/directories). - Self-Contained HTML: Each email is converted into a single HTML file.
- Embedded Attachments: Images and attachments are embedded directly into the HTML using Base64 data URLs. No external files needed.
- Search & Pagination: The generated index files include client-side search (filter by subject, sender, etc.) and pagination for large mailboxes.
- Modern UI: Clean, responsive design with collapsible raw headers.
- Robust: Gracefully handles encoding issues and skips problematic messages without crashing.
- No Dependencies: Uses only the Python standard library. Works on Linux, macOS, and Windows.
No installation is required. Simply download mbox2html.py and run it with Python 3.
curl -O https://raw.githubusercontent.com/yourusername/mbox2html/main/mbox2html.py
chmod +x mbox2html.pypython mbox2html.py /path/to/thunderbird/profile /path/to/output_archivepython mbox2html.py /path/to/Inbox /path/to/output_archivepython mbox2html.py "/path/to/Mail/Local Folders/Archiv.sbd" /path/to/output_archive- Discovery: The script walks the input path to find files that look like mbox mailboxes (using heuristics like skipping
.msfand known metadata files). - Conversion: Each message in the mbox is parsed using the modern
emaillibrary. - Encoding: Attachments are converted to Base64 and embedded into the HTML.
- Indexing: A top-level
index.htmlis created for the profile, and a per-mailboxindex.htmlis created for each folder, featuring a Javascript-powered search and pagination engine.
This project is licensed under the MIT License - see the LICENSE file for details. Created with AI support 🤖