If you get this error with squirrelmail:
Error connecting to IMAP server: localhost. 111 : Connection refused
then use the following guide to get IMAP running: