To set up an IMAP mail server install task-imap which installs wu-imap. IMAP will then be running.
A sample IMAP session:
$ telnet imaphost 143 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. * OK Microsoft Exchange IMAP4rev1 server version 5.5.2655.37 (imaphost.act.cmis.CSIRO.AU) ready