by makeitdouble · 2y ago · 0 comments
Anyone who tried to naively store millions of files in a file system folder realizes at some point that listing files becomes horrible, there's no GUI tool that will handle that gracefully, and even on the CLI this is a very serious roadblock.
It's still fine for accessing files straight by name, and there must be ways to read each file sequentially, but the concept of folder merely becomes an arbitrary namespace and not something to handle a whole group.
The other obvious option is to shard the mail folders to ensure there's no more than X files in each folders, but that becomes pretty complex IMHO.
At the end of the day, a database is needed somewhere down the line.
The main downside for me is that you can only really access the mailbox using dovecot/IMAP as tools like mutt don't support it.
I mean it depends on the volume of e-mail you get, but:
INBOX
Archive/2004
Archive/2005
...
Archive/2023
Isn't something I would call complex, and works out to about 10k files per directory for me.