# vim /etc/dovecot/conf.d/10-master.conf
service imap-login {
   inet_listener imap {
   port = 0
   }
   inet_listener imaps {
      port = 993
      ssl = yes
   }
}

service pop3-login {
   inet_listener pop3 {
      port = 0
   }
   inet_listener pop3s {
      port = 995
      ssl = yes
   }
}