2

I currently use mu4e with a maildir storage format as my email client.

I used to use Thunderbird with an old Outlook based email account for work, using IMAP. In my .thunderbird directory tree, I can still find a directory with files called INBOX, Sent-1 etc. where the files appear to be concatenated email messages corresponding to a folder with the corresponding filename. There are also corresponding .msf files for (most) of the email files in the same directory.

I want to convert this directory and its files into the maildir format, for ease of use. There are a bunch of tools out there for converting mbox formats in Thunderbird to maildir, including the perl script mb2md (which I believe is derived/related to this Python script).

I've tried this out and get the error

Fatal: Source is not an mbox file or a directory!

Are my files in the mbox format? They don't have the appropriate extension (i.e. .mbox) but as I understood it the format is just a single file per mail folder as I've described above. Or is there something else I have to do?

EDIT

This is the command that generates the error. I have not created the maildir_outlook directory, but I don't think that's the problem.

perl mb2md-3.20.pl -s outlook.office365.com/INBOX -d maildir_outlook

For clarity, the INBOX file looks like this (after some anonymization):

From
Received: from ***.OUTLOOK.COM by ***.OUTLOOK.COM with HTTPS via ***.OUTLOOK.COM with HTTPS via *** Fri, 11 Oct 2019 08:04:18 +000
Received: from *** ...
Received: from *** ...
Authentication-Results: spf=pass (sender IP is ***.***.***.***) 
smpt.mailfrom=*** ...
Received-SPF: Pass ...
Received: from ...
Received: from ...
Received: from ...
...
    MESSAGE BODY
<html xmlns:...
...

and this just repeats with all the emails contained in the INBOX folder.

The result of file INBOX is:

INBOX: ASCII text, with very long lines (678), with CRLF line terminators
2
  • Adding the copy / paste of the exact command that produced the error might be useful. It's hard to tell if your files are in mbox format without seeing them, so maybe showing the first number of lines of the file could help (assuming there is no secret info in there); example "head INBOX". Maybe seeing what the "file" command says about your file could be useful (it's unlikely to identify an mbox file as specifically an mbox file, but it might give some hints); example "file INBOX".
    – DericS
    Feb 21, 2023 at 14:01
  • @DericS Added the command and a summary of the output of head -n 700 or so, very repetitive headers mostly. The file command just says INBOX is ASCII text. Feb 21, 2023 at 20:13

1 Answer 1

2

It looks like your outlook.office365.com/INBOX file might be in mbox format. A Library of Congress website gives some useful information on a number of mbox formats. However, I'm going to guess that the issue you are seeing is not related to the format of your INBOX file.

When using the mb2md command, if the source file is not an absolute path, then your home directory will be used. Not your current working directory.

Here's a comment from the mb2md script:

# -s source Directory or file relative to the user's home directory

I suggest that you try using an absolute path with your -s option.

If you haven't seen it already, the following question and answers are interesting for the topic at hand.

1
  • Thanks! Should have read the documentation more carefully, and in fact the relative to user's home directory applies to -d as well. The script does create the directory and the splits INBOX into cur, new, and temp folders with files in just cur at the moment. Unfortunately the files don't seem to be just a single message, but a string of messages. Thanks for your the linked post, it looks very useful! Feb 26, 2023 at 11:21

You must log in to answer this question.

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