As for simply delivering them to other directories: that’s pretty easy depending on what very agent you use (Postfix, qmail, sendmail etc). They are all designed to support that. It’s the clients that struggle.
I run my own server so info stuff like this automatically as the mail comes in.
The people saying “use smtp” don’t know what they are talking about: SMTP is the protocol for delivering mail to a host. You want to process the message as or after it arrives.
At the time I was only experimenting with it for an idea I never fully realized, creating a system for video games to automatically play games asynchronously using email instead of a server (also you could see it was your turn again just by email notifications), thus being able to survive in perpetuity as long as SMTP remained a thing, but I could see using it to do what you're suggesting as well.
Why do mail programs maintain their own database of messages? It used to be quite handy to organize your projects by directory or tree, with mail files, presentations, code etc all kept together, greppable and with some choice of which program to run. Now if I am working on a couple of projects I have to search around (was that a slack note? An iMessage? Mail? Or perhaps it was a comment in a document?