I was using courier-imap and courier-pop until today. I've just installed the -ssl versions of both.
At install they both create a certificate for localhost based in New York. This doesn't work unless it really is localhost.
In /etc/courier there are imapd.pem, imapd.cnf, pop3d.pem and pop3d.cnf
I left the non-ssl IMAP running but only for 127.0.0.1 for squirrelmail.