Maildir filenames and suffix

User Help for Mozilla Thunderbird
Post Reply
EnglishMohican
Posts: 2
Joined: December 21st, 2016, 10:22 am

Maildir filenames and suffix

Post by EnglishMohican »

Linux OS, Thunderbird 45.5.1, long time computer user but struggling with the concepts involved in a mail system, MTA, MUA dovecot, procmail etc.

I have lived long enough to be very fond of simple text files for mail storage and providing my own backup. Ideally, I want to remove emails from my ISP's servers asap and store them on my home PC and NAS as backup. There are not huge numbers of them.

I am trying to implement this by using maildir and .eml files which I know are not quite text files but they are close. I have 4 email accounts, one is POP and the other three are gmail or yahoo accounts which can be IMAP or POP but are IMAP at the moment. Preferably, I would like to consolidate all the emails from all 4 accounts into one folder containing one text file per message with a simple indexing system that might be nothing more than sensible file names within a file manager.

So far, I have used the ImportExportTools add-on to copy out an entire folder to an folder outside Thunderbird and quite approved of the file naming arrangement (Date, from, to, subject or similar).eml. Thunderbird was happy to open each file correctly when called from a file manager and the HTML index was sufficient for my purposes. The problem seems to be that it is a once off operation that cannot add extra files to the folder or index - not sure about that bit yet - and is an extra on top of Thunderbirds normal operations

I have now persuaded Thunderbird to store messages from one of the gmail accounts in Maildir format directly and am puzzled that when I look in the folder, it uses some numeric file name without a .eml suffix.

The absence of the suffix means that Thunderbird opens the file as a blank message with an attachment - which is the file itself. If I add the suffix (rename within a file manager), Thunderbird opens the file correctly. This seems unhelpful of Thunderbird - to generate a file that it then refuses to open correctly. Is it just me who has missed a setting or some such?

Also, is the numeric file name a hash of the file contents that is then indexed elsewhere by subject, from, to etc? For my purposes that is bad as it moves away from simple text files and into opaque databases.

If I am right about this, then using Thunderbird to directly generate the .eml files does not seem the way to go. It does not get me where I want to be. Am I right about this, have I missed something within Thunderbird that will help and can anybody suggest a better way forward.
User avatar
tanstaafl
Moderator
Posts: 49647
Joined: July 30th, 2003, 5:06 pm

Re: Maildir filenames and suffix

Post by tanstaafl »

Thunderbird supports two different mail storage formats - mbox and maildir. It has some support for dealing with .eml files but it doesn't really support .eml files as a mail storage format.

https://wiki.mozilla.org/Thunderbird/Maildir

"Preferably, I would like to consolidate all the emails from all 4 accounts into one folder containing one text file per message with a simple indexing system that might be nothing more than sensible file names within a file manager."

The first part could be done by choosing a folder in an account that is configured to use maildir. I'd suggest using the Local Folders pseudo/special account. I'm out of town so I can't test what maildir file name convention Thunderbird is using. However, it sounds like it uses numeric gibberish, which is why you experimented with using .eml. One workaround for that might be to choose a folder in a IMAP account instead and find a Linux utility that can do a incremental backup of its contents as .eml files. See http://kb.mozillazine.org/IMAP_backup for some starting points, to help you find that. "Beyondinbox" is a $10 program that might be your best bet.

I suggest you also browse http://kb.mozillazine.org/Archiving_your_e-mail and consider whether using something like MailStoreHome to archive your mail might be a better solution. Another possibility might be to run Mbox2XML under Wine.
EnglishMohican
Posts: 2
Joined: December 21st, 2016, 10:22 am

Re: Maildir filenames and suffix

Post by EnglishMohican »

Thank you. I will work through all those suggestions and do some experiments.
Post Reply