First of all, I want to learn how to do it, just for fun.
If you want to do this yourself for fun, here is what I believe a good way to do it:
install and configure Dovecot with one account for each user; see for example https://doc.dovecot.org/configuration_manual/quick_configuration/
install and configure OfflineIMAP to synchronize the IMAP folders between your ISP IMAP server and your Dovecot server; see for example http://www.offlineimap.org/doc/quick_start.html
At this point you should have a functional IMAP server, and your users can use your ISP SMTP server to send their mails.
If you want to go one step further, and want your users to send their mails through your server, install and configure Postfix; see for example http://www.postfix.org/SOHO_README.html or https://www.howtoforge.com/how-to-relay-email-on-a-postfix-server
If you want to go another step further, and want to remove the mails from your ISP IMAP server (instead of just mirroring it in Dovecot), install and configure Fetchmail; see for example https://www.linode.com/docs/guides/using-fetchmail-to-retrieve-email/