Steve Litt wrote on 2026-01-24 15:53:
the thought of billions (or millions) of Maildir files per day is
laughable.
The preceding sentence is an ad homonym logical fallacy.
I don't think you know what "ad hominem" means. Maybe not even "logical
fallacy".
It's your opinion, which might be right, might be wrong, or might be
"it depends".
You dispute that massive quantities of small files can cause issues with
various (not necessarily all) file systems?
What about exhausting the inode count? Is that yet another factor to
consider when running a large mail server?
Besides being "my opinion", anyone who's actually done this and isn't
operating on feelings seems to think a DB is the way to go. See "Gmail".
To me the dead bang obvious course of action is to keep emails in
individual files, in a directory tree so that no single subdirectory
contains more than 1000 files
Have you never seen a mailbox before? Having over 1000 messages in an
Inbox folder is probably more common than not.
Arbitrarily splitting a mailbox into multiple sub-directories is just
another layer of complexity that doesn't solve anything.
Gmail doesn't even have folders, it has a representation of folders via
labels. I don't like it, but that means every Gmail user basically has
all their messages in one folder.
What you find "dead bang obvious" has been rejected by those who
actually do the thing.
and then keep a copy of the email's subject, date, to, from, cc,
bcc, List-ID and full pathname of the email in a relational database
like Postres or MariaDB.
If you're going that far into a DB, keep the message body there too.
Maybe the attachments can be separate, but why bother at this stage, a
RocksDB record is *recommended* to not exceed 3GB which is a pretty
large email:
Q: What's the maximum key and value sizes supported?
A: In general, RocksDB is not designed for large keys. The maximum
recommended sizes for key and value are 8MB and 3GB respectively.
https://github.com/facebook/rocksdb/wiki/RocksDB-FAQ
Now you can lightning quick look up by all major headers, but still
have the email message stored as an email file readable from any
email client.
Email clients don't have any concept of storage on the server - whether
the messages are mbox, Maildir, or a DB. Why would an "email client"
ever try to read storage directly on the server?
If you simply *must* be able to search bodies
"If" is extraneous. People *must* be able to search message bodies. That
is non-negotiable.
_______________________________________________
Discuss mailing list
[email protected]
https://lists.blu.org/mailman/listinfo/discuss