The setup described here enables you to store all your email (and email for other people) on a single machine, which might be a home server, a remotely hosted server, or even a desktop, and then access it from anywhere.
Read it here
There's a wide variety of IMAP server software. Options include UW-IMAP, created by the University of Washington, which invented IMAP itself; Cyrus, from rival university Carnegie Mellon; Courier, and a number of others,
Their relative advantages have been the subject of hotly argued battles, centering around storage formats and nuances of protocol and design. They all work well, but Dovecot stands out — it's fast, flexible, easy to configure, and compatible with the various popular ways of doing things.