Web Hosting – How to Host an Email Service?

I have a dedicated powerful server that I got for free,
But I do not have the privilege of super user on MySQL.
My question is:

Is there an open source code that I can use to give people free emails like Gmail for example! or give people a free host with a subdomain?

I did not know exactly where should I ask this question, so please, if you need to move on to another section, let me know!