what you're looking for is stunnel..
1) Run the following to prepare stunnel:
cp /etc/stunnel/stunnel.conf-sample /etc/stunnel/stunnel.conf
chown nobody:nobody /var/stunnel
When generating the stunnel key, make sure that the Common Name (FQDN of your server) is the host name of the server. Otherwise mail clients may complain of a mismatch.
2) Make the following changes in '/etc/stunnel.conf', then stunnel will be configured to support pop3s/impas/smtps:
cert = /etc/stunnel/stunnel.pem
chroot = /var/stunnel/