If you're using ubuntu, you are in luck. The ubuntu community documentation explains about setting up a mail server. It's not that easy. I set up a mail server, but every time I go back to change something it is somewhat confusing. I would document whatever you do in some personal readme files.
You normally need a static ip. But it may also work with DynDNS or similar service. I'm not sure. I use a static IP for a mail server I have at an ISP, but use the DynDNS to remotely connect to a windows PC where the IP address changes now and then.
https://help.ubuntu.com/community/MailServer you may have already seen. If not, start there.
I kind of doubt there is a language for tweaking the webmail interface. More likely some options you select. But the only way to know is to try it. Have a good time. I think it's a good project, lots of interesting details.