For the software side, I would most likely use mailinabox [1] or sovereign [2]. They both setup mail servers for you with reasonable defaults using Ubuntu and Debian respectively.
Ars Technica has a great 4-part guide [3] on setting up a mailserver yourself.