Courier IMAP
SSL
Edit the file:
/usr/local/etc/courier-imap/imapd.cnf
/usr/local/etc/courier-imap/pop3d.cnf
and fill out the necessary fields.
To create the SSL-imap certificate be sure that the file /usr/local/share/courier-imap/imapd.pem not exists, then run:
cd /usr/local/share/courier-imap
mkimapdcert
To create the SSL-pop3 certificate:
cd /usr/local/share/courier-imap
mkpop3dcert