It stores inboxes in mbox-like format, then some metadata in very weird .msf format, and on top on that SQLite database for search indexing. And it has some bewildering bugs like mixing up titles and content from two different messages, or slapping on messages date pulled from thin air..
IME, this happens when the message doesn't have a date (that is, Date header missing or invalid). There's an open request on bugzilla to use the last Received date in these cases.
- atomic file create with content
- atomic directory create
- atomic file move
- atomic file delete
- single-level file enumeration
No file modification in place which is the actual hard path. Not even appending to existing files.
Incidentally, reliable databases tend to also not rely on file modification, opting for a log-and-compact strategy instead.
It's when you start modifying existing data that 'just use a filesystem' becomes unviable.
No FS guarantees this. You can emulate this by writing to a tmp location, syncing and performing a move.
It is not technically atomic, because there is a period where oldpath and newpath both refer to the same file, but I don't think that is an issue for this usecase.
At work they were using outlook for mail and wondering why it crashes now and then (past 2 GB it starts writing over the start of the file or some such). We get a lot of big documents on email so switched to thunderbird and all is well since. Had to switch mailserver though since that one also only handled 2 GB. No idea what they were running but most likely something MS-related. Most of their stuff was MS at the time.
It uses a Xapian index, not an RDBMS, but it's impressive. RDBMSes aren't known for producing good natural language search results.
Rdbms for the email use case is kind of orthogonal to fast full text search.
Oh, and I also dislike even the idea that I have to find some "specialized software" to have basic functionality in my e-mail client. That's why most still suck a*.
If all you want is to grep your email, that's different, I think you can accomplish that with pine or other text mode email clients.
links in my stack: https://github.com/jakeogh/gpgmda-client
Yeah, files, are hard.