mboxShell 1.4: a CSV That Points at Each Exported File, After a Full Security Review
mboxShell 1.4.2 adds a File column to the CSV export, so each row can be matched to its exported .html or .eml. It comes after 1.4.0, a security, stability and speed review of the whole program: signed indexes, search 6.7× faster on 400,000 messages.
mboxShell, our open-source terminal tool for MBOX files, released 1.4.2 today. It’s a small release with one new feature that a user asked for: the CSV export can now tell you which exported file belongs to each row. It closes the 1.4 series, which started a few days ago with the biggest review the program has had, so this post covers all three releases.
1.4.2: the CSV knows each message’s file
mboxshell export writes a mailbox in several formats: one .eml, .html or .txt file per message, or a single .csv with one row per message (date, sender, recipients, subject, size, attachments, labels and Message-ID). Many people use both together. The CSV goes into a spreadsheet or a script, and the HTML files get converted to PDF, indexed or archived.
What was missing was a reliable way to join them. Until now, a script had to list the *.html files in the folder and guess which row each one belonged to, which breaks as soon as there are other files in there.
Since 1.4.0, --dirname seq-no already named every file after its message’s position in the mailbox. 1.4.2 applies the same option to the CSV, which gets a new last column, File:
mboxshell export -f html --dirname seq-no -o outdir mail.mbox
mboxshell export -f csv --dirname seq-no -o outdir/export.csv mail.mbox
Date,From,To,CC,Subject,Size,Has_Attachments,Labels,Message_ID,File
2024-01-04 10:00:00,Alice <[email protected]>,…,<[email protected]>,0001
0001 goes with 0001.html, 0001.eml and the attachment folder 0001/ that mboxshell attachments --dirname seq-no creates. A few details:
- The other columns don’t move.
Fileis added at the end, so a script that reads columns by position keeps working. - It works with
--query. The numbers always count the whole mailbox, so a filtered CSV lines up with a full export, and with the PDFs built from it. --seq-widthapplies, so the numbers are padded with zeros to the width you choose.- With the default names, nothing changes. By default files are named after their date and subject. When two messages share both, the second file gets a suffix, and that’s only decided when the files are written. The CSV can’t know it in advance, so in that mode it stays as it always was.
The idea came from an issue on GitHub by the author of pdf-toolkit, a tool that turns mboxShell’s HTML exports into PDFs with their attachments.
1.4.2 also updates its dependencies to their latest compatible versions. It still builds with Rust 1.88, and cargo audit reports no known vulnerabilities.
1.4.0: a review of the whole program
1.4.0 had no new commands. Instead, it went through the whole program looking for security, stability and speed problems.
An index that arrives with a mailbox is no longer trusted. mboxShell saves an index next to each mailbox so it opens fast the next time, and that index travels with the mailbox in a ZIP file or a shared folder. Whoever supplied both files decided what the list, the searches and the CSV export showed, and could hide messages. Every index is now signed with a key that only your user account has, and one that doesn’t verify is rebuilt from the mailbox.
The remote-image block in HTML exports can’t be bypassed any more. A specially written address could get past it, and opening the page fetched the image, which tells the sender when and where the mail was read. Exported pages now also carry a security policy that blocks it.
Plenty of fixes. attachments skipped some attachments, such as a PDF sent as the whole message, which is what scanners and fax gateways do. Mailboxes with an unusual From line were read as a single message. The end of very long messages couldn’t be read in the interface. And the Linux binaries refused to start on Debian 12, Ubuntu 22.04 and older systems.
And it’s faster. On an 11.8 GB mailbox with 400,000 messages:
| before | 1.4.0 | |
|---|---|---|
Full-text search (body:) | 23.4 s | 3.5 s |
| Indexing | 8.6 s | 6.7 s |
| Extracting attachments | 75 s | 46 s |
The index format changed (v7), so existing indexes are rebuilt the first time you open each mailbox. 1.4.1 and 1.4.2 keep that format, so you won’t wait again.
1.4.1: two dependencies
1.4.1 updated two libraries because of security advisories. One of them is ammonia, which cleans the HTML of messages before exporting them or showing them in the browser. Its fix closes a way to slip in scripts through embedded SVG and MathML. Nothing else changed.
Where to get it
If you installed mboxShell with Homebrew, Scoop or Cargo, updating takes one command:
brew upgrade mboxshell # macOS and Linux
scoop update mboxshell # Windows
cargo install mboxshell # from crates.io
The full notes are on the release page on GitHub. The mboxShell page has the binaries for Linux, macOS, FreeBSD and Windows, the commands and the latest releases.
And if you’d rather have a window than a terminal, the same engine lives in Mbox Viewer Pro, for Mac, Windows and Linux.
Open your archive with Mbox Viewer
Native app for Mac, Windows and Linux. Streams MBOX and EML files of any size, fully offline.