Skip to content

ferdinandkeil/mbox2html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

mbox2html

A robust, standalone Python tool to convert Thunderbird mailbox (mbox) files or entire profiles into searchable, paginated HTML archives with embedded attachments.

Features

  • Profile Discovery: Automatically finds all mailboxes within a Thunderbird profile (searching Mail/ and ImapMail/ 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.

Installation

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.py

Usage

Convert an entire Thunderbird profile

python mbox2html.py /path/to/thunderbird/profile /path/to/output_archive

Convert a specific mbox file

python mbox2html.py /path/to/Inbox /path/to/output_archive

Convert a Thunderbird .sbd directory

python mbox2html.py "/path/to/Mail/Local Folders/Archiv.sbd" /path/to/output_archive

How it Works

  1. Discovery: The script walks the input path to find files that look like mbox mailboxes (using heuristics like skipping .msf and known metadata files).
  2. Conversion: Each message in the mbox is parsed using the modern email library.
  3. Encoding: Attachments are converted to Base64 and embedded into the HTML.
  4. Indexing: A top-level index.html is created for the profile, and a per-mailbox index.html is created for each folder, featuring a Javascript-powered search and pagination engine.

License

This project is licensed under the MIT License - see the LICENSE file for details. Created with AI support 🤖

About

mbox2html

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages