I've been using GNU/Linux for servers, mostly Debian. I am thinking of keeping my personal email on a centralized server. I have some GMail accounts, and a few from different domains from several web projects which are hosted at the corresponding website hosts.
I am buying a new PC to use as a home server for SVN, Web server, DNS, etc. I was thinking of taking advantage of the new hardware to centralize all my emails on one server.
I've had no experience whatsoever with e-mail servers. All I've done is use IMAP, SMTP, POP3, mostly over the internet, never locally. This question is quite wide, but let me explain what I would like to accomplish.
The main objective is keeping my emails locally: download via POP3 all of my emails from GMail and the different domains into one place. Then, I would also like to use some of these domains directly from my home server with a local SMTP. That is, send mails directly from my server, without having to go through a hosting account. I don't know if I'll use it for every account, but I would also like to have the option to use mail via IMAP.
Since I have no experience at all with mail servers, I know not much about options. The operative system will be Debian GNU/Linux Lenny.