2

Cannot open an .mbox file with mutt

I want to open a 10GB .mbox file that I downloaded from my gmail account. When I use the command

neomutt -f 10GB_mboxfile.mbox

neomutt takes 10-20 seconds to open and when finally opened, there is no file listed in the the application. I have the following dummy .mbox (which I modified from a gmail mbox file):

From 9999999999999999@xxx Tue Mar 09 17:00:00 +0500 2019  
X-GM-THRID: 99999999999999999
X-mail-Labels: Archived,Sent,Opened
MIME-Version: 1.0
Date: Tue, 09 Mar 2019 17:00:00 +0500
Message-ID: <[email protected]>
Subject: THETITLE
From: My Name <[email protected]>
To: [email protected]
Content-Type: multipart/alternative; boundary="0000000000009999999999999"

--0000000000009999999999999
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable


ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ da=
s ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

--0000000000009999999999999
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div>ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=
ZZ das ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=
>

--0000000000009999999999999--

I am trying to open it with neomutt as follows:

neomutt -f themboxfile.mbox

neomutt opens but then no message is listed in the app. How is it possible to open this file with neomutt? (Although opening the same file works with mutt...)

EDIT

Beside the answer below I had a too old version: the apt get install neomutt on Ubuntu LTS 22.04 installed the version 20211029. I uninstalled neomutt and re-installed it with nix package manager. it installed NeoMutt 20231221 which worked without problem.

6
  • I don't know about Neomutt, but Mutt has no issue opening a Mbox file containing the message you show here (created by simply copying and pasting the message into a new file).
    – Kusalananda
    Commented Jun 8 at 13:48
  • @Kusalananda I think the problem is in the very large size of the file. Most software simply isn't designed to work with such large files. ecjb, I suggest splitting the mbox file into several smaller files. Commented Jun 8 at 14:00
  • @Kusalananda Many thanks for your comment. You are right: I just installed mutt and it worked. I changed the question accordingly (specifically for neomutt)
    – ecjb
    Commented Jun 8 at 14:00
  • This looks like a bug report/suggestion for improvement that should be directed to Neomutt maintainers. Commented Jun 8 at 14:02
  • @Vilinkameni thanks you for your comment: I submited the but there: github.com/neomutt/neomutt/issues/4321
    – ecjb
    Commented Jun 8 at 14:11

1 Answer 1

4

It looks like neomutt doesn't like those timezone offsets in the From_ lines.

After:

sed -Ei 's/^(From .*) [-+][0-9]{4}/\1/' file.mbox

To remove them, it seems to be happy.

RFC4155 which specifies the mbox format says the timestamp should be UTC and in ctime() format, but acknowledges that in practice many applications deviate from that standard. That timestamp is about when the email was added to the mbox, so is not that relevant and not showed by default by (neo)mutt.

3
  • Many thanks for your answer. So concretely, in order to read the mbox file, I should modify the entire file with your command?
    – ecjb
    Commented Jun 8 at 14:40
  • @ecjb, essentially yes, or use neomutt -f =(sed 's/.../.../' file.mbox) if using zsh, where that runs neomutt on an edited copy saved as a temp file, but you likely wouldn't want to do that for large files. As I said in comments to your question, you may want to use better file formats. Removing an email in a mbox file means rewriting the whole file (at least the part after the mail that was removed), removing a message in maildir is just removing a file for example. Commented Jun 8 at 15:23
  • ok many thanks for your detailed explanations
    – ecjb
    Commented Jun 8 at 15:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .