If you end up running you own server, whatever you do make sure you don't end up running the UW IMAP server. Courier IMAP is good, but maybe a little unnecessarily complex. I use Dovecot which is easy to set up and performs very well even on very old hardware.
Also, using Dovecot you can get away with sticking with mbox style mailboxes due to Dovecot's excellent indexing system.
That made me sit up, because I'd always thought my distrust of non-mbox folders meant I was stuck with UW. So I downloaded and installed Dovecot (it's not in the docs that I could find, but it turns out you can do preauthenticated IMAP-over-SSH using "ssh
server exec /usr/libexec/dovecot/imap"), but disappointingly it's not noticeably faster. I think what this probably means is that UW itself has got faster and more efficient over the years -- I'm using version "imap-2007".
Peter