I am trying to move to mutt for mail client and am trying to have email localy. I have 2 sources of saved email:
- the first one was obtained from the .mbox file form google: I wrote a script which extacted each email in a separated
.txt
file (to be able to 1. search with grep content of file 2. organize them according to years and 3. not having to parse a single 10GB+ file each time I want to access the emails). - the second one was obtained by saving locally the email from with
neomutt
application.
There are many fields which seem to be coded differently in a significant way. For example:
In the .mbox split saved file as txt, the fist line is (I think because there are several similar looking field):
From [email protected] Tue Jul 21 07:48:31 2022
Whereas in the file saved locally by mutt, the first line is as follows
From 1370888888881122222@xxx Tue Jul 21 07:48:31 +0000 2022
The email adress is actually only displayed in other fields below:
...
X-Sender: [email protected]
...
Return-path: <[email protected]>
...
Moreover the file saved by mutt appears in color in vim (as if it detects the file structure and not for for the split .txt file of the .mbox)
Here are my questions:
- Why those differences
- How do vim detects the structure difference
- (most importantly!:) is it possible to convert the split .txt file from the mbox in the same format as the one saved in mutt?
neomutt -f my10GB_mboxfile.mbox
it takes quite a long time (10-20 seconds) to load and then when neomutt was finally done, I was not able to parse through the emails (as nothing was read)formail
(shipped withprocmail
to process mailbox and mail files). Searching more effectively including by date/sender/subject/body can be done with indexers such asmairix
ornotmuch
both of which you can easily hook intomutt
.