I use Modoboa, it installs dovecot/postfix/amavis/etc for you and provides a Python-based webmail and administration interface. It's not on a Pi or on my home network but it will work just the same as long as your ISP isn't blocking port 25. iRedMail is also a nice solution but the open source version is quite crippled.
Be aware though, mail servers are very complex and you should have an understanding of how the different components work in case something goes wrong. Non-datacentre IPs are also likely to trigger recipient spam filters. If this is just for your own education, have at it, but a production server would be better off on a cloud server (see Linode or Digital Ocean) I think.
If you'd rather install every component yourself without using such a package, you can use postfixadmin and rainloop for account management and webmail respectively. You could also write an administration interface yourself for managing accounts, that component is pretty trivial behind the scenes, but creating your own webmail would just be reinventing the wheel - if you even need webmail.
I tried to set up a mailserver from scratch like a year ago and it was a pita, don't recommend that. I ended up using Modoboa, setup was easy, and it works well next to all my other webapps.
Modoboa provides a nice backend web interface for the usual suspects in Linux email hosting (Dovecot, Postfix, Radicale, Amavis, etc).
You can then pick your poison for the frontend; Rainloop, Horde, Roundcube, etc.
setting up postfix / dovecot is kinda meh, however what i did when i started hosting my own mail server for the first time was using modoboa. Its a python based full solution, you just have to run the install script and get a mail server (for SMTP, IMAP, POP3) and a webinterface where you can configure users or even mail from your browser. The reason i moved away from it, is because it comes with ClamAV by default which ate like 25% of my ressources why idling. So before blindly running the install script you should really take a look at the installer configuration file (afaik you can disable unwanted components). It's very easy to install and maintain, way way way easier than setting up a mail server from scratch.