Setting up your personal email server correctly hassle free: mail-in-a-box[4]
Most gmail features requires losing all expectations of privacy and as such are not desirable or feasible. That said IINM full text search already exists in kde's kmail.
I have no use for threaded conversations across folder, so I have no suggestions for this, sorry.
Maintained opensource webmails do exist, e.g. roundcube[5], mailpile[6], rainloop[7], zimbra[8], ...
Non thunderbird desktop clients do exist too: claws[9], sylpheed[10], kmail[11], mail[12], geary[13], ...
[1]: https://trojita.flaska.net/
[2]: https://www.caliopen.org/en/
[4]: https://mailinabox.email/ and https://github.com/mail-in-a-box/mailinabox
[7]: https://www.rainloop.net/
[9]: http://www.claws-mail.org/
[10]: http://sylpheed.sraoss.jp/en/
[11]: https://userbase.kde.org/KMail
You may argue that it's because email is a solved problem by now, but I don't think so:
Setting your own personal email server? Still a hassle to do correctly. Full text search a la Gmail? You can forget it. Threaded conversations across folders? Not for you. Hosting a webmail? Good luck finding a maintained one. Want a desktop client? The flagship Thunderbird is not the healthiest project right now.
I would really like to see the Redis or the Golang of emails.